From 89db57ba44d91d1330bd165c48f73c9cfdcd5452 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Jul 2026 07:11:12 +0000 Subject: [PATCH 1/2] Add agentic file-summary header to skills/rig/rig.ts (7476c6d) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- skills/rig/rig.ts | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/skills/rig/rig.ts b/skills/rig/rig.ts index 5bf9076..895e524 100644 --- a/skills/rig/rig.ts +++ b/skills/rig/rig.ts @@ -1,3 +1,58 @@ +/** + * @file skills/rig/rig.ts @last-analyzed 7476c6d @edit-time 2026-07-23T07:07:59Z + * @purpose Minimal TypeScript agent harness: typed input/output schemas, prompt intents, Copilot SDK runtime + * @deps @github/copilot-sdk (CopilotClient,RuntimeConnection,approveAll); node:path,url,fs/promises,child_process,util + * T:Json type null|bool|num|str|Json[]|{[k]:Json} + * T:Schema type StringSchema|NumberSchema|BooleanSchema|UnknownSchema|ArraySchema|ObjectSchema|RecordSchema|EnumSchema|OptionalSchema + * T:InferSchema type TS inference from schema descriptor to runtime type + * T:AgentInputValue type input accepting raw values or PromptIntent/PromptBuilder at any nesting level + * T:Simplify type flattens intersection types for display + * T:ValidationResult type {ok:true}|{ok:false;error:string} + * T:AgentSpec type {name,description,input,output,prompt,addons?,maxTurns?} agent declaration + * T:AgentFn type callable agent with .use(addons) and .spec property + * T:AgentFactory type (options:AgentOptions)=>Agent|Promise + * T:Agent interface {ask(input,opts?):Promise,close():Promise} + * T:AgentAddon type middleware (ctx,next)=>Promise; ctx exposes spec,turn,prompt,output,completed,nextPrompt + * T:AgentAddonContext type context passed to each addon in the chain + * T:AgentDefinitionFactory type typeof agent (for passing agent constructor as value) + * T:AgentError class error carrying turn,agentName,rawOutput,parseError fields + * T:Tool type ToolConfig+name; created by defineTool + * T:ToolConfig type {description,parameters,handler} + * T:PromptIntent type declarative placeholder {kind:'bash'|'read'|'write',…} resolved into prompt text + * T:PromptBuilder class template-tag result; composes intents+strings into a prompt fragment + * T:PromptHelpers type shape of exported p object + * T:ResponseAnalysisResult type {ok:true;output}|{ok:false;error:AgentError} + * T:CopilotEngineOptions type CopilotClientOptions minus connection, plus server/token/headers fields + * T:LaunchOptions type options for launchRigProgram (server,token,headers,cwd,args) + * T:LauncherIo type {stdin,stdout,stderr} override for launcher subprocess + * T:JsonSchemaObject type {[key:string]:unknown} plain JSON Schema object + * s.string/number/boolean SchemaHelperFactory primitives; call as value or fn(desc) + * s.array(items,desc?) ArraySchema + * s.object(props,desc?) ObjectSchema; s.optional(inner) marks field optional + * s.record(valSchema,desc?) RecordSchema keyed by string + * s.enum(...values|values,desc) EnumSchema + * s.unknown() unconstrained JSON + * p`...` PromptBuilder template tag; interpolates PromptIntent|string|PromptBuilder + * p.bash(cmd,opts?) PromptIntent bash execution declaration (not run in-process) + * p.read(path,opts?) PromptIntent file read declaration + * p.write(path,content,opts?) PromptIntent file write declaration + * F:agent(spec) AgentFn; spec={name,description,input,output,prompt,addons,maxTurns} + * F:copilotEngine(opts?) AgentFactory wrapping CopilotClient+RuntimeConnection + * F:configureAgent(factory) sets global AgentFactory used by agent() calls at module scope + * F:launchRigProgram(path,opts?) runs .ts agent file as subprocess via tsx + * F:runLauncherCli(opts?) entry-point CLI: parses argv, wires copilotEngine, runs agent + * F:defineTool(name,config) Tool with handler+parameters schema + * F:analyzeResponse(resp,schema,name,turn) ResponseAnalysisResult parse+validate from XML tag + * F:defaultRepairPrompt(spec,err) string re-prompt on parse/validation failure + * F:toJsonSchema(schema) JsonSchemaObject converts Schema to plain JSON Schema + * addon:repair re-prompts on JSON/schema failure up to maxTurns (built-in via defaultRepairPrompt) + * INV:shape-descriptors JS values promote to schemas ("" → string, 0 → number, [""] → string[]) + * INV:optional-key trailing _ on spec key means optional field + * INV:prompt-intents p.* are declarative placeholders resolved into prompt text, never executed + * INV:repair-contract addon intercepts AgentError, appends error to prompt, retries up to maxTurns + * INV:output-tag model response parsed from ... XML tag in assistant message + * INV:schema-symbol Schema objects carry private SCHEMA_SYMBOL; toJSON serializes via serializeSchema + */ import { basename, dirname, isAbsolute, resolve } from "node:path"; import { fileURLToPath, pathToFileURL } from "node:url"; import { access, mkdir, mkdtemp, rm, writeFile } from "node:fs/promises"; From 0c053debca388fa546a9c63762ed6f3b1eebc40c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 07:16:36 +0000 Subject: [PATCH 2/2] Update rig.ts header: multi-agent purpose and agents? field in AgentSpec Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- skills/rig/rig.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skills/rig/rig.ts b/skills/rig/rig.ts index 895e524..e53764e 100644 --- a/skills/rig/rig.ts +++ b/skills/rig/rig.ts @@ -1,6 +1,6 @@ /** * @file skills/rig/rig.ts @last-analyzed 7476c6d @edit-time 2026-07-23T07:07:59Z - * @purpose Minimal TypeScript agent harness: typed input/output schemas, prompt intents, Copilot SDK runtime + * @purpose Minimal TypeScript multi-agent harness: typed input/output schemas, prompt intents, sub-agent delegation, Copilot SDK runtime * @deps @github/copilot-sdk (CopilotClient,RuntimeConnection,approveAll); node:path,url,fs/promises,child_process,util * T:Json type null|bool|num|str|Json[]|{[k]:Json} * T:Schema type StringSchema|NumberSchema|BooleanSchema|UnknownSchema|ArraySchema|ObjectSchema|RecordSchema|EnumSchema|OptionalSchema @@ -8,7 +8,7 @@ * T:AgentInputValue type input accepting raw values or PromptIntent/PromptBuilder at any nesting level * T:Simplify type flattens intersection types for display * T:ValidationResult type {ok:true}|{ok:false;error:string} - * T:AgentSpec type {name,description,input,output,prompt,addons?,maxTurns?} agent declaration + * T:AgentSpec type {name,description,input,output,prompt,addons?,maxTurns?,agents?} agent declaration; agents? enables sub-agent delegation * T:AgentFn type callable agent with .use(addons) and .spec property * T:AgentFactory type (options:AgentOptions)=>Agent|Promise * T:Agent interface {ask(input,opts?):Promise,close():Promise}