pi-fabric 0.92.29 → 0.92.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/agents.js +2 -2
- package/dist/chunks/{chunk-BYOGRJME.js → chunk-327VLBDU.js} +4 -4
- package/dist/chunks/chunk-327VLBDU.js.map +7 -0
- package/dist/chunks/{chunk-5IZFVA3H.js → chunk-623AGCNU.js} +2 -2
- package/dist/chunks/{chunk-KI277YNS.js → chunk-A4VP7HDF.js} +10 -2
- package/dist/chunks/chunk-A4VP7HDF.js.map +7 -0
- package/dist/chunks/{chunk-F5775UIO.js → chunk-KQHJQDJM.js} +3 -3
- package/dist/chunks/{chunk-7TX532EG.js → chunk-OEDHQWE2.js} +2 -2
- package/dist/chunks/{chunk-G7UJLM33.js → chunk-Q2DCENFM.js} +2 -2
- package/dist/components/configuration.js +3 -3
- package/dist/core/model-resolution.d.ts +3 -2
- package/dist/core/model-resolution.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +5 -5
- package/dist/index.js +2 -2
- package/dist/residency/host.js +4 -4
- package/dist/residency/pi-entry.js +4 -4
- package/dist/runtime/monty-runtime.js +2 -2
- package/dist/ui/settings.js +2 -2
- package/docs/agents.md +17 -2
- package/docs/foreman.md +65 -0
- package/docs/jev.md +2 -0
- package/docs/skills.md +2 -1
- package/package.json +1 -1
- package/skillsets/python/fabric-foreman/SKILL.md +249 -0
- package/skillsets/python/fabric-guide/SKILL.md +2 -1
- package/skillsets/typescript/fabric-exec/SKILL.md +2 -0
- package/skillsets/typescript/fabric-foreman/SKILL.md +240 -0
- package/skillsets/typescript/fabric-guide/SKILL.md +2 -1
- package/dist/chunks/chunk-BYOGRJME.js.map +0 -7
- package/dist/chunks/chunk-KI277YNS.js.map +0 -7
- /package/dist/chunks/{chunk-5IZFVA3H.js.map → chunk-623AGCNU.js.map} +0 -0
- /package/dist/chunks/{chunk-F5775UIO.js.map → chunk-KQHJQDJM.js.map} +0 -0
- /package/dist/chunks/{chunk-7TX532EG.js.map → chunk-OEDHQWE2.js.map} +0 -0
- /package/dist/chunks/{chunk-G7UJLM33.js.map → chunk-Q2DCENFM.js.map} +0 -0
package/README.md
CHANGED
|
@@ -109,6 +109,7 @@ Pi loads advanced patterns after direct user invocation. Run `/skill:fabric-guid
|
|
|
109
109
|
| Help choosing the smallest advanced mechanism | `/skill:fabric-guide Choose a mechanism to audit every auth file and verify the findings.` |
|
|
110
110
|
| Parallel audits, migrations, or research with verification | `/skill:fabric-workflow Audit every auth file and synthesize verified findings.` |
|
|
111
111
|
| Work too big for one context window | `/skill:fabric-rlm Produce a compact architecture map of this repo.` |
|
|
112
|
+
| A Jev foreman above coding work, per turn or at settlement | `/skill:fabric-foreman Watch this migration, request verification, and flag blockers.` |
|
|
112
113
|
| A persistent watcher for one measurable goal | `/skill:fabric-supervisor Watch this migration until it is complete and tested.` |
|
|
113
114
|
| A strict auditor for one feature design spec | `/skill:fabric-spec Implement docs/specs/checkout.md to the tee; nothing missing, nothing extra.` |
|
|
114
115
|
| A quiet decision-point reviewer | `/skill:fabric-advisor Focus on migration correctness.` |
|
package/dist/agents.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENTS_ACTION_DESCRIPTORS,
|
|
3
3
|
normalizeAgentRunRequest
|
|
4
|
-
} from "./chunks/chunk-
|
|
4
|
+
} from "./chunks/chunk-327VLBDU.js";
|
|
5
5
|
import {
|
|
6
6
|
validateAgentResult
|
|
7
7
|
} from "./chunks/chunk-3QECYQGA.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
waitForAgent
|
|
19
19
|
} from "./chunks/chunk-AYBIR4YV.js";
|
|
20
20
|
import "./chunks/chunk-OTCASLY2.js";
|
|
21
|
-
import "./chunks/chunk-
|
|
21
|
+
import "./chunks/chunk-A4VP7HDF.js";
|
|
22
22
|
import "./chunks/chunk-MGWQOKBV.js";
|
|
23
23
|
import "./chunks/chunk-3H7SDWZI.js";
|
|
24
24
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-OTCASLY2.js";
|
|
7
7
|
import {
|
|
8
8
|
aliasThinking
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-A4VP7HDF.js";
|
|
10
10
|
import {
|
|
11
11
|
isFabricThinking
|
|
12
12
|
} from "./chunk-MGWQOKBV.js";
|
|
@@ -36,7 +36,7 @@ var runProperties = {
|
|
|
36
36
|
},
|
|
37
37
|
model: {
|
|
38
38
|
type: "string",
|
|
39
|
-
description:
|
|
39
|
+
description: 'Pi provider/id copied from agents.models({ runner: "pi" }), a configured models.aliases name, or a search term resolved to the closest authenticated model (recency from pi-model-sort breaks ties). Reuse returned keys; never infer version numbers from agent names. Exact keys win; near-miss IDs resolve to the closest visible model on the same provider. Handles report the canonical model. Claude runtime value or Veda backend model/alias are forwarded verbatim.'
|
|
40
40
|
},
|
|
41
41
|
persona: {
|
|
42
42
|
type: "string",
|
|
@@ -167,7 +167,7 @@ var AGENTS_ACTION_DESCRIPTORS = [
|
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
name: "spawn",
|
|
170
|
-
description: "Start a child agent through Pi or Claude Code and return a handle immediately. Detached runs send Main a follow-up on terminal completion when agents.notifyOnComplete is enabled; use wait when this Fabric program needs the result and status only for progress inspection.",
|
|
170
|
+
description: "Start a child agent through Pi or Claude Code and return a handle immediately. For independent launches, await Promise.allSettled and inspect every result so one rejection does not abort pending sibling calls at program exit. Detached runs send Main a follow-up on terminal completion when agents.notifyOnComplete is enabled; use wait when this Fabric program needs the result and status only for progress inspection.",
|
|
171
171
|
inputSchema: spawnSchema,
|
|
172
172
|
risk: "agent"
|
|
173
173
|
},
|
|
@@ -744,4 +744,4 @@ export {
|
|
|
744
744
|
AGENTS_ACTION_DESCRIPTORS,
|
|
745
745
|
normalizeAgentRunRequest
|
|
746
746
|
};
|
|
747
|
-
//# sourceMappingURL=chunk-
|
|
747
|
+
//# sourceMappingURL=chunk-327VLBDU.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/providers/agents-actions.ts", "../../src/agents/request.ts"],
|
|
4
|
+
"sourcesContent": ["import { FABRIC_ACTOR_HOST_EVENTS } from \"../actors/types.js\";\nimport {\n MAX_COMPACTION_INSTRUCTIONS_CHARS,\n MAX_PRESERVE_ITEM_CHARS,\n MAX_PRESERVE_ITEMS,\n} from \"../compaction/instructions.js\";\nimport { FABRIC_LIFECYCLE_EVENTS } from \"../lifecycle/types.js\";\nimport type { FabricActionDescriptor } from \"../protocol.js\";\n\nconst runProperties = {\n task: { type: \"string\", description: \"A self-contained task for the child agent\" },\n name: { type: \"string\" },\n runner: {\n type: \"string\",\n enum: [\"pi\", \"claude\", \"veda\"],\n description: \"Execution harness. Defaults to agents.runner.\",\n },\n kernel: {\n type: \"string\",\n enum: [\"typescript\", \"python\", \"inherit\"],\n description: \"Fabric execution language. Omitted/inherit uses the caller executor.kernel; concrete choices require Pi with extensions enabled. Python uses the configured backend; CPython is native execution.\",\n },\n transport: {\n type: \"string\",\n enum: [\"auto\", \"process\", \"tmux\", \"screen\", \"localterm\", \"herdr\"],\n },\n model: {\n type: \"string\",\n description:\n \"Pi provider/id copied from agents.models({ runner: \\\"pi\\\" }), a configured models.aliases name, or a search term resolved to the closest authenticated model (recency from pi-model-sort breaks ties). Reuse returned keys; never infer version numbers from agent names. Exact keys win; near-miss IDs resolve to the closest visible model on the same provider. Handles report the canonical model. Claude runtime value or Veda backend model/alias are forwarded verbatim.\",\n },\n persona: {\n type: \"string\",\n description: \"Veda persona name for this run, such as frontend, reviewer, worker, or a custom persona.\",\n },\n thinking: {\n type: \"string\",\n enum: [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"],\n },\n tools: { type: \"array\", items: { type: \"string\" } },\n timeoutMs: {\n type: \"number\",\n description:\n \"Optional longer wall-clock limit in milliseconds. Omit to use agents.timeoutMs (60 minutes by default); values below the configured default are ignored.\",\n },\n extensions: { type: \"boolean\" },\n recursive: { type: \"boolean\" },\n cwd: {\n type: \"string\",\n description: \"Filesystem execution directory for leaf or recursive Pi runs; relative paths resolve from the caller cwd. Does not change project/mesh ownership or grant target project trust.\",\n },\n worktree: { type: \"boolean\" },\n schema: { type: \"object\", description: \"Optional JSON Schema for validated structured output\" },\n systemPrompt: {\n type: \"string\",\n description: \"Optional extra system prompt body for this child run. Pi runners merge it below component guidance and forward it via --system-prompt; Claude runners receive it via --append-system-prompt. Useful for reliability-focused prompt rules on models with weak behavioral defaults.\",\n },\n};\n\nconst runSchema = {\n type: \"object\",\n properties: runProperties,\n required: [\"task\"],\n additionalProperties: false,\n};\n\nconst residencySchema = {\n type: \"string\",\n enum: [\"session\", \"durable\"],\n description: \"session stops with the current Pi host; durable transfers execution to Fabric's hidden resident host.\",\n};\n\nconst actorBindingScopeSchema = {\n type: \"string\",\n enum: [\"session\", \"project\"],\n description: \"session (default) changes only this Pi session; project pins the shared actor default and requires ownership.\",\n};\n\nconst actorInvocationProperties = {\n id: { type: \"string\" },\n message: { type: \"string\" },\n data: {},\n model: {\n ...runProperties.model,\n description: \"Optional model pinned only for this actor activation.\",\n },\n thinking: runProperties.thinking,\n};\n\nconst spawnSchema = {\n ...runSchema,\n properties: { ...runProperties, residency: residencySchema },\n};\n\nconst handoffCompactionSchema = {\n anyOf: [\n { type: \"boolean\" },\n {\n type: \"object\",\n properties: {\n instructions: {\n type: \"string\",\n maxLength: MAX_COMPACTION_INSTRUCTIONS_CHARS,\n description: \"Custom compaction instructions for the inherited trajectory\",\n },\n preserve: {\n type: \"array\",\n items: { type: \"string\", maxLength: MAX_PRESERVE_ITEM_CHARS },\n maxItems: MAX_PRESERVE_ITEMS,\n description: \"Explicit bounded facts the trajectory summary must preserve\",\n },\n },\n additionalProperties: false,\n },\n ],\n description:\n \"Compact the inherited trajectory with Fabric's deterministic compactor before the executor resumes it. `true` applies the default summary; an object customizes instructions and bounded preserve facts. Omitted keeps the full raw trajectory.\",\n};\n\nconst handoffSchema = {\n type: \"object\",\n properties: {\n task: {\n type: \"string\",\n description: \"Optional instructions for the executor in addition to the inherited trajectory\",\n },\n name: runProperties.name,\n kernel: runProperties.kernel,\n transport: runProperties.transport,\n model: {\n ...runProperties.model,\n description: \"Explicit Pi provider/id target that will continue the inherited trajectory\",\n },\n thinking: runProperties.thinking,\n tools: runProperties.tools,\n timeoutMs: runProperties.timeoutMs,\n extensions: runProperties.extensions,\n recursive: runProperties.recursive,\n schema: runProperties.schema,\n compact: handoffCompactionSchema,\n },\n required: [\"model\"],\n additionalProperties: false,\n};\n\nconst idSchema = {\n type: \"object\",\n properties: { id: { type: \"string\" } },\n required: [\"id\"],\n additionalProperties: false,\n};\n\nconst lifecycleEventSchema = {\n type: \"string\",\n enum: [...FABRIC_LIFECYCLE_EVENTS],\n};\n\nexport const AGENTS_ACTION_DESCRIPTORS: FabricActionDescriptor[] = [\n {\n name: \"run\",\n description: \"Run a child agent through Pi or Claude Code and wait for its final result\",\n inputSchema: runSchema,\n risk: \"agent\",\n },\n {\n name: \"handoff\",\n description:\n \"Schedule a Pi trajectory handoff after the current outer fabric_exec result, then wait for implementation at that boundary\",\n inputSchema: handoffSchema,\n risk: \"agent\",\n },\n {\n name: \"spawn\",\n description:\n \"Start a child agent through Pi or Claude Code and return a handle immediately. For independent launches, await Promise.allSettled and inspect every result so one rejection does not abort pending sibling calls at program exit. Detached runs send Main a follow-up on terminal completion when agents.notifyOnComplete is enabled; use wait when this Fabric program needs the result and status only for progress inspection.\",\n inputSchema: spawnSchema,\n risk: \"agent\",\n },\n {\n name: \"wait\",\n description: \"Wait for a previously spawned child agent\",\n inputSchema: idSchema,\n risk: \"read\",\n },\n {\n name: \"join\",\n description: \"Alias for agents.wait: wait for a previously spawned child agent with the same progress and completion-notification behavior\",\n inputSchema: idSchema,\n risk: \"read\",\n },\n {\n name: \"status\",\n description: \"Get the latest status of any known project participant\",\n inputSchema: idSchema,\n risk: \"read\",\n },\n {\n name: \"list\",\n description: \"List agent participants locally, across the current lineage, or across the project\",\n inputSchema: {\n type: \"object\",\n properties: { scope: { type: \"string\", enum: [\"local\", \"lineage\", \"project\"] } },\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"members\",\n description: \"List the unified project topology of roots, agents, and actors\",\n inputSchema: {\n type: \"object\",\n properties: {\n scope: { type: \"string\", enum: [\"local\", \"lineage\", \"project\"] },\n kinds: {\n type: \"array\",\n items: { type: \"string\", enum: [\"root\", \"agent\", \"actor\"] },\n },\n includeStale: { type: \"boolean\" },\n },\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"self\",\n description: \"Return this caller's intrinsic participant identity in the unified topology\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n risk: \"read\",\n },\n {\n name: \"main\",\n description:\n \"Return the root user-facing Main Pi agent target. The stable alias main is also accepted by agents.steer and agents.followUp.\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n risk: \"read\",\n },\n {\n name: \"sessions\",\n description: \"List all live root Pi session agents in the project, including the current lineage root and peers, with symmetric participant identities.\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n risk: \"read\",\n },\n {\n name: \"peers\",\n description: \"List other live root Pi sessions sharing this project mesh. The dashboard-owning session remains Main; these targets are named peers.\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n risk: \"read\",\n },\n {\n name: \"subscribe\",\n description:\n \"Create a durable source-qualified participant lifecycle subscription. Events are delivered to Main by default or to another participant through steer/follow-up routing.\",\n inputSchema: {\n type: \"object\",\n properties: {\n from: { type: \"string\", description: \"Exact source participant id; main means this lineage root\" },\n events: { type: \"array\", minItems: 1, items: lifecycleEventSchema },\n to: { type: \"string\", description: \"Target participant id; defaults to main\" },\n delivery: { type: \"string\", enum: [\"steer\", \"followUp\"] },\n triggerTurn: { type: \"boolean\" },\n once: { type: \"boolean\" },\n },\n required: [\"from\", \"events\", \"delivery\", \"triggerTurn\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"subscriptions\",\n description: \"List durable participant lifecycle subscriptions, optionally filtered by source or target\",\n inputSchema: {\n type: \"object\",\n properties: { from: { type: \"string\" }, to: { type: \"string\" } },\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"unsubscribe\",\n description: \"Remove a participant lifecycle subscription\",\n inputSchema: idSchema,\n risk: \"agent\",\n },\n {\n name: \"models\",\n description:\n \"List models exposed by the selected runner. Claude models are enumerated from the installed Claude Code runtime, not hard-coded.\",\n inputSchema: {\n type: \"object\",\n properties: {\n runner: { type: \"string\", enum: [\"pi\", \"claude\", \"veda\"] },\n refresh: { type: \"boolean\" },\n },\n additionalProperties: false,\n },\n risk: \"execute\",\n },\n {\n name: \"switchModel\",\n description:\n \"Switch Main's live Pi session model in place. The model selector accepts an exact provider/id, a configured models.aliases name (alias chains try each target in order until one is authenticated), an exact model id, or a search term; inexact terms resolve to the closest match, preferring recently used models (via pi-model-sort usage, when present).\",\n inputSchema: {\n type: \"object\",\n properties: {\n model: {\n type: \"string\",\n description: \"provider/id, alias name, or search term\",\n },\n provider: { type: \"string\" },\n },\n required: [\"model\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"stop\",\n description: \"Stop a local or remotely owned agent or actor that advertises the stop capability\",\n inputSchema: idSchema,\n risk: \"agent\",\n },\n {\n name: \"cleanup\",\n description: \"Remove a completed agent's run files and optional Git worktree\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n deleteBranch: { type: \"boolean\" },\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"write\",\n },\n {\n name: \"create\",\n description:\n 'Create a persistent actor with independently selected session or project storage. Use scope \"global\" to save a reusable project-independent template instead of a live actor.',\n inputSchema: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n instructions: { type: \"string\" },\n events: {\n type: \"array\",\n items: {\n type: \"string\",\n enum: [...FABRIC_ACTOR_HOST_EVENTS],\n },\n },\n topics: { type: \"array\", items: { type: \"string\" } },\n delivery: {\n type: \"string\",\n enum: [\"mailbox\", \"steer\", \"followUp\", \"nextTurn\"],\n },\n responseMode: { type: \"string\", enum: [\"text\", \"directive\"] },\n triggerTurn: { type: \"boolean\" },\n coalesce: { type: \"boolean\" },\n residency: residencySchema,\n runner: runProperties.runner,\n kernel: runProperties.kernel,\n model: runProperties.model,\n thinking: runProperties.thinking,\n tools: runProperties.tools,\n transport: runProperties.transport,\n timeoutMs: runProperties.timeoutMs,\n extensions: runProperties.extensions,\n requires: {\n type: \"array\",\n maxItems: 128,\n description: \"Exact Fabric provider.action refs committed before every actor run. Object entries may be optional.\",\n items: {\n oneOf: [\n { type: \"string\", minLength: 3, maxLength: 256 },\n {\n type: \"object\",\n properties: {\n ref: { type: \"string\", minLength: 3, maxLength: 256 },\n optional: { type: \"boolean\" },\n },\n required: [\"ref\"],\n additionalProperties: false,\n },\n ],\n },\n },\n validWhile: {\n type: \"object\",\n properties: { version: { const: 1 }, source: { type: \"string\" } },\n required: [\"version\", \"source\"],\n additionalProperties: false,\n },\n scope: {\n type: \"string\",\n enum: [\"session\", \"project\", \"global\"],\n description: \"session isolates the actor to the root Pi session; project shares it across sessions; global creates a non-live template.\",\n },\n },\n required: [\"name\", \"instructions\"],\n oneOf: [\n {\n properties: {\n delivery: { const: \"mailbox\" },\n triggerTurn: { const: false },\n },\n },\n {\n properties: {\n delivery: { const: \"nextTurn\" },\n triggerTurn: { const: false },\n },\n required: [\"delivery\"],\n },\n {\n properties: { delivery: { enum: [\"steer\", \"followUp\"] } },\n required: [\"delivery\", \"triggerTurn\"],\n },\n ],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"ask\",\n description: \"Send a message to a persistent actor through its live owner and wait for its next response. Optional model/thinking values apply only to this activation.\",\n inputSchema: {\n type: \"object\",\n properties: actorInvocationProperties,\n required: [\"id\", \"message\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"tell\",\n description: \"Queue a message through a persistent actor's live owner without waiting. Optional model/thinking values apply only to this activation.\",\n inputSchema: {\n type: \"object\",\n properties: actorInvocationProperties,\n required: [\"id\", \"message\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"steer\",\n description:\n \"Steer Main, a running one-shot agent between turns, or a persistent actor through its mailbox. The stable id alias main targets the root user-facing Pi session. Non-local targets route over the project mesh.\",\n inputSchema: {\n type: \"object\",\n properties: { id: { type: \"string\" }, message: { type: \"string\" }, data: {} },\n required: [\"id\", \"message\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"followUp\",\n description:\n \"Queue a follow-up for Main or a running one-shot agent, or enqueue a persistent actor mailbox message. The stable id alias main targets the root user-facing Pi session. Non-local targets route over the project mesh.\",\n inputSchema: {\n type: \"object\",\n properties: { id: { type: \"string\" }, message: { type: \"string\" }, data: {} },\n required: [\"id\", \"message\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setSteeringMode\",\n description:\n \"Set how queued steer messages are delivered to a running one-shot agent: all at once after the current turn, or one per turn (default). Local agent only.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n mode: { type: \"string\", enum: [\"all\", \"one-at-a-time\"] },\n },\n required: [\"id\", \"mode\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setFollowUpMode\",\n description:\n \"Set how queued follow-up messages are delivered to a one-shot agent: all when it finishes, or one per completion (default). Local agent only.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n mode: { type: \"string\", enum: [\"all\", \"one-at-a-time\"] },\n },\n required: [\"id\", \"mode\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"compact\",\n description:\n \"Request an advisory compaction of a running Pi-runner child agent's context at its next safe boundary (between its own turns), preserving the child's accumulated context. Rejected for Claude-runner children. The child pi core applies the compaction; Fabric only forwards the intent.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n instructions: {\n type: \"string\",\n description: \"Optional custom compaction instructions forwarded to the child pi\",\n },\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"actorStatus\",\n description: \"Read one persistent actor's status\",\n inputSchema: idSchema,\n risk: \"read\",\n },\n {\n name: \"actors\",\n description:\n 'List persistent actors. Default scope \"project\" lists live actors in this Fabric session; scope \"global\" lists project-independent templates in the global registry.',\n inputSchema: {\n type: \"object\",\n properties: { scope: { type: \"string\", enum: [\"project\", \"global\"] } },\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"messages\",\n description: \"Read a persistent actor's bounded inbox and outbox history\",\n inputSchema: {\n type: \"object\",\n properties: { id: { type: \"string\" }, limit: { type: \"number\", minimum: 1 } },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"read\",\n },\n {\n name: \"setModel\",\n description:\n \"Change or clear a persistent actor model binding. Session scope is the default; project scope explicitly pins the shared definition default.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n model: { type: \"string\" },\n scope: actorBindingScopeSchema,\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setThinking\",\n description:\n \"Change or clear a persistent actor reasoning-effort binding. Session scope is the default; project scope explicitly pins the shared definition default.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n thinking: runProperties.thinking,\n scope: actorBindingScopeSchema,\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setTools\",\n description:\n \"Replace a persistent actor's tool allowlist. Takes effect on its next queued message; an empty list disables optional tools.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n tools: runProperties.tools,\n scope: { type: \"string\", enum: [\"project\", \"global\"] },\n },\n required: [\"id\", \"tools\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setEvents\",\n description: \"Replace a persistent actor's session-bound Pi and synthetic tool_error event subscriptions\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n events: {\n type: \"array\",\n items: {\n type: \"string\",\n enum: [...FABRIC_ACTOR_HOST_EVENTS],\n },\n },\n },\n required: [\"id\", \"events\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setDeliveryPolicy\",\n description:\n \"Replace a project actor or global template delivery policy. steer/followUp require an explicit triggerTurn choice; mailbox/nextTurn require false.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n delivery: {\n type: \"string\",\n enum: [\"mailbox\", \"steer\", \"followUp\", \"nextTurn\"],\n },\n triggerTurn: { type: \"boolean\" },\n scope: { type: \"string\", enum: [\"project\", \"global\"] },\n },\n required: [\"id\", \"delivery\", \"triggerTurn\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"clearMessages\",\n description: \"Clear a persistent actor's recorded message history\",\n inputSchema: idSchema,\n risk: \"write\",\n },\n {\n name: \"remove\",\n description:\n 'Stop and remove a persistent actor. Default scope \"project\" removes a live project actor; scope \"global\" removes a project-independent template from the global registry.',\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n scope: { type: \"string\", enum: [\"project\", \"global\"] },\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"setInstructions\",\n description:\n 'Replace an actor\\'s default instruction (its persona / system-prompt body). Default scope \"project\" edits a live project actor; scope \"global\" edits a project-independent template. Takes effect on the actor\\'s next queued message.',\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n instructions: { type: \"string\" },\n scope: { type: \"string\", enum: [\"project\", \"global\"] },\n },\n required: [\"id\", \"instructions\"],\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"import\",\n description:\n \"Import a project-independent template from the global registry into the current project as a fresh live actor with no inherited history (no messages, session, or run logs). Identify the template by id or name; optionally rename the imported actor with \\\"as\\\" to avoid colliding with a live actor.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Template id or name (one of id/name required)\" },\n name: { type: \"string\", description: \"Template name (one of id/name required)\" },\n as: { type: \"string\", description: \"Optional new name for the imported live actor\" },\n },\n additionalProperties: false,\n },\n risk: \"agent\",\n },\n {\n name: \"export\",\n description:\n \"Export a live project actor's definition to the global registry as a project-independent template, without any history (no messages, session, or run logs). Throws on a name collision unless overwrite is true.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\" },\n overwrite: { type: \"boolean\" },\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"write\",\n },\n {\n name: \"log\",\n description:\n \"Read an actor or agent run's LLM/agent log: the actor's session transcript (session.jsonl) and/or a retained run's event stream (events.jsonl: tool calls, model responses, usage). Actors retain their last runs so logs survive after success.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Actor ID/name or agent run ID\" },\n type: {\n type: \"string\",\n enum: [\"session\", \"run\", \"all\"],\n description:\n \"session = actor session transcript (default for actors); run = last retained run's events; all = both\",\n },\n lines: { type: \"number\", minimum: 1, description: \"Page line limit (default 200)\" },\n before: {\n type: \"number\",\n minimum: 0,\n description: \"Exclusive line cursor returned by a previous page to load older entries\",\n },\n runId: { type: \"string\", description: \"Specific retained run (default: actor's last run)\" },\n },\n required: [\"id\"],\n additionalProperties: false,\n },\n risk: \"read\",\n },\n];\n", "import type { AgentRunRequest } from \"./types.js\";\nimport { isFabricThinking } from \"../thinking.js\";\nimport { aliasThinking, type FabricModelAliases } from \"../core/model-resolution.js\";\n\nconst stringArray = (value: unknown): string[] | undefined => Array.isArray(value) ? value.filter((entry): entry is string => typeof entry === \"string\") : undefined;\nconst checkedKernel = (value: unknown): AgentRunRequest[\"kernel\"] => {\n if (value === undefined || value === \"inherit\" || value === \"typescript\" || value === \"python\") return value;\n throw new Error(`Invalid Fabric agent kernel: ${String(value)}`);\n};\n\nexport const normalizeAgentRunRequest = (\n args: Record<string, unknown>,\n defaults: {runner: NonNullable<AgentRunRequest[\"runner\"]>; model?: string; timeoutMs: number; inheritedModel?: {provider: string; id: string}; models?: {aliases?: FabricModelAliases}},\n options: {allowCwd?: boolean} = {},\n): AgentRunRequest => {\n const transport =\n args.transport === \"auto\" ||\n args.transport === \"process\" ||\n args.transport === \"tmux\" ||\n args.transport === \"screen\" ||\n args.transport === \"localterm\" ||\n args.transport === \"herdr\"\n ? args.transport\n : undefined;\n // An explicit call or actor level always wins; otherwise an alias can carry\n // the intended effort for the model it selects (e.g. a \"cheap\" alias that is\n // both cheaper and shallower), and the global agents.thinking default applies\n // last, inside the manager.\n const requestedModel =\n typeof args.model === \"string\"\n ? args.model\n : typeof defaults.model === \"string\"\n ? defaults.model\n : undefined;\n const thinking = isFabricThinking(args.thinking)\n ? args.thinking\n : aliasThinking(defaults.models?.aliases, requestedModel ?? \"\");\n const tools = stringArray(args.tools);\n const timeoutMs = typeof args.timeoutMs === \"number\" && Number.isFinite(args.timeoutMs) && args.timeoutMs > defaults.timeoutMs ? args.timeoutMs : undefined;\n const runner =\n args.runner === \"pi\" || args.runner === \"claude\" || args.runner === \"veda\"\n ? args.runner\n : defaults.runner;\n const inheritedModel =\n runner === \"pi\" && !defaults.model && defaults.inheritedModel\n ? `${defaults.inheritedModel.provider}/${defaults.inheritedModel.id}`\n : undefined;\n const kernel = checkedKernel(args.kernel);\n if (args.recursive === true && args.extensions === false) {\n throw new Error(\"Recursive Fabric requires extensions enabled; omit recursive or extensions: false\");\n }\n return {\n task: String(args.task),\n runner,\n ...(kernel !== undefined ? { kernel } : {}),\n ...(typeof args.name === \"string\" ? { name: args.name } : {}),\n ...(transport ? { transport } : {}),\n ...(typeof args.model === \"string\"\n ? { model: args.model }\n : inheritedModel\n ? { model: inheritedModel }\n : {}),\n ...(typeof args.persona === \"string\" && args.persona.trim()\n ? { persona: args.persona.trim() }\n : {}),\n ...(thinking ? { thinking } : {}),\n ...(tools ? { tools } : {}),\n ...(timeoutMs !== undefined ? { timeoutMs } : {}),\n ...(typeof args.extensions === \"boolean\"\n ? { extensions: args.extensions }\n : args.recursive === true ? { extensions: true } : {}),\n ...(typeof args.recursive === \"boolean\" ? { recursive: args.recursive } : {}),\n ...(options.allowCwd !== false && typeof args.cwd === \"string\" ? { cwd: args.cwd } : {}),\n ...(typeof args.worktree === \"boolean\" ? { worktree: args.worktree } : {}),\n ...(args.residency === \"session\" || args.residency === \"durable\"\n ? { residency: args.residency }\n : {}),\n ...(typeof args.schema === \"object\" && args.schema !== null && !Array.isArray(args.schema)\n ? { schema: args.schema as Record<string, unknown> }\n : {}),\n ...(typeof args.systemPrompt === \"string\" && args.systemPrompt.trim()\n ? { systemPrompt: args.systemPrompt }\n : {}),\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AASA,IAAM,gBAAgB;AAAA,EACpB,MAAM,EAAE,MAAM,UAAU,aAAa,4CAA4C;AAAA,EACjF,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,MAAM,CAAC,MAAM,UAAU,MAAM;AAAA,IAC7B,aAAa;AAAA,EACf;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,MAAM,CAAC,cAAc,UAAU,SAAS;AAAA,IACxC,aAAa;AAAA,EACf;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,MAAM,CAAC,QAAQ,WAAW,QAAQ,UAAU,aAAa,OAAO;AAAA,EAClE;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,aACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA,IACN,MAAM,CAAC,OAAO,WAAW,OAAO,UAAU,QAAQ,SAAS,KAAK;AAAA,EAClE;AAAA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ACL,GAAI,OAAO,KAAK,iBAAiB,YAAY,KAAK,aAAa,KAAK,IAChE,EAAE,cAAc,KAAK,aAAa,IAClC,CAAC;AAAA,EACP;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
MAX_AGENT_TIMEOUT_MS,
|
|
31
31
|
MIN_AGENT_TIMEOUT_MS,
|
|
32
32
|
quarantineDamagedFile
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-Q2DCENFM.js";
|
|
34
34
|
import {
|
|
35
35
|
ownedStat,
|
|
36
36
|
processAlive
|
|
@@ -6962,4 +6962,4 @@ export {
|
|
|
6962
6962
|
agentParticipantRecords,
|
|
6963
6963
|
actorParticipantRecord
|
|
6964
6964
|
};
|
|
6965
|
-
//# sourceMappingURL=chunk-
|
|
6965
|
+
//# sourceMappingURL=chunk-623AGCNU.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-MGWQOKBV.js";
|
|
4
4
|
|
|
5
5
|
// src/core/model-resolution.ts
|
|
6
|
-
var PROVIDER_MODEL_RE = /^[^\s/]+\/[^\s
|
|
6
|
+
var PROVIDER_MODEL_RE = /^[^\s/]+\/[^\s]+$/;
|
|
7
7
|
var FUZZY_RESOLUTION_MARKERS = ["closest", "recent", "latest"];
|
|
8
8
|
var modelKey = (model) => `${model.provider}/${model.id}`;
|
|
9
9
|
var sameModel = (left, right) => right !== void 0 && left.provider.toLowerCase() === right.provider.toLowerCase() && left.id.toLowerCase() === right.id.toLowerCase();
|
|
@@ -199,6 +199,14 @@ var resolveAvailablePiModel = (selector, options) => {
|
|
|
199
199
|
(model) => modelKey(model).toLowerCase() === query.toLowerCase()
|
|
200
200
|
);
|
|
201
201
|
if (exact) return exact;
|
|
202
|
+
const separator = query.indexOf("/");
|
|
203
|
+
const provider = query.slice(0, separator).toLowerCase();
|
|
204
|
+
const closest = pickClosestCandidate(
|
|
205
|
+
query.slice(separator + 1).toLowerCase(),
|
|
206
|
+
options.available.filter((model) => model.provider.toLowerCase() === provider),
|
|
207
|
+
options.lastUsed
|
|
208
|
+
)?.model;
|
|
209
|
+
if (closest) return closest;
|
|
202
210
|
throw unavailablePiModelError(query);
|
|
203
211
|
}
|
|
204
212
|
const resolution = resolveFabricModel(query, options);
|
|
@@ -215,4 +223,4 @@ export {
|
|
|
215
223
|
resolveFabricModel,
|
|
216
224
|
resolveAvailablePiModel
|
|
217
225
|
};
|
|
218
|
-
//# sourceMappingURL=chunk-
|
|
226
|
+
//# sourceMappingURL=chunk-A4VP7HDF.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/core/model-resolution.ts"],
|
|
4
|
+
"sourcesContent": ["import { isFabricThinking, type FabricThinking } from \"../thinking.js\";\n\nconst PROVIDER_MODEL_RE = /^[^\\s/]+\\/[^\\s]+$/;\n\n/** Minimal model view needed for resolution; satisfied by pi Model entries. */\nexport interface FabricModelCandidate {\n provider: string;\n id: string;\n name?: string;\n}\n\nexport type FabricModelResolution =\n | { kind: \"resolved\"; model: FabricModelCandidate; via?: string }\n | { kind: \"already-active\"; model: FabricModelCandidate }\n | { kind: \"ambiguous\"; query: string; candidates: FabricModelCandidate[] }\n | { kind: \"not-found\"; query: string; tried?: string[] };\n\n/**\n * One configured alias: an ordered fallback chain plus an optional default\n * thinking level. The thinking level is a Fabric default for runs that select\n * the alias, below an explicit call/actor value and above the global\n * `agents.thinking` default.\n */\nexport interface FabricModelAlias {\n targets: string[];\n thinking?: FabricThinking;\n}\n\nexport type FabricModelAliases = Record<string, FabricModelAlias>;\n\n/** Markers reported in `via` when an inexact selector is fuzzy-resolved. */\nexport const FUZZY_RESOLUTION_MARKERS = [\"closest\", \"recent\", \"latest\"] as const;\n\nconst modelKey = (model: FabricModelCandidate): string => `${model.provider}/${model.id}`;\n\nconst sameModel = (\n left: FabricModelCandidate,\n right: FabricModelCandidate | undefined,\n): boolean =>\n right !== undefined &&\n left.provider.toLowerCase() === right.provider.toLowerCase() &&\n left.id.toLowerCase() === right.id.toLowerCase();\n\n/**\n * Normalize raw `models.aliases` config into alias name \u2192 ordered targets.\n * String targets degrade to one-element fallback chains. Entries whose name,\n * target list, or any `provider/model` target string is malformed are\n * dropped entirely, matching the lenient fallback style of the other config\n * normalizers (no partial alias survives with a silently missing target).\n */\nexport const normalizeModelAliases = (input: unknown): FabricModelAliases => {\n if (typeof input !== \"object\" || input === null || Array.isArray(input)) return {};\n const aliases: FabricModelAliases = {};\n for (const [rawName, rawValue] of Object.entries(input as Record<string, unknown>)) {\n const name = rawName.trim();\n if (!name) continue;\n // Object entries carry {model, thinking?}; re-normalizing them keeps a\n // config round trip through persisted state or a resident owner idempotent.\n const entry =\n typeof rawValue === \"object\" && rawValue !== null && !Array.isArray(rawValue)\n ? (rawValue as { model?: unknown; targets?: unknown; thinking?: unknown })\n : undefined;\n const rawTargets = entry ? entry.model ?? entry.targets : rawValue;\n const values = typeof rawTargets === \"string\" ? [rawTargets] : rawTargets;\n if (!Array.isArray(values) || values.length === 0) continue;\n const targets: string[] = [];\n let valid = true;\n for (const candidate of values) {\n if (typeof candidate !== \"string\") {\n valid = false;\n break;\n }\n const target = candidate.trim();\n if (!PROVIDER_MODEL_RE.test(target)) {\n valid = false;\n break;\n }\n if (!targets.includes(target)) targets.push(target);\n }\n if (valid && targets.length > 0) {\n aliases[name] = {\n targets,\n ...(entry && isFabricThinking(entry.thinking) ? { thinking: entry.thinking } : {}),\n };\n }\n }\n return aliases;\n};\n\n/**\n * Default thinking level configured for a selector that names an alias, or\n * undefined when the selector is not an alias or carries no level.\n */\nexport const aliasThinking = (\n aliases: FabricModelAliases | undefined,\n selector: string,\n): FabricThinking | undefined => {\n if (!aliases) return undefined;\n const query = selector.trim().toLowerCase();\n if (!query) return undefined;\n const key = Object.keys(aliases).find((name) => name.toLowerCase() === query);\n return key === undefined ? undefined : aliases[key]?.thinking;\n};\n\nconst FUZZY_MIN_QUERY_LENGTH = 4;\nconst FUZZY_LEVENSHTEIN_MIN_RATIO = 0.55;\n\n/**\n * Span covered when every character of `needle` appears in `haystack` in\n * order (first to last matched index), or Infinity when it does not. A tight\n * span keeps abbreviated selectors honest: \"gmni\" spans 6 chars in\n * \"gemini-2.5-pro\" but 10 in \"gpt-5-mini\", so only the former reads as the\n * same token with letters dropped.\n */\nconst subsequenceSpan = (needle: string, haystack: string): number => {\n let index = 0;\n let first = -1;\n let last = -1;\n for (let i = 0; i < haystack.length && index < needle.length; i += 1) {\n if (haystack[i] === needle[index]) {\n if (first === -1) first = i;\n last = i;\n index += 1;\n }\n }\n return index === needle.length ? last - first + 1 : Number.POSITIVE_INFINITY;\n};\n\n/** Normalized Levenshtein similarity in [0, 1]; 1 means identical. */\nconst levenshteinRatio = (left: string, right: string): number => {\n if (left === right) return 1;\n if (left.length === 0 || right.length === 0) return 0;\n let previous = Array.from({ length: right.length + 1 }, (_, column) => column);\n for (let i = 0; i < left.length; i += 1) {\n const current: number[] = [i + 1];\n for (let j = 0; j < right.length; j += 1) {\n current.push(Math.min(\n previous[j]! + 1,\n current[j]! + 1,\n previous[j]! + (left[i] === right[j] ? 0 : 1),\n ));\n }\n previous = current;\n }\n return 1 - previous[right.length]! / Math.max(left.length, right.length);\n};\n\n/**\n * Closeness score for an inexact selector against one candidate. Tiered so a\n * substring hit always outranks a subsequence hit, which always outranks a\n * typo-level Levenshtein resemblance; coverage bonuses reward selectors that\n * span most of the target id name. Zero means no resemblance at all.\n */\nconst closenessScore = (query: string, model: FabricModelCandidate): number => {\n const id = model.id.toLowerCase();\n const name = model.name?.toLowerCase();\n if (id.startsWith(query)) return 60 + (query.length / id.length) * 20;\n if (id.includes(query)) return 50 + (query.length / id.length) * 15;\n if (name?.startsWith(query) === true) return 45 + (query.length / name.length) * 15;\n if (name?.includes(query) === true) return 40 + (query.length / name.length) * 10;\n if (model.provider.toLowerCase().includes(query)) return 25;\n if (\n query.length >= 3 &&\n query[0] === id[0] &&\n subsequenceSpan(query, id) <= query.length + 2\n ) {\n return 18 + (query.length / id.length) * 6;\n }\n if (query.length >= FUZZY_MIN_QUERY_LENGTH) {\n const idRatio = levenshteinRatio(query, id);\n if (idRatio >= FUZZY_LEVENSHTEIN_MIN_RATIO) return 8 + idRatio * 10;\n if (name !== undefined) {\n const nameRatio = levenshteinRatio(query, name);\n if (nameRatio >= FUZZY_LEVENSHTEIN_MIN_RATIO) return 6 + nameRatio * 8;\n }\n }\n return 0;\n};\n\nexport type FabricModelUsage = Record<string, number>;\n\n/**\n * Pick the closest candidate for an inexact selector. Ranking is closeness\n * first; equal-closeness ties fall to the most recently used model (recency\n * timestamps such as pi-model-sort's extensions/pi-model-sort.json under the\n * agent dir, keyed by provider/id), then to the highest-sorting key, mirroring\n * pi's convention that the newest alias/versioned id sorts last.\n */\nconst pickClosestCandidate = (\n query: string,\n pool: readonly FabricModelCandidate[],\n lastUsed: FabricModelUsage | undefined,\n): { model: FabricModelCandidate; via: \"closest\" | \"recent\" | \"latest\" } | undefined => {\n const usage: FabricModelUsage = {};\n for (const [key, value] of Object.entries(lastUsed ?? {})) {\n usage[key.toLowerCase()] = value;\n }\n const recency = (model: FabricModelCandidate): number =>\n usage[`${model.provider}/${model.id}`.toLowerCase()] ?? 0;\n let best: FabricModelCandidate | undefined;\n let bestScore = 0;\n let tied = false;\n for (const model of pool) {\n const score = closenessScore(query, model);\n if (score <= 0) continue;\n if (best === undefined || score > bestScore) {\n best = model;\n bestScore = score;\n tied = false;\n continue;\n }\n if (score === bestScore) {\n tied = true;\n const bestRecent = recency(best);\n const nextRecent = recency(model);\n if (nextRecent > bestRecent || (nextRecent === bestRecent && modelKey(model) > modelKey(best))) {\n best = model;\n }\n }\n }\n if (best === undefined) return undefined;\n const runnersUp = pool.filter(\n (model) => model !== best && closenessScore(query, model) === bestScore,\n );\n const wonOnRecency = tied\n && runnersUp.some((model) => recency(model) !== recency(best));\n return {\n model: best,\n via: !tied ? \"closest\" : wonOnRecency ? \"recent\" : \"latest\",\n };\n};\n\n/**\n * Resolve a model selector against aliases and the available (authenticated)\n * registry. Order: alias lookup first so a configured name always wins, then\n * exact provider/id, exact id, then fuzzy selection. A lone partial match is\n * returned directly; broader candidate pools are ranked by closeness, with\n * equal-closeness ties falling to the most recently used model (when usage\n * timestamps are supplied, e.g. from pi-model-sort) and then to the\n * highest-sorting key, mirroring pi's newest-alias convention. Only a pool\n * with no resemblance at all stays not-found; `ambiguous` is retained for\n * defensive completeness but the ranker always produces a deterministic pick.\n */\nexport const resolveFabricModel = (\n query: string,\n options: {\n aliases: FabricModelAliases;\n available: readonly FabricModelCandidate[];\n current?: FabricModelCandidate;\n provider?: string;\n lastUsed?: FabricModelUsage;\n },\n): FabricModelResolution => {\n const normalized = query.trim().toLowerCase();\n if (!normalized) return { kind: \"not-found\", query };\n const providerFilter = options.provider?.trim().toLowerCase();\n const available = providerFilter\n ? options.available.filter((model) => model.provider.toLowerCase() === providerFilter)\n : [...options.available];\n if (available.length === 0) return { kind: \"not-found\", query };\n\n const aliasKey = Object.keys(options.aliases).find(\n (key) => key.toLowerCase() === normalized,\n );\n const tried: string[] = [];\n if (aliasKey !== undefined) {\n const chain = options.aliases[aliasKey]?.targets ?? [];\n for (const target of chain) {\n tried.push(target);\n const separator = target.indexOf(\"/\");\n const provider = target.slice(0, separator);\n const id = target.slice(separator + 1);\n const match = available.find(\n (model) =>\n model.provider.toLowerCase() === provider.toLowerCase() &&\n model.id.toLowerCase() === id.toLowerCase(),\n );\n if (match) {\n return sameModel(match, options.current)\n ? { kind: \"already-active\", model: match }\n : { kind: \"resolved\", model: match, via: aliasKey };\n }\n }\n return { kind: \"not-found\", query, tried };\n }\n\n const exact = available.find((model) => modelKey(model).toLowerCase() === normalized)\n ?? available.find((model) => model.id.toLowerCase() === normalized);\n if (exact) {\n return sameModel(exact, options.current)\n ? { kind: \"already-active\", model: exact }\n : { kind: \"resolved\", model: exact };\n }\n\n const candidates = available.filter(\n (model) =>\n model.id.toLowerCase().includes(normalized) ||\n (model.name !== undefined && model.name.toLowerCase().includes(normalized)) ||\n model.provider.toLowerCase().includes(normalized),\n );\n if (candidates.length === 1) {\n const match = candidates[0];\n if (match === undefined) return { kind: \"not-found\", query };\n return sameModel(match, options.current)\n ? { kind: \"already-active\", model: match }\n : { kind: \"resolved\", model: match };\n }\n const pool = candidates.length > 1 ? candidates : available;\n const picked = pickClosestCandidate(normalized, pool, options.lastUsed);\n if (picked) {\n return sameModel(picked.model, options.current)\n ? { kind: \"already-active\", model: picked.model }\n : { kind: \"resolved\", model: picked.model, via: picked.via };\n }\n if (candidates.length > 1) return { kind: \"ambiguous\", query, candidates };\n return { kind: \"not-found\", query };\n};\n\nconst unavailablePiModelError = (\n query: string,\n resolution?: Extract<FabricModelResolution, { kind: \"ambiguous\" | \"not-found\" }>,\n): Error => {\n const detail = resolution?.kind === \"not-found\" && resolution.tried !== undefined\n ? ` Alias targets tried: ${resolution.tried.join(\", \")}.`\n : resolution?.kind === \"ambiguous\"\n ? ` Visible matches: ${resolution.candidates.map(modelKey).join(\", \")}.`\n : \"\";\n return new Error(\n `Model ${JSON.stringify(query)} is not available to this Pi session.${detail} ` +\n 'Use agents.models({ runner: \"pi\" }) to list the models visible to this session.',\n );\n};\n\n/**\n * Resolve a Pi participant selector strictly within the execution owner's\n * visible registry. Provider-qualified selectors prefer exact IDs, then the\n * closest visible ID/name on that same provider. Aliases retain their ordered\n * exact-target policy; bare selectors retain normal Fabric fuzzy resolution.\n */\nexport const resolveAvailablePiModel = (\n selector: string,\n options: {\n aliases: FabricModelAliases;\n available: readonly FabricModelCandidate[];\n lastUsed?: FabricModelUsage;\n },\n): FabricModelCandidate => {\n const query = selector.trim();\n const alias = Object.keys(options.aliases).some(\n (name) => name.toLowerCase() === query.toLowerCase(),\n );\n if (PROVIDER_MODEL_RE.test(query) && !alias) {\n const exact = options.available.find(\n (model) => modelKey(model).toLowerCase() === query.toLowerCase(),\n );\n if (exact) return exact;\n // Recover near-miss IDs without crossing provider/auth boundaries.\n const separator = query.indexOf(\"/\");\n const provider = query.slice(0, separator).toLowerCase();\n const closest = pickClosestCandidate(\n query.slice(separator + 1).toLowerCase(),\n options.available.filter((model) => model.provider.toLowerCase() === provider),\n options.lastUsed,\n )?.model;\n if (closest) return closest;\n throw unavailablePiModelError(query);\n }\n\n const resolution = resolveFabricModel(query, options);\n if (resolution.kind === \"resolved\" || resolution.kind === \"already-active\") {\n return resolution.model;\n }\n throw unavailablePiModelError(query, resolution);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAEA,IAAM,oBAAoB;AA6BnB,IAAM,2BAA2B,CAAC,WAAW,UAAU,QAAQ;AAEtE,IAAM,WAAW,CAAC,UAAwC,GAAG,MAAM,QAAQ,IAAI,MAAM,EAAE;AAEvF,IAAM,YAAY,CAChB,MACA,UAEA,UAAU,UACV,KAAK,SAAS,YAAY,MAAM,MAAM,SAAS,YAAY,KAC3D,KAAK,GAAG,YAAY,MAAM,MAAM,GAAG,YAAY;AAS1C,IAAM,wBAAwB,CAAC,UAAuC;AAC3E,MAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,EAAG,QAAO,CAAC;AACjF,QAAM,UAA8B,CAAC;AACrC,aAAW,CAAC,SAAS,QAAQ,KAAK,OAAO,QAAQ,KAAgC,GAAG;AAClF,UAAM,OAAO,QAAQ,KAAK;AAC1B,QAAI,CAAC,KAAM;AAGX,UAAM,QACJ,OAAO,aAAa,YAAY,aAAa,QAAQ,CAAC,MAAM,QAAQ,QAAQ,IACvE,WACD;AACN,UAAM,aAAa,QAAQ,MAAM,SAAS,MAAM,UAAU;AAC1D,UAAM,SAAS,OAAO,eAAe,WAAW,CAAC,UAAU,IAAI;AAC/D,QAAI,CAAC,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW,EAAG;AACnD,UAAM,UAAoB,CAAC;AAC3B,QAAI,QAAQ;AACZ,eAAW,aAAa,QAAQ;AAC9B,UAA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,IAAI;AAAA,IACT,SAAS,KAAK,UAAU,KAAK,CAAC,wCAAwC,MAAM;AAAA,EAE9E;AACF;AAQO,IAAM,0BAA0B,CACrC,UACA,YAKyB;AACzB,QAAM,QAAQ,SAAS,KAAK;AAC5B,QAAM,QAAQ,OAAO,KAAK,QAAQ,OAAO,EAAE;AAAA,IACzC,CAAC,SAAS,KAAK,YAAY,MAAM,MAAM,YAAY;AAAA,EACrD;AACA,MAAI,kBAAkB,KAAK,KAAK,KAAK,CAAC,OAAO;AAC3C,UAAM,QAAQ,QAAQ,UAAU;AAAA,MAC9B,CAAC,UAAU,SAAS,KAAK,EAAE,YAAY,MAAM,MAAM,YAAY;AAAA,IACjE;AACA,QAAI,MAAO,QAAO;AAElB,UAAM,YAAY,MAAM,QAAQ,GAAG;AACnC,UAAM,WAAW,MAAM,MAAM,GAAG,SAAS,EAAE,YAAY;AACvD,UAAM,UAAU;AAAA,MACd,MAAM,MAAM,YAAY,CAAC,EAAE,YAAY;AAAA,MACvC,QAAQ,UAAU,OAAO,CAAC,UAAU,MAAM,SAAS,YAAY,MAAM,QAAQ;AAAA,MAC7E,QAAQ;AAAA,IACV,GAAG;AACH,QAAI,QAAS,QAAO;AACpB,UAAM,wBAAwB,KAAK;AAAA,EACrC;AAEA,QAAM,aAAa,mBAAmB,OAAO,OAAO;AACpD,MAAI,WAAW,SAAS,cAAc,WAAW,SAAS,kBAAkB;AAC1E,WAAO,WAAW;AAAA,EACpB;AACA,QAAM,wBAAwB,OAAO,UAAU;AACjD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
agentParticipantRecords,
|
|
10
10
|
loadModelUsage,
|
|
11
11
|
useBudgetLedger
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-623AGCNU.js";
|
|
13
13
|
import {
|
|
14
14
|
RESIDENT_HOST_FORMAT,
|
|
15
15
|
residentDeliveryPrefix,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
normalizeModelAliases,
|
|
26
26
|
resolveAvailablePiModel
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-A4VP7HDF.js";
|
|
28
28
|
import {
|
|
29
29
|
parseFabricOwnedModelGuidance,
|
|
30
30
|
resolveFabricModelGuidance
|
|
@@ -689,4 +689,4 @@ if (isMain) {
|
|
|
689
689
|
export {
|
|
690
690
|
runResidentHostFromConfigPath
|
|
691
691
|
};
|
|
692
|
-
//# sourceMappingURL=chunk-
|
|
692
|
+
//# sourceMappingURL=chunk-KQHJQDJM.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writeJsonAtomic
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q2DCENFM.js";
|
|
4
4
|
import {
|
|
5
5
|
stableJsonHash
|
|
6
6
|
} from "./chunk-3YZUQESG.js";
|
|
@@ -131,4 +131,4 @@ export {
|
|
|
131
131
|
FabricComponentConfiguration,
|
|
132
132
|
watchComponentConfiguration
|
|
133
133
|
};
|
|
134
|
-
//# sourceMappingURL=chunk-
|
|
134
|
+
//# sourceMappingURL=chunk-OEDHQWE2.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-KAD7UWT2.js";
|
|
12
12
|
import {
|
|
13
13
|
normalizeModelAliases
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-A4VP7HDF.js";
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_FABRIC_THINKING,
|
|
17
17
|
isFabricThinking
|
|
@@ -1466,4 +1466,4 @@ export {
|
|
|
1466
1466
|
loadFabricConfig,
|
|
1467
1467
|
saveFabricConfig
|
|
1468
1468
|
};
|
|
1469
|
-
//# sourceMappingURL=chunk-
|
|
1469
|
+
//# sourceMappingURL=chunk-Q2DCENFM.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FabricComponentConfiguration,
|
|
3
3
|
watchComponentConfiguration
|
|
4
|
-
} from "../chunks/chunk-
|
|
5
|
-
import "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-OEDHQWE2.js";
|
|
5
|
+
import "../chunks/chunk-Q2DCENFM.js";
|
|
6
6
|
import "../chunks/chunk-OKOHRXGF.js";
|
|
7
7
|
import "../chunks/chunk-RAO6TQFP.js";
|
|
8
8
|
import "../chunks/chunk-KAD7UWT2.js";
|
|
9
|
-
import "../chunks/chunk-
|
|
9
|
+
import "../chunks/chunk-A4VP7HDF.js";
|
|
10
10
|
import "../chunks/chunk-MGWQOKBV.js";
|
|
11
11
|
import "../chunks/chunk-X3OD47CL.js";
|
|
12
12
|
import "../chunks/chunk-YU62DDKK.js";
|
|
@@ -68,8 +68,9 @@ export declare const resolveFabricModel: (query: string, options: {
|
|
|
68
68
|
}) => FabricModelResolution;
|
|
69
69
|
/**
|
|
70
70
|
* Resolve a Pi participant selector strictly within the execution owner's
|
|
71
|
-
* visible registry.
|
|
72
|
-
*
|
|
71
|
+
* visible registry. Provider-qualified selectors prefer exact IDs, then the
|
|
72
|
+
* closest visible ID/name on that same provider. Aliases retain their ordered
|
|
73
|
+
* exact-target policy; bare selectors retain normal Fabric fuzzy resolution.
|
|
73
74
|
*/
|
|
74
75
|
export declare const resolveAvailablePiModel: (selector: string, options: {
|
|
75
76
|
aliases: FabricModelAliases;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-resolution.d.ts","sourceRoot":"","sources":["../../src/core/model-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIvE,+EAA+E;AAC/E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,UA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,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAqDtD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,MAAM,EACb,SAAS;IACP,OAAO,EAAE,kBAAkB,CAAC;IAC5B,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC3C,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B,KACA,qBAgEF,CAAC;AAiBF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,EAChB,SAAS;IACP,OAAO,EAAE,kBAAkB,CAAC;IAC5B,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC3C,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B,KACA,oBA2BF,CAAC"}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
componentEntries,
|
|
13
13
|
validateComponentConfig,
|
|
14
14
|
watchComponentConfiguration
|
|
15
|
-
} from "./chunks/chunk-
|
|
15
|
+
} from "./chunks/chunk-OEDHQWE2.js";
|
|
16
16
|
import {
|
|
17
17
|
WorkerMemoryProvider
|
|
18
18
|
} from "./chunks/chunk-EDL4JDW7.js";
|
|
@@ -67,7 +67,7 @@ import "./chunks/chunk-IGVDD2HT.js";
|
|
|
67
67
|
import {
|
|
68
68
|
AGENTS_ACTION_DESCRIPTORS,
|
|
69
69
|
normalizeAgentRunRequest
|
|
70
|
-
} from "./chunks/chunk-
|
|
70
|
+
} from "./chunks/chunk-327VLBDU.js";
|
|
71
71
|
import {
|
|
72
72
|
actionArgNormalizer,
|
|
73
73
|
uniqueDeclaredKeyForSpelling
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
resolveInheritedSessionPins,
|
|
124
124
|
resolvePiBinary,
|
|
125
125
|
withInheritedSessionPins
|
|
126
|
-
} from "./chunks/chunk-
|
|
126
|
+
} from "./chunks/chunk-623AGCNU.js";
|
|
127
127
|
import {
|
|
128
128
|
executeFile,
|
|
129
129
|
processIsAlive,
|
|
@@ -159,7 +159,7 @@ import {
|
|
|
159
159
|
loadFabricConfig,
|
|
160
160
|
raceShellHang,
|
|
161
161
|
trackShellOperations
|
|
162
|
-
} from "./chunks/chunk-
|
|
162
|
+
} from "./chunks/chunk-Q2DCENFM.js";
|
|
163
163
|
import "./chunks/chunk-OKOHRXGF.js";
|
|
164
164
|
import "./chunks/chunk-RAO6TQFP.js";
|
|
165
165
|
import {
|
|
@@ -184,7 +184,7 @@ import {
|
|
|
184
184
|
FUZZY_RESOLUTION_MARKERS,
|
|
185
185
|
resolveAvailablePiModel,
|
|
186
186
|
resolveFabricModel
|
|
187
|
-
} from "./chunks/chunk-
|
|
187
|
+
} from "./chunks/chunk-A4VP7HDF.js";
|
|
188
188
|
import {
|
|
189
189
|
isFabricThinking
|
|
190
190
|
} from "./chunks/chunk-MGWQOKBV.js";
|
package/dist/index.js
CHANGED
|
@@ -212,7 +212,7 @@ import {
|
|
|
212
212
|
loadFabricConfig,
|
|
213
213
|
loadFabricConfigForScope,
|
|
214
214
|
saveFabricConfig
|
|
215
|
-
} from "./chunks/chunk-
|
|
215
|
+
} from "./chunks/chunk-Q2DCENFM.js";
|
|
216
216
|
import {
|
|
217
217
|
defaultCodePreviewSettings
|
|
218
218
|
} from "./chunks/chunk-OKOHRXGF.js";
|
|
@@ -234,7 +234,7 @@ import "./chunks/chunk-ZDNGXLEC.js";
|
|
|
234
234
|
import {
|
|
235
235
|
FABRIC_ACTOR_PI_HOST_EVENTS
|
|
236
236
|
} from "./chunks/chunk-OTCASLY2.js";
|
|
237
|
-
import "./chunks/chunk-
|
|
237
|
+
import "./chunks/chunk-A4VP7HDF.js";
|
|
238
238
|
import "./chunks/chunk-MGWQOKBV.js";
|
|
239
239
|
import "./chunks/chunk-3H7SDWZI.js";
|
|
240
240
|
import "./chunks/chunk-X3OD47CL.js";
|
package/dist/residency/host.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runResidentHostFromConfigPath
|
|
4
|
-
} from "../chunks/chunk-
|
|
5
|
-
import "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-KQHJQDJM.js";
|
|
5
|
+
import "../chunks/chunk-623AGCNU.js";
|
|
6
6
|
import "../chunks/chunk-X7G62ZGH.js";
|
|
7
7
|
import "../chunks/chunk-VPPIJRNZ.js";
|
|
8
8
|
import "../chunks/chunk-PM5I335G.js";
|
|
@@ -10,7 +10,7 @@ import "../chunks/chunk-JNMTTJMQ.js";
|
|
|
10
10
|
import "../chunks/chunk-R7G4HXVD.js";
|
|
11
11
|
import "../chunks/chunk-PXAICAUT.js";
|
|
12
12
|
import "../chunks/chunk-CGPK5WHX.js";
|
|
13
|
-
import "../chunks/chunk-
|
|
13
|
+
import "../chunks/chunk-Q2DCENFM.js";
|
|
14
14
|
import "../chunks/chunk-OKOHRXGF.js";
|
|
15
15
|
import "../chunks/chunk-RAO6TQFP.js";
|
|
16
16
|
import "../chunks/chunk-JJZFNBB7.js";
|
|
@@ -19,7 +19,7 @@ import "../chunks/chunk-KAD7UWT2.js";
|
|
|
19
19
|
import "../chunks/chunk-ZDNGXLEC.js";
|
|
20
20
|
import "../chunks/chunk-AYBIR4YV.js";
|
|
21
21
|
import "../chunks/chunk-OTCASLY2.js";
|
|
22
|
-
import "../chunks/chunk-
|
|
22
|
+
import "../chunks/chunk-A4VP7HDF.js";
|
|
23
23
|
import "../chunks/chunk-MGWQOKBV.js";
|
|
24
24
|
import "../chunks/chunk-3H7SDWZI.js";
|
|
25
25
|
import "../chunks/chunk-X3OD47CL.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runResidentHostFromConfigPath
|
|
3
|
-
} from "../chunks/chunk-
|
|
4
|
-
import "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-KQHJQDJM.js";
|
|
4
|
+
import "../chunks/chunk-623AGCNU.js";
|
|
5
5
|
import "../chunks/chunk-X7G62ZGH.js";
|
|
6
6
|
import "../chunks/chunk-VPPIJRNZ.js";
|
|
7
7
|
import "../chunks/chunk-PM5I335G.js";
|
|
@@ -9,7 +9,7 @@ import "../chunks/chunk-JNMTTJMQ.js";
|
|
|
9
9
|
import "../chunks/chunk-R7G4HXVD.js";
|
|
10
10
|
import "../chunks/chunk-PXAICAUT.js";
|
|
11
11
|
import "../chunks/chunk-CGPK5WHX.js";
|
|
12
|
-
import "../chunks/chunk-
|
|
12
|
+
import "../chunks/chunk-Q2DCENFM.js";
|
|
13
13
|
import "../chunks/chunk-OKOHRXGF.js";
|
|
14
14
|
import "../chunks/chunk-RAO6TQFP.js";
|
|
15
15
|
import "../chunks/chunk-JJZFNBB7.js";
|
|
@@ -18,7 +18,7 @@ import "../chunks/chunk-KAD7UWT2.js";
|
|
|
18
18
|
import "../chunks/chunk-ZDNGXLEC.js";
|
|
19
19
|
import "../chunks/chunk-AYBIR4YV.js";
|
|
20
20
|
import "../chunks/chunk-OTCASLY2.js";
|
|
21
|
-
import "../chunks/chunk-
|
|
21
|
+
import "../chunks/chunk-A4VP7HDF.js";
|
|
22
22
|
import "../chunks/chunk-MGWQOKBV.js";
|
|
23
23
|
import "../chunks/chunk-3H7SDWZI.js";
|
|
24
24
|
import "../chunks/chunk-X3OD47CL.js";
|
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
} from "../chunks/chunk-7TB7NXSL.js";
|
|
13
13
|
import {
|
|
14
14
|
MAX_EXECUTOR_TIMEOUT_MS
|
|
15
|
-
} from "../chunks/chunk-
|
|
15
|
+
} from "../chunks/chunk-Q2DCENFM.js";
|
|
16
16
|
import "../chunks/chunk-OKOHRXGF.js";
|
|
17
17
|
import "../chunks/chunk-RAO6TQFP.js";
|
|
18
18
|
import "../chunks/chunk-KAD7UWT2.js";
|
|
19
|
-
import "../chunks/chunk-
|
|
19
|
+
import "../chunks/chunk-A4VP7HDF.js";
|
|
20
20
|
import "../chunks/chunk-MGWQOKBV.js";
|
|
21
21
|
import "../chunks/chunk-X3OD47CL.js";
|
|
22
22
|
import {
|
package/dist/ui/settings.js
CHANGED
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
loadFabricConfigForScope,
|
|
25
25
|
maxExecutorMemoryLimitBytes,
|
|
26
26
|
saveFabricConfig
|
|
27
|
-
} from "../chunks/chunk-
|
|
27
|
+
} from "../chunks/chunk-Q2DCENFM.js";
|
|
28
28
|
import "../chunks/chunk-OKOHRXGF.js";
|
|
29
29
|
import "../chunks/chunk-RAO6TQFP.js";
|
|
30
30
|
import "../chunks/chunk-KAD7UWT2.js";
|
|
31
|
-
import "../chunks/chunk-
|
|
31
|
+
import "../chunks/chunk-A4VP7HDF.js";
|
|
32
32
|
import {
|
|
33
33
|
THINKING_LEVELS,
|
|
34
34
|
thinkingLabel
|
package/docs/agents.md
CHANGED
|
@@ -26,13 +26,28 @@ You can give `fabric_exec` optional `agentBudget` and `tokenBudget` limits. Conf
|
|
|
26
26
|
|
|
27
27
|
`agents.wait({id})` waits for a spawned agent; `agents.join({id})` is an alias with identical arguments, result, progress, and notification behavior. Use `wait` as the canonical spelling. The hosted `AgentService` and `AgentServiceClient` expose both methods too. [Jev programs](jev.md) follow the same `wait`/`join` naming.
|
|
28
28
|
|
|
29
|
+
### Reuse discovered model keys
|
|
30
|
+
|
|
31
|
+
Use `agents.models({ runner: "pi" })` and copy the returned `key` verbatim, or use an explicitly configured `models.aliases` name. Reuse the `model` returned by a successful spawn rather than reconstructing it from an agent's display name. For example, an agent named “Sol” need not share the version number of one named “Astra”. Prior success with one key does not validate a different key.
|
|
32
|
+
|
|
33
|
+
`provider/model` selectors prefer an exact visible match. A near-miss ID resolves to the closest available model on the **same provider**, using Fabric's existing similarity ranking; ties prefer recent usage, then canonical key order. For example, `openai-codex/gpt-6-sol` resolves to `openai-codex/gpt-5.6-sol` when that is the closest visible model. The returned handle's `model` and the worker's `requestedModel` contain the canonical selection. Unknown providers and names without sufficient resemblance still fail before launch. Model IDs containing `/` stay provider-scoped. Configured aliases keep their ordered, exact-target fallback chains.
|
|
34
|
+
|
|
35
|
+
For independent launches, await `Promise.allSettled` and inspect every result. An uncaught `Promise.all` rejection ends the Fabric program and can abort sibling calls still in flight; it does not prove every requested model was unavailable. Already completed calls are not rolled back, so retain successful handles rather than retrying the entire batch.
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
const results = await Promise.allSettled(requests.map(request => agents.spawn(request)));
|
|
39
|
+
return results.map(result => result.status === "fulfilled"
|
|
40
|
+
? { ok: true, handle: result.value }
|
|
41
|
+
: { ok: false, error: String(result.reason) });
|
|
42
|
+
```
|
|
43
|
+
|
|
29
44
|
### Requested models are authoritative
|
|
30
45
|
|
|
31
46
|
For Pi workers, Fabric reapplies the resolved `provider/model` over RPC **after startup extensions finish**, reapplies the requested thinking level, and independently reads `get_state` before sending the task. A successful `set_model` response alone is insufficient: it can echo the requested model even when an extension switches away during `model_select`. Thinking is reported at Pi's effective, capability-clamped level.
|
|
32
47
|
|
|
33
48
|
Startup waits for a correlated RPC readiness response. Startup, model admission, and task execution share the run's configured `timeoutMs`; there is no separate 15-second admission cap. RPC readiness does not guarantee a fast `set_model`: authentication checks and async `model_select` hooks can still wait on provider initialization or shared resources during concurrent launches. A slow handshake may use the remaining run budget, but it never resets or extends the overall deadline.
|
|
34
49
|
|
|
35
|
-
|
|
50
|
+
Selectors with no available match, rejected/malformed RPC responses, or a remaining model mismatch fail the run without sending its task. A startup or admission stall exhausts the overall deadline with `timed_out`, also without sending the task. Queued controls wait for admission too. After parent-side selector resolution, the worker must use that canonical model: it does not substitute an MRU model or fall back during admission. Standalone `AgentManager` callers can also supply a unique exact bare model ID; ambiguous IDs must be provider-qualified.
|
|
36
51
|
|
|
37
52
|
`requestedModel` preserves launch intent in run records; `model` follows verified child state and actual assistant attribution. The manager and participant UI preserve that observed value; the launch label cannot overwrite it. If assistant attribution drifts after admission, Fabric terminates the child and reports both requested and observed models in the failure. This verifies Pi's local provider/model identity, not a remote provider's internal routing.
|
|
38
53
|
|
|
@@ -263,7 +278,7 @@ await agents.switchModel({ model: "cheap" });
|
|
|
263
278
|
|
|
264
279
|
The selector resolves in order: a `models.aliases` entry (a string alias is one target; an array is a fallback chain where the first authenticated target wins), an exact `provider/id`, an exact model id, then the closest match across provider, id, and display name. Closeness ties fall to the most recently used model, read from the [pi-model-sort](https://github.com/monotykamary/pi-model-sort) extension's usage store when it is installed, and then to the highest-sorting key, mirroring pi's newest-alias convention. An optional `provider` argument narrows every stage. Selectors with no resemblance to an authenticated entry and exhausted alias chains throw; the session model stays unchanged. `agents.models()` enumerates the authenticated registry entries this resolution runs against. The result reports the active model, the previous one, and how the selector resolved: `via` is the alias name for configured aliases, or `closest`, `recent`, or `latest` for fuzzy picks. A call naming the active model returns `{ switched: false, reason: "already-active" }`. The switch applies to the next model turn and later, unlike `prewalk`, which temporarily installs an executor model at a mutation boundary and then restores the boundary model.
|
|
265
280
|
|
|
266
|
-
Pi-runner `model` arguments on `agents.run`, `agents.spawn`, `agents.create`, and `agents.handoff`, plus actor defaults and activation overrides, resolve through the same selector logic (aliases, closest match, recency). The execution owner's `agents.models({ runner: "pi" })` result is authoritative:
|
|
281
|
+
Pi-runner `model` arguments on `agents.run`, `agents.spawn`, `agents.create`, and `agents.handoff`, plus actor defaults and activation overrides, resolve through the same selector logic (aliases, closest match, recency). The execution owner's `agents.models({ runner: "pi" })` result is authoritative: provider-qualified near-misses are matched only on that provider, selectors with no similar visible candidate and exhausted aliases fail with a session-availability error. Fabric revalidates the canonical model at the worker launch boundary, including remote and durable actor execution, so stale bindings cannot start a model that is no longer visible. Catalog-fresh or custom IDs must appear in the owner's visible registry before a Pi participant can use them. Claude and Veda model values keep their runner-specific behavior.
|
|
267
282
|
|
|
268
283
|
This is the host-level equivalent of the `pi-model-switch` extension's `switch_model` tool, with aliases moved into Fabric configuration so project and agent scopes behave like every other Fabric section.
|
|
269
284
|
|