Implementation:3641397194 wq Gpt6 Astra renderPack
| Knowledge Sources | |
|---|---|
| Domains | Prompt_Engineering, Template_Processing |
| Last Updated | 2026-10-26 12:00 GMT |
Overview
Concrete tool for rendering seat-specific prompt packs by template substitution, provided by the ColdBrew Zero desktop library.
Description
The renderPack function produces the final "破甲" (armor-breaking) prompt text for a specific AI model client seat. It reads the seat's `.md` template, substitutes all `Template:TOKEN` placeholders with resolved values (APP_TITLE, ACTIVATION_WORD, ROUTER, IDA_MCP, UNIFIED, WORKFLOW, ACTIVATION_REPLY, etc.), and wraps the result in `` markers.
The renderRouter helper assembles the router content from 5 layers: ROUTER.md (head), NORMALIZER.md (talk), 6 route parent files, leaf INDEX.md, and 80 leaf skill files. The activationReply helper reads the shared activation page payload from `packs/activation-reply.md`.
Usage
- Install preview: called by `basePlan` to generate the pack text for the write plan.
- Verify: called again during `SeatTransactions.verify` to compare expected vs. actual file content.
- Activation gate: called by `ActivationGate.input` to provide `instructionText` when a session is activated.
- Pack inspection: called directly to display the rendered pack for a seat.
Code Reference
Source Location
- Repository: ColdBrew Zero
- File: desktop/src/lib/seat-packs.js
Signature
const PACK_IDS = ["codex", "claude", "grok", "deepseek", "glm53", "gemini",
"doubao", "workbuddy", "cursor", "mimo", "kimi"];
const ROUTE_IDS = ["cha-bin-unlock", "cha-playfield", "cha-netcast",
"cha-apicloud", "cha-labpipe", "cha-inkstage"];
function renderPack(seatId: string) -> string
function renderRouter() -> string
function renderRouteSkill(routeId: string) -> string
function renderLeafSkill(leafId: string) -> string
function leafIds() -> string[]
function wrapMarked(seatId: string, body: string) -> string
function markers(seatId: string) -> { begin: string, end: string }
function packsDir() -> string
function seatMeta(seatId: string) -> object | null
// From prompt-engine.js:
function activationReply() -> string
Import
const { renderPack, renderRouter, PACK_IDS, markers } = require('./seat-packs');
const { activationReply, ACTIVATION_WORD } = require('./prompt-engine');
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| seatId | string | Yes | One of PACK_IDS (11 seat IDs); throws "missing pack" if template not found |
Outputs
| Name | Type | Description |
|---|---|---|
| returns | string | Fully rendered pack with begin/end markers, all tokens substituted |
Usage Examples
Render a Pack
const { renderPack, PACK_IDS } = require('./seat-packs');
// Render the Claude seat pack
const pack = renderPack('claude');
console.log(pack.substring(0, 200));
// Starts with: <!-- CHA-CLAUDE-POJIA:BEGIN -->
// Contains: substituted APP_TITLE, ACTIVATION_WORD, ROUTER, etc.
// Ends with: <!-- CHA-CLAUDE-POJIA:END -->
Get Markers for a Seat
const { markers } = require('./seat-packs');
const { begin, end } = markers('codex');
// begin: "<!-- CHA-CODEX-POJIA:BEGIN -->"
// end: "<!-- CHA-CODEX-POJIA:END -->"
Render Router Only
const { renderRouter } = require('./seat-packs');
const router = renderRouter();
// Concatenation of: ROUTER.md + NORMALIZER.md + 6 parent routes +
// leaf INDEX.md + 80 leaf skills
Activation Reply
const { activationReply } = require('./prompt-engine');
const reply = activationReply();
// Reads packs/activation-reply.md, trims trailing whitespace, adds \n