@bastani/atomic 0.9.26-alpha.3 → 0.9.26-alpha.4
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/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/broker/broker.ts +9 -1
- package/dist/builtin/intercom/index.bundle.mjs +11 -2
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/intercom/types.ts +13 -0
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +6 -0
- package/dist/builtin/workflows/builtin/{chunk-kfsnh3w7.js → chunk-73p2cm5s.js} +4 -2
- package/dist/builtin/workflows/builtin/{chunk-rqmasd3d.js → chunk-n95myjcg.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-wz783pvd.js → chunk-ycvg8y8k.js} +1 -1
- package/dist/builtin/workflows/builtin/goal.js +2 -2
- package/dist/builtin/workflows/builtin/index.js +3 -3
- package/dist/builtin/workflows/builtin/ralph.js +2 -2
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +336 -241
- package/dist/builtin/workflows/src/index.js +25 -15
- package/dist/core/extensions/context-types.d.ts +5 -2
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/docs/intercom/reference.md +13 -1
- package/docs/workflows/operations.md +2 -0
- package/npm-shrinkwrap.json +32 -32
- package/package.json +4 -4
|
@@ -32519,10 +32519,10 @@ function recordPendingStageMessageDeliveries(messages, runId, messageId, records
|
|
|
32519
32519
|
if (index < 0)
|
|
32520
32520
|
return messages;
|
|
32521
32521
|
const entry = messages[index];
|
|
32522
|
-
const recorded = new Set((entry.deliveries ?? []).map((delivery) =>
|
|
32522
|
+
const recorded = new Set((entry.deliveries ?? []).map((delivery) => JSON.stringify([delivery.runId, delivery.stageId, delivery.sessionId, delivery.admission])));
|
|
32523
32523
|
const additions = [];
|
|
32524
32524
|
for (const record of records) {
|
|
32525
|
-
const key =
|
|
32525
|
+
const key = JSON.stringify([record.runId, record.stageId, record.sessionId, record.admission]);
|
|
32526
32526
|
if (recorded.has(key))
|
|
32527
32527
|
continue;
|
|
32528
32528
|
recorded.add(key);
|
|
@@ -32530,6 +32530,8 @@ function recordPendingStageMessageDeliveries(messages, runId, messageId, records
|
|
|
32530
32530
|
runId: record.runId,
|
|
32531
32531
|
stageId: record.stageId,
|
|
32532
32532
|
...record.stageName === undefined ? {} : { stageName: record.stageName },
|
|
32533
|
+
...record.sessionId === undefined ? {} : { sessionId: record.sessionId },
|
|
32534
|
+
...record.admission === undefined ? {} : { admission: record.admission },
|
|
32533
32535
|
deliveredAt
|
|
32534
32536
|
});
|
|
32535
32537
|
}
|
|
@@ -51124,14 +51126,21 @@ function createWorkflowPendingStageDelivery(activeStore, runId, stageId, stageNa
|
|
|
51124
51126
|
};
|
|
51125
51127
|
return {
|
|
51126
51128
|
routeCapability: workflowPendingStageRouteCapability(activeStore, runId),
|
|
51127
|
-
deliverPending(deliver) {
|
|
51129
|
+
deliverPending(deliver, recipient) {
|
|
51128
51130
|
if (drainPromise !== undefined)
|
|
51129
51131
|
return drainPromise;
|
|
51130
51132
|
if (terminalError !== undefined)
|
|
51131
51133
|
return Promise.resolve();
|
|
51132
51134
|
drainError = undefined;
|
|
51133
|
-
const attempt = deliverPendingStageMessages(activeStore, runId, stageId, stageName, deliver);
|
|
51134
|
-
const drain = attempt.then(() =>
|
|
51135
|
+
const attempt = deliverPendingStageMessages(activeStore, runId, stageId, stageName, deliver, recipient);
|
|
51136
|
+
const drain = attempt.then(() => {
|
|
51137
|
+
resolveReady?.();
|
|
51138
|
+
readyPromise = undefined;
|
|
51139
|
+
resolveReady = undefined;
|
|
51140
|
+
rejectReady = undefined;
|
|
51141
|
+
if (drainPromise === drain)
|
|
51142
|
+
drainPromise = undefined;
|
|
51143
|
+
}, (error) => {
|
|
51135
51144
|
drainError = error;
|
|
51136
51145
|
rejectReady?.(error);
|
|
51137
51146
|
readyPromise = undefined;
|
|
@@ -51144,8 +51153,8 @@ function createWorkflowPendingStageDelivery(activeStore, runId, stageId, stageNa
|
|
|
51144
51153
|
drainPromise = drain;
|
|
51145
51154
|
return drainPromise;
|
|
51146
51155
|
},
|
|
51147
|
-
ready() {
|
|
51148
|
-
if (activeStore.pendingStageMessagesFor(runId, stageId).length === 0 && (stageId === stageName || activeStore.pendingStageMessagesFor(runId, stageName).length === 0) && stickyPendingStageEntriesForStage(activeStore, runId, stageId, stageName).length === 0) {
|
|
51156
|
+
ready(sessionId) {
|
|
51157
|
+
if (activeStore.pendingStageMessagesFor(runId, stageId).length === 0 && (stageId === stageName || activeStore.pendingStageMessagesFor(runId, stageName).length === 0) && stickyPendingStageEntriesForStage(activeStore, runId, stageId, stageName, sessionId === undefined ? undefined : { sessionId }).length === 0) {
|
|
51149
51158
|
return;
|
|
51150
51159
|
}
|
|
51151
51160
|
if (terminalError !== undefined)
|
|
@@ -51163,8 +51172,8 @@ function createWorkflowPendingStageDelivery(activeStore, runId, stageId, stageNa
|
|
|
51163
51172
|
}
|
|
51164
51173
|
};
|
|
51165
51174
|
}
|
|
51166
|
-
async function deliverPendingStageMessages(activeStore, runId, stageId, stageName, deliver) {
|
|
51167
|
-
const stickyEntries = stickyPendingStageEntriesForStage(activeStore, runId, stageId, stageName);
|
|
51175
|
+
async function deliverPendingStageMessages(activeStore, runId, stageId, stageName, deliver, recipient) {
|
|
51176
|
+
const stickyEntries = stickyPendingStageEntriesForStage(activeStore, runId, stageId, stageName, recipient);
|
|
51168
51177
|
const candidateIds = new Set([
|
|
51169
51178
|
...activeStore.pendingStageMessagesFor(runId, stageId),
|
|
51170
51179
|
...activeStore.pendingStageMessagesFor(runId, stageName),
|
|
@@ -51186,7 +51195,8 @@ async function deliverPendingStageMessages(activeStore, runId, stageId, stageNam
|
|
|
51186
51195
|
if (releaseClaim === undefined)
|
|
51187
51196
|
continue;
|
|
51188
51197
|
try {
|
|
51189
|
-
|
|
51198
|
+
if (!recipient?.receivedMessageIds.includes(entry.message.id))
|
|
51199
|
+
await deliver(toPendingStageSender(entry), entry.message);
|
|
51190
51200
|
if (entry.sticky === true) {
|
|
51191
51201
|
const entryBackend = durableBackendForRun(rootBackend, activeStore.runs(), entry.runId);
|
|
51192
51202
|
if (entryBackend === undefined) {
|
|
@@ -51196,7 +51206,8 @@ async function deliverPendingStageMessages(activeStore, runId, stageId, stageNam
|
|
|
51196
51206
|
{
|
|
51197
51207
|
runId,
|
|
51198
51208
|
stageId,
|
|
51199
|
-
...stageName === stageId ? {} : { stageName }
|
|
51209
|
+
...stageName === stageId ? {} : { stageName },
|
|
51210
|
+
...recipient === undefined ? {} : { sessionId: recipient.sessionId, admission: "context" }
|
|
51200
51211
|
}
|
|
51201
51212
|
], new Date().toISOString(), entryBackend)) {
|
|
51202
51213
|
throw new Error(`atomic-workflows: pending-stage message ${entry.id} changed during delivery`);
|
|
@@ -51211,7 +51222,7 @@ async function deliverPendingStageMessages(activeStore, runId, stageId, stageNam
|
|
|
51211
51222
|
}
|
|
51212
51223
|
}
|
|
51213
51224
|
}
|
|
51214
|
-
function stickyPendingStageEntriesForStage(activeStore, runId, stageId, stageName) {
|
|
51225
|
+
function stickyPendingStageEntriesForStage(activeStore, runId, stageId, stageName, recipient) {
|
|
51215
51226
|
const runs = activeStore.runs();
|
|
51216
51227
|
const rootRunId = durableRootRunIdForRun(runs, runId);
|
|
51217
51228
|
if (rootRunId === undefined)
|
|
@@ -51228,9 +51239,8 @@ function stickyPendingStageEntriesForStage(activeStore, runId, stageId, stageNam
|
|
|
51228
51239
|
const parsed = entry.targetPath === undefined ? undefined : parseWorkflowStageTarget(entry.targetPath);
|
|
51229
51240
|
if (parsed === undefined || parsed.rootRunId !== rootRunId)
|
|
51230
51241
|
return false;
|
|
51231
|
-
if ((entry.deliveries ?? []).some((delivery) => delivery.runId === runId && delivery.stageId === stageId))
|
|
51242
|
+
if ((entry.deliveries ?? []).some((delivery) => delivery.runId === runId && delivery.stageId === stageId && (recipient === undefined || delivery.admission === "context" && delivery.sessionId === recipient.sessionId && (recipient.receivedMessageIds === undefined || recipient.receivedMessageIds.includes(entry.message.id)))))
|
|
51232
51243
|
return false;
|
|
51233
|
-
}
|
|
51234
51244
|
return stageMatchesPathPattern(parsed.segments, hops, [stageId, stageName]);
|
|
51235
51245
|
});
|
|
51236
51246
|
}
|
|
@@ -53758,7 +53768,7 @@ class StageSessionController {
|
|
|
53758
53768
|
const attachedSession = session instanceof Promise ? await session : session;
|
|
53759
53769
|
this.reportStartupPhase("delivery-readiness");
|
|
53760
53770
|
try {
|
|
53761
|
-
await this.sharedOrchestrationContext?.pendingStageDelivery?.ready();
|
|
53771
|
+
await this.sharedOrchestrationContext?.pendingStageDelivery?.ready(attachedSession.sessionId);
|
|
53762
53772
|
await this.opts.onSessionReady?.();
|
|
53763
53773
|
if (this.disposed || this.opts.signal?.aborted || this.abortGeneration !== startGeneration)
|
|
53764
53774
|
throw this.staleCreationReason(startGeneration);
|
|
@@ -84,8 +84,11 @@ export interface WorkflowPendingStageMessage {
|
|
|
84
84
|
export interface WorkflowPendingStageDelivery {
|
|
85
85
|
/** Process-private authority proving this stage belongs to the workflow run route. */
|
|
86
86
|
readonly routeCapability: string;
|
|
87
|
-
deliverPending(deliver: (from: WorkflowPendingStageSender, message: WorkflowPendingStageMessage) => void | Promise<void
|
|
88
|
-
|
|
87
|
+
deliverPending(deliver: (from: WorkflowPendingStageSender, message: WorkflowPendingStageMessage) => void | Promise<void>, recipient?: {
|
|
88
|
+
readonly sessionId: string;
|
|
89
|
+
readonly receivedMessageIds: readonly string[];
|
|
90
|
+
}): Promise<void>;
|
|
91
|
+
ready(sessionId?: string): Promise<void> | undefined;
|
|
89
92
|
/**
|
|
90
93
|
* Terminal signal from a delivery owner that has run out of recovery: the
|
|
91
94
|
* queued messages can no longer be drained, so the stage must fail at its own
|
|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AAC,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-types.js","sourceRoot":"","sources":["../../../src/core/extensions/context-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Api, ImageContent, Model, TextContent } from \"@bastani/pi-ai/compat\";\nimport type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { VerbatimCompactionResult } from \"../compaction/index.ts\";\nimport type { CustomMessage } from \"../messages.ts\";\nimport type { ModelRegistry } from \"../model-registry.ts\";\nimport type { ScopedModel } from \"../model-resolver.ts\";\nimport type { ReadonlySessionManager, SessionManager } from \"../session-manager.ts\";\nimport type { SkillCatalog } from \"../skill-catalog.ts\";\nimport type { BuildSystemPromptOptions } from \"../system-prompt.ts\";\nimport type { WorkflowStageAdmissionBoundary } from \"../workflow-stage-admission.ts\";\nimport type { SendMessageOptions, SendMessagesOptions } from \"./message-types.ts\";\nimport type { ExtensionUIContext } from \"./ui-types.js\";\nimport type { WorkflowActivityObserver, WorkflowActivitySubscription } from \"./workflow-events.js\";\nexport interface ExecuteToolOptions {\n\tsignal?: AbortSignal;\n\tonUpdate?: import(\"@earendil-works/pi-agent-core\").AgentToolUpdateCallback;\n}\n\n/** Tool-only context. Nested calls retain session validation and permission hooks. */\nexport interface ExtensionToolContext extends ExtensionContext {\n\treadonly tools: readonly import(\"@earendil-works/pi-agent-core\").AgentTool[];\n\texecuteTool(\n\t\tname: string,\n\t\targs: unknown,\n\t\toptions?: ExecuteToolOptions,\n\t): Promise<import(\"@earendil-works/pi-agent-core\").AgentToolCallOutcome>;\n}\n\nexport interface ContextUsage {\n\t/** Estimated context tokens, or null if unknown (e.g. right after compaction, before next LLM response). */\n\ttokens: number | null;\n\tcontextWindow: number;\n\t/** Context usage as percentage of context window, or null if tokens is unknown. */\n\tpercent: number | null;\n}\n\nexport interface CompactOptions {\n\t/** Fraction of compactable context to keep. 0.3 is aggressive, 0.7 is light. */\n\tcompression_ratio?: number;\n\t/** Number of recent context-eligible messages to keep uncompressed. */\n\tpreserve_recent?: number;\n\t/** Focus query for relevance-based pruning. Defaults to auto-detected session context. */\n\tquery?: string;\n\tonComplete?: (result: VerbatimCompactionResult) => void;\n\tonError?: (error: Error) => void;\n}\n\n/**\n * Late routes settle as delivery acknowledgements: resolution means the route\n * accepted delivery, while rejection means delivery was not fully accepted. A\n * sequential batch may have delivered a prefix before it rejects; stale-context\n * rejection identifies the dropped route, and other failures reject unchanged.\n */\nexport interface WorkflowStageLateMessageRouter {\n\trouteMessage<T>(\n\t\tmessage: Pick<CustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">,\n\t\toptions?: SendMessageOptions,\n\t): void | Promise<void>;\n\trouteMessages<T>(\n\t\tmessages: Array<Pick<CustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">>,\n\t\toptions?: SendMessagesOptions,\n\t): void | Promise<void>;\n}\n\nexport interface WorkflowStageMessageAdmission {\n\t/** Internal generation-owned boundary shared by every model-fallback session. */\n\treadonly boundary: WorkflowStageAdmissionBoundary;\n\t/** Internal extension state that must survive model-fallback session replacement. */\n\treadonly extensionState: Map<string, object>;\n\tisOpen(): boolean;\n}\n\nexport interface WorkflowPendingStageSender {\n\treadonly id: string;\n\treadonly name?: string;\n\treadonly cwd: string;\n\treadonly model: string;\n\treadonly pid: number;\n\treadonly startedAt: number;\n\treadonly lastActivity: number;\n\treadonly status?: string;\n\treadonly group?: string;\n}\n\nexport interface WorkflowPendingStageMessage {\n\treadonly id: string;\n\treadonly timestamp: number;\n\treadonly replyTo?: string;\n\treadonly expectsReply?: boolean;\n\treadonly replyError?: string;\n\treadonly content: {\n\t\treadonly text: string;\n\t\treadonly attachments?: readonly {\n\t\t\treadonly type: \"file\" | \"snippet\" | \"context\";\n\t\t\treadonly name: string;\n\t\t\treadonly content: string;\n\t\t\treadonly language?: string;\n\t\t}[];\n\t};\n}\n\nexport interface WorkflowPendingStageDelivery {\n\t/** Process-private authority proving this stage belongs to the workflow run route. */\n\treadonly routeCapability: string;\n\tdeliverPending(\n\t\tdeliver: (from: WorkflowPendingStageSender, message: WorkflowPendingStageMessage) => void | Promise<void>,\n\t): Promise<void>;\n\tready(): Promise<void> | undefined;\n\t/**\n\t * Terminal signal from a delivery owner that has run out of recovery: the\n\t * queued messages can no longer be drained, so the stage must fail at its own\n\t * lifecycle boundary rather than run without the instructions it was given.\n\t * Idempotent — the first reason wins, and `ready()` then settles with a\n\t * stage-scoped error instead of waiting for a delivery that will not come.\n\t *\n\t * Required, not optional: `ready()` has no timeout, so a delivery that cannot\n\t * be settled leaves its stage parked forever. Every implementer must be able\n\t * to answer that no delivery is coming.\n\t */\n\tfail(reason: Error): void;\n}\n\nexport interface WorkflowStageOrchestrationContext {\n\treadonly kind: \"workflow-stage\";\n\treadonly workflowRunId: string;\n\treadonly workflowStageId: string;\n\treadonly workflowStageName: string;\n\treadonly constraints: {\n\t\treadonly disableWorkflowTool: true;\n\t};\n\t/** Internal lifecycle seam for surfacing detached results after this stage closes. */\n\treadonly lateMessageRouter?: WorkflowStageLateMessageRouter;\n\t/** Internal synchronous boundary used before producer reply/turn side effects. */\n\treadonly messageAdmission?: WorkflowStageMessageAdmission;\n\t/**\n\t * Resolved per-session intercom home group for this stage. Concrete, already\n\t * normalized upstream. Read by the intercom extension (buildRegistration) and\n\t * inherited by subagents this stage spawns. Absent => no group override.\n\t */\n\treadonly intercomGroup?: string;\n\t/** Durable pre-start intercom delivery, drained by the intercom extension before the first turn. */\n\treadonly pendingStageDelivery?: WorkflowPendingStageDelivery;\n}\n/** Typed child intercom identity and supervisor capability issued at admission. */\nexport interface SubagentIntercomIdentity {\n\treadonly orchestratorTarget: string;\n\treadonly runId: string;\n\treadonly agent: string;\n\treadonly index: number;\n\treadonly sessionName?: string;\n\treadonly supervisor?: {\n\t\treadonly capability: string;\n\t\treadonly supervisorSessionId: string;\n\t};\n}\n\n/** Typed child capability policy supplied by an in-process subagent admission. */\nexport interface SubagentChildPolicy {\n\treadonly managementActions: \"full\" | \"restricted\";\n\treadonly fanoutAuthorized: boolean;\n\treadonly inheritProjectContext: boolean;\n\treadonly inheritSkills: boolean;\n\t/** Host-owned signal fired when this noninteractive execution ends, before disposal. */\n\treadonly executionEnded?: AbortSignal;\n\t/** SDK-owned inbound lifetime; closing drains admitted messages without reopening the task. */\n\treadonly messageAdmission?: {\n\t\tisOpen(): boolean;\n\t\t/** Reserve the full producer operation, including retries, before child settlement. */\n\t\trun(deliver: () => void | Promise<void>): Promise<void>;\n\t};\n\t/** Current admitted in-process nesting depth; absent for top-level sessions. */\n\treadonly depth?: number;\n\t/** SDK-resolved exact child tool allowlist; undefined leaves ordinary tools unrestricted. */\n\treadonly tools?: readonly string[];\n\t/** Server or server/tool selections. Undefined preserves MCP defaults; [] disables selector-based access. */\n\treadonly mcpDirectTools?: readonly string[];\n\t/** Admission-issued identity/capability; never inherited through process environment. */\n\treadonly intercom?: SubagentIntercomIdentity;\n\t/** Resolved intercom group for this admitted child, when one was assigned. */\n\treadonly intercomGroup?: string;\n}\n// Union alias kept for forward-compatible orchestration context variants.\nexport type OrchestrationContext = WorkflowStageOrchestrationContext;\n\n/**\n * Context passed to extension event handlers.\n */\nexport type ExtensionMode = \"tui\" | \"rpc\" | \"json\" | \"print\";\n\nexport interface ExtensionContext {\n\t/** Observe the owning session's workflow activity, starting with an ordered snapshot. */\n\tobserveWorkflowActivity(observer: WorkflowActivityObserver): WorkflowActivitySubscription;\n\t/** Paths of actually loaded extensions, when supplied by the host. */\n\tgetExtensionPaths?(): string[];\n\t/** Internal actual-session binding; never populated from model arguments. */\n\tgetAgentTaskHost?(): import(\"../tasks/agent-adapter.js\").AgentTaskHost;\n\t/** Internal owner-bound defaults and capability ceiling for builtin child adapters. */\n\tgetChildSessionOptions?: import(\"../child-session-options.ts\").ChildSessionOptionsResolver;\n\t/** Session-scoped orchestration policy for child runtimes such as workflow stages. */\n\treadonly orchestrationContext?: OrchestrationContext;\n\t/** Typed capability policy for an in-process subagent child, when this session is one. */\n\treadonly subagentPolicy?: SubagentChildPolicy;\n\t/** UI methods for user interaction */\n\tui: ExtensionUIContext;\n\t/** Current run mode. Use \"tui\" to guard terminal-only UI such as custom components. */\n\tmode: ExtensionMode;\n\t/** Whether dialog-capable UI is available (true in TUI and RPC modes) */\n\thasUI: boolean;\n\t/** Whether a semantic human-input adapter is available, independently of rendering. */\n\thasHumanInput: boolean;\n\t/** Current working directory */\n\tcwd: string;\n\t/** Session manager (read-only) */\n\tsessionManager: ReadonlySessionManager;\n\t/** Model registry for API key resolution */\n\tmodelRegistry: ModelRegistry;\n\t/** Current model (may be undefined) */\n\tmodel: Model<Api> | undefined;\n\t/** Models scoped to this session (resolved from `--models` / `enabledModels`\n\t * settings against the available catalogue). Same set the `/scoped-models`\n\t * command shows. Empty when no scoping is configured (all available models\n\t * are usable). Read-only snapshot, resolved at access time. */\n\tscopedModels: readonly ScopedModel[];\n\t/** Current thinking level, resolved from the active session at access time. */\n\tthinkingLevel?: ThinkingLevel;\n\t/** Session-scoped internal resource router (e.g. artifact:// resolver). */\n\treadonly internalResourceRouter?: import(\"../tools/resource-selectors.ts\").InternalResourceRouter;\n\t/** Whether the agent is idle (not streaming) */\n\tisIdle(): boolean;\n\t/** Whether project-local trust is active for this context. */\n\tisProjectTrusted(): boolean;\n\t/** The current abort signal, or undefined when the agent is not streaming. */\n\tsignal: AbortSignal | undefined;\n\t/** Abort the current agent operation */\n\tabort(): void;\n\t/** Whether there are queued messages waiting */\n\thasPendingMessages(): boolean;\n\t/** Gracefully shutdown pi and exit. Available in all contexts. */\n\tshutdown(): void;\n\t/** Get current context usage for the active model. */\n\tgetContextUsage(): ContextUsage | undefined;\n\t/** Trigger compaction without awaiting completion. */\n\tcompact(options?: CompactOptions): void;\n\t/** Get the current effective system prompt. */\n\tgetSystemPrompt(): string;\n\t/** Current loader-owned skill candidates and exact selector resolver. */\n\tgetSkillCatalog?(): SkillCatalog;\n\t/** Current routing-only inference setting from the owning session. Does not change the chat model. */\n\tgetRouterModel(): string;\n\t/** Provider filters for `model: \"auto\"` candidates from the owning session's settings. */\n\tgetModelRouting?(): import(\"../settings-types.ts\").ModelRoutingSettings;\n}\n\n/**\n * Extended context for command handlers.\n * Includes session control methods only safe in user-initiated commands.\n */\nexport interface ExtensionCommandContext extends ExtensionContext {\n\t/** Get the current base system-prompt construction options. */\n\tgetSystemPromptOptions(): BuildSystemPromptOptions;\n\n\t/** Wait for the agent to finish streaming */\n\twaitForIdle(): Promise<void>;\n\n\t/** Start a new session, optionally with initialization. */\n\tnewSession(options?: {\n\t\tparentSession?: string;\n\t\tsetup?: (sessionManager: SessionManager) => Promise<void>;\n\t\twithSession?: (ctx: ReplacedSessionContext) => Promise<void>;\n\t}): Promise<{ cancelled: boolean }>;\n\n\t/** Fork from a specific entry, creating a new session file. */\n\tfork(\n\t\tentryId: string,\n\t\toptions?: { position?: \"before\" | \"at\"; withSession?: (ctx: ReplacedSessionContext) => Promise<void> },\n\t): Promise<{ cancelled: boolean }>;\n\n\t/** Navigate to a different point in the session tree. */\n\tnavigateTree(\n\t\ttargetId: string,\n\t\toptions?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string },\n\t): Promise<{ cancelled: boolean }>;\n\n\t/** Switch to a different session file. */\n\tswitchSession(\n\t\tsessionPath: string,\n\t\toptions?: { withSession?: (ctx: ReplacedSessionContext) => Promise<void> },\n\t): Promise<{ cancelled: boolean }>;\n\n\t/** Reload extensions, skills, prompts, and themes. */\n\treload(): Promise<void>;\n}\n\n/**\n * Fresh command-capable context bound to the replacement session after a session switch.\n *\n * This is passed to `withSession()` callbacks on `newSession()`, `fork()`, and `switchSession()`.\n */\nexport interface ReplacedSessionContext extends ExtensionCommandContext {\n\tsendMessage<T = unknown>(\n\t\tmessage: Pick<CustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">,\n\t\toptions?: SendMessageOptions,\n\t): Promise<void>;\n\n\tsendUserMessage(\n\t\tcontent: string | (TextContent | ImageContent)[],\n\t\toptions?: { deliverAs?: \"steer\" | \"followUp\"; expandPromptTemplates?: boolean },\n\t): Promise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"context-types.js","sourceRoot":"","sources":["../../../src/core/extensions/context-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Api, ImageContent, Model, TextContent } from \"@bastani/pi-ai/compat\";\nimport type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { VerbatimCompactionResult } from \"../compaction/index.ts\";\nimport type { CustomMessage } from \"../messages.ts\";\nimport type { ModelRegistry } from \"../model-registry.ts\";\nimport type { ScopedModel } from \"../model-resolver.ts\";\nimport type { ReadonlySessionManager, SessionManager } from \"../session-manager.ts\";\nimport type { SkillCatalog } from \"../skill-catalog.ts\";\nimport type { BuildSystemPromptOptions } from \"../system-prompt.ts\";\nimport type { WorkflowStageAdmissionBoundary } from \"../workflow-stage-admission.ts\";\nimport type { SendMessageOptions, SendMessagesOptions } from \"./message-types.ts\";\nimport type { ExtensionUIContext } from \"./ui-types.js\";\nimport type { WorkflowActivityObserver, WorkflowActivitySubscription } from \"./workflow-events.js\";\nexport interface ExecuteToolOptions {\n\tsignal?: AbortSignal;\n\tonUpdate?: import(\"@earendil-works/pi-agent-core\").AgentToolUpdateCallback;\n}\n\n/** Tool-only context. Nested calls retain session validation and permission hooks. */\nexport interface ExtensionToolContext extends ExtensionContext {\n\treadonly tools: readonly import(\"@earendil-works/pi-agent-core\").AgentTool[];\n\texecuteTool(\n\t\tname: string,\n\t\targs: unknown,\n\t\toptions?: ExecuteToolOptions,\n\t): Promise<import(\"@earendil-works/pi-agent-core\").AgentToolCallOutcome>;\n}\n\nexport interface ContextUsage {\n\t/** Estimated context tokens, or null if unknown (e.g. right after compaction, before next LLM response). */\n\ttokens: number | null;\n\tcontextWindow: number;\n\t/** Context usage as percentage of context window, or null if tokens is unknown. */\n\tpercent: number | null;\n}\n\nexport interface CompactOptions {\n\t/** Fraction of compactable context to keep. 0.3 is aggressive, 0.7 is light. */\n\tcompression_ratio?: number;\n\t/** Number of recent context-eligible messages to keep uncompressed. */\n\tpreserve_recent?: number;\n\t/** Focus query for relevance-based pruning. Defaults to auto-detected session context. */\n\tquery?: string;\n\tonComplete?: (result: VerbatimCompactionResult) => void;\n\tonError?: (error: Error) => void;\n}\n\n/**\n * Late routes settle as delivery acknowledgements: resolution means the route\n * accepted delivery, while rejection means delivery was not fully accepted. A\n * sequential batch may have delivered a prefix before it rejects; stale-context\n * rejection identifies the dropped route, and other failures reject unchanged.\n */\nexport interface WorkflowStageLateMessageRouter {\n\trouteMessage<T>(\n\t\tmessage: Pick<CustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">,\n\t\toptions?: SendMessageOptions,\n\t): void | Promise<void>;\n\trouteMessages<T>(\n\t\tmessages: Array<Pick<CustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">>,\n\t\toptions?: SendMessagesOptions,\n\t): void | Promise<void>;\n}\n\nexport interface WorkflowStageMessageAdmission {\n\t/** Internal generation-owned boundary shared by every model-fallback session. */\n\treadonly boundary: WorkflowStageAdmissionBoundary;\n\t/** Internal extension state that must survive model-fallback session replacement. */\n\treadonly extensionState: Map<string, object>;\n\tisOpen(): boolean;\n}\n\nexport interface WorkflowPendingStageSender {\n\treadonly id: string;\n\treadonly name?: string;\n\treadonly cwd: string;\n\treadonly model: string;\n\treadonly pid: number;\n\treadonly startedAt: number;\n\treadonly lastActivity: number;\n\treadonly status?: string;\n\treadonly group?: string;\n}\n\nexport interface WorkflowPendingStageMessage {\n\treadonly id: string;\n\treadonly timestamp: number;\n\treadonly replyTo?: string;\n\treadonly expectsReply?: boolean;\n\treadonly replyError?: string;\n\treadonly content: {\n\t\treadonly text: string;\n\t\treadonly attachments?: readonly {\n\t\t\treadonly type: \"file\" | \"snippet\" | \"context\";\n\t\t\treadonly name: string;\n\t\t\treadonly content: string;\n\t\t\treadonly language?: string;\n\t\t}[];\n\t};\n}\n\nexport interface WorkflowPendingStageDelivery {\n\t/** Process-private authority proving this stage belongs to the workflow run route. */\n\treadonly routeCapability: string;\n\tdeliverPending(\n\t\tdeliver: (from: WorkflowPendingStageSender, message: WorkflowPendingStageMessage) => void | Promise<void>,\n\t\trecipient?: { readonly sessionId: string; readonly receivedMessageIds: readonly string[] },\n\t): Promise<void>;\n\tready(sessionId?: string): Promise<void> | undefined;\n\t/**\n\t * Terminal signal from a delivery owner that has run out of recovery: the\n\t * queued messages can no longer be drained, so the stage must fail at its own\n\t * lifecycle boundary rather than run without the instructions it was given.\n\t * Idempotent — the first reason wins, and `ready()` then settles with a\n\t * stage-scoped error instead of waiting for a delivery that will not come.\n\t *\n\t * Required, not optional: `ready()` has no timeout, so a delivery that cannot\n\t * be settled leaves its stage parked forever. Every implementer must be able\n\t * to answer that no delivery is coming.\n\t */\n\tfail(reason: Error): void;\n}\n\nexport interface WorkflowStageOrchestrationContext {\n\treadonly kind: \"workflow-stage\";\n\treadonly workflowRunId: string;\n\treadonly workflowStageId: string;\n\treadonly workflowStageName: string;\n\treadonly constraints: {\n\t\treadonly disableWorkflowTool: true;\n\t};\n\t/** Internal lifecycle seam for surfacing detached results after this stage closes. */\n\treadonly lateMessageRouter?: WorkflowStageLateMessageRouter;\n\t/** Internal synchronous boundary used before producer reply/turn side effects. */\n\treadonly messageAdmission?: WorkflowStageMessageAdmission;\n\t/**\n\t * Resolved per-session intercom home group for this stage. Concrete, already\n\t * normalized upstream. Read by the intercom extension (buildRegistration) and\n\t * inherited by subagents this stage spawns. Absent => no group override.\n\t */\n\treadonly intercomGroup?: string;\n\t/** Durable pre-start intercom delivery, drained by the intercom extension before the first turn. */\n\treadonly pendingStageDelivery?: WorkflowPendingStageDelivery;\n}\n/** Typed child intercom identity and supervisor capability issued at admission. */\nexport interface SubagentIntercomIdentity {\n\treadonly orchestratorTarget: string;\n\treadonly runId: string;\n\treadonly agent: string;\n\treadonly index: number;\n\treadonly sessionName?: string;\n\treadonly supervisor?: {\n\t\treadonly capability: string;\n\t\treadonly supervisorSessionId: string;\n\t};\n}\n\n/** Typed child capability policy supplied by an in-process subagent admission. */\nexport interface SubagentChildPolicy {\n\treadonly managementActions: \"full\" | \"restricted\";\n\treadonly fanoutAuthorized: boolean;\n\treadonly inheritProjectContext: boolean;\n\treadonly inheritSkills: boolean;\n\t/** Host-owned signal fired when this noninteractive execution ends, before disposal. */\n\treadonly executionEnded?: AbortSignal;\n\t/** SDK-owned inbound lifetime; closing drains admitted messages without reopening the task. */\n\treadonly messageAdmission?: {\n\t\tisOpen(): boolean;\n\t\t/** Reserve the full producer operation, including retries, before child settlement. */\n\t\trun(deliver: () => void | Promise<void>): Promise<void>;\n\t};\n\t/** Current admitted in-process nesting depth; absent for top-level sessions. */\n\treadonly depth?: number;\n\t/** SDK-resolved exact child tool allowlist; undefined leaves ordinary tools unrestricted. */\n\treadonly tools?: readonly string[];\n\t/** Server or server/tool selections. Undefined preserves MCP defaults; [] disables selector-based access. */\n\treadonly mcpDirectTools?: readonly string[];\n\t/** Admission-issued identity/capability; never inherited through process environment. */\n\treadonly intercom?: SubagentIntercomIdentity;\n\t/** Resolved intercom group for this admitted child, when one was assigned. */\n\treadonly intercomGroup?: string;\n}\n// Union alias kept for forward-compatible orchestration context variants.\nexport type OrchestrationContext = WorkflowStageOrchestrationContext;\n\n/**\n * Context passed to extension event handlers.\n */\nexport type ExtensionMode = \"tui\" | \"rpc\" | \"json\" | \"print\";\n\nexport interface ExtensionContext {\n\t/** Observe the owning session's workflow activity, starting with an ordered snapshot. */\n\tobserveWorkflowActivity(observer: WorkflowActivityObserver): WorkflowActivitySubscription;\n\t/** Paths of actually loaded extensions, when supplied by the host. */\n\tgetExtensionPaths?(): string[];\n\t/** Internal actual-session binding; never populated from model arguments. */\n\tgetAgentTaskHost?(): import(\"../tasks/agent-adapter.js\").AgentTaskHost;\n\t/** Internal owner-bound defaults and capability ceiling for builtin child adapters. */\n\tgetChildSessionOptions?: import(\"../child-session-options.ts\").ChildSessionOptionsResolver;\n\t/** Session-scoped orchestration policy for child runtimes such as workflow stages. */\n\treadonly orchestrationContext?: OrchestrationContext;\n\t/** Typed capability policy for an in-process subagent child, when this session is one. */\n\treadonly subagentPolicy?: SubagentChildPolicy;\n\t/** UI methods for user interaction */\n\tui: ExtensionUIContext;\n\t/** Current run mode. Use \"tui\" to guard terminal-only UI such as custom components. */\n\tmode: ExtensionMode;\n\t/** Whether dialog-capable UI is available (true in TUI and RPC modes) */\n\thasUI: boolean;\n\t/** Whether a semantic human-input adapter is available, independently of rendering. */\n\thasHumanInput: boolean;\n\t/** Current working directory */\n\tcwd: string;\n\t/** Session manager (read-only) */\n\tsessionManager: ReadonlySessionManager;\n\t/** Model registry for API key resolution */\n\tmodelRegistry: ModelRegistry;\n\t/** Current model (may be undefined) */\n\tmodel: Model<Api> | undefined;\n\t/** Models scoped to this session (resolved from `--models` / `enabledModels`\n\t * settings against the available catalogue). Same set the `/scoped-models`\n\t * command shows. Empty when no scoping is configured (all available models\n\t * are usable). Read-only snapshot, resolved at access time. */\n\tscopedModels: readonly ScopedModel[];\n\t/** Current thinking level, resolved from the active session at access time. */\n\tthinkingLevel?: ThinkingLevel;\n\t/** Session-scoped internal resource router (e.g. artifact:// resolver). */\n\treadonly internalResourceRouter?: import(\"../tools/resource-selectors.ts\").InternalResourceRouter;\n\t/** Whether the agent is idle (not streaming) */\n\tisIdle(): boolean;\n\t/** Whether project-local trust is active for this context. */\n\tisProjectTrusted(): boolean;\n\t/** The current abort signal, or undefined when the agent is not streaming. */\n\tsignal: AbortSignal | undefined;\n\t/** Abort the current agent operation */\n\tabort(): void;\n\t/** Whether there are queued messages waiting */\n\thasPendingMessages(): boolean;\n\t/** Gracefully shutdown pi and exit. Available in all contexts. */\n\tshutdown(): void;\n\t/** Get current context usage for the active model. */\n\tgetContextUsage(): ContextUsage | undefined;\n\t/** Trigger compaction without awaiting completion. */\n\tcompact(options?: CompactOptions): void;\n\t/** Get the current effective system prompt. */\n\tgetSystemPrompt(): string;\n\t/** Current loader-owned skill candidates and exact selector resolver. */\n\tgetSkillCatalog?(): SkillCatalog;\n\t/** Current routing-only inference setting from the owning session. Does not change the chat model. */\n\tgetRouterModel(): string;\n\t/** Provider filters for `model: \"auto\"` candidates from the owning session's settings. */\n\tgetModelRouting?(): import(\"../settings-types.ts\").ModelRoutingSettings;\n}\n\n/**\n * Extended context for command handlers.\n * Includes session control methods only safe in user-initiated commands.\n */\nexport interface ExtensionCommandContext extends ExtensionContext {\n\t/** Get the current base system-prompt construction options. */\n\tgetSystemPromptOptions(): BuildSystemPromptOptions;\n\n\t/** Wait for the agent to finish streaming */\n\twaitForIdle(): Promise<void>;\n\n\t/** Start a new session, optionally with initialization. */\n\tnewSession(options?: {\n\t\tparentSession?: string;\n\t\tsetup?: (sessionManager: SessionManager) => Promise<void>;\n\t\twithSession?: (ctx: ReplacedSessionContext) => Promise<void>;\n\t}): Promise<{ cancelled: boolean }>;\n\n\t/** Fork from a specific entry, creating a new session file. */\n\tfork(\n\t\tentryId: string,\n\t\toptions?: { position?: \"before\" | \"at\"; withSession?: (ctx: ReplacedSessionContext) => Promise<void> },\n\t): Promise<{ cancelled: boolean }>;\n\n\t/** Navigate to a different point in the session tree. */\n\tnavigateTree(\n\t\ttargetId: string,\n\t\toptions?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string },\n\t): Promise<{ cancelled: boolean }>;\n\n\t/** Switch to a different session file. */\n\tswitchSession(\n\t\tsessionPath: string,\n\t\toptions?: { withSession?: (ctx: ReplacedSessionContext) => Promise<void> },\n\t): Promise<{ cancelled: boolean }>;\n\n\t/** Reload extensions, skills, prompts, and themes. */\n\treload(): Promise<void>;\n}\n\n/**\n * Fresh command-capable context bound to the replacement session after a session switch.\n *\n * This is passed to `withSession()` callbacks on `newSession()`, `fork()`, and `switchSession()`.\n */\nexport interface ReplacedSessionContext extends ExtensionCommandContext {\n\tsendMessage<T = unknown>(\n\t\tmessage: Pick<CustomMessage<T>, \"customType\" | \"content\" | \"display\" | \"details\">,\n\t\toptions?: SendMessageOptions,\n\t): Promise<void>;\n\n\tsendUserMessage(\n\t\tcontent: string | (TextContent | ImageContent)[],\n\t\toptions?: { deliverAs?: \"steer\" | \"followUp\"; expandPromptTemplates?: boolean },\n\t): Promise<void>;\n}\n"]}
|
|
@@ -81,7 +81,19 @@ Send material updates through Intercom to every affected workflow stage, includi
|
|
|
81
81
|
|
|
82
82
|
Name and pattern paths remain sticky for every future matching stage until the root terminates. When shared scope or acceptance criteria change, broadcast one authoritative update to `workflow:<rootRunId>/**` (or a narrower path pattern) rather than enumerating stages: `**` reaches every live stage now and every future descendant. A syntactically valid path outside the persisted known set still queues and returns `notInKnownSet`; if it never delivers, root-terminal settlement sends the correlated undeliverable notification. A sticky entry delivered at least once is not reported undeliverable.
|
|
83
83
|
|
|
84
|
-
The
|
|
84
|
+
The `[future]` queued count is the number of retained sticky messages, not the number unread by a particular stage. A message remains queued for later matches after earlier stages receive it. Inspect the per-stage `deliveryStates` in `intercom list` and `workflow({ action: "status", runId: "<rootRunId>" })` to check receipt or why delivery was skipped. `delivered` confirms admission to stage context, not that the model followed the instruction. `receipt-unverified` means only transport delivery or an older receipt is known; inspect the stage transcript before resending.
|
|
85
|
+
|
|
86
|
+
`[delivery]` rows retain per-stage evidence for sticky targets missing from the future-target list, including exact targets after materialization. They do not indicate that a stage is still in the future or currently live. Use the per-stage state to decide what to do; an ended stage without confirmed context admission shows `stage-terminal`, even when transport delivery was acknowledged.
|
|
87
|
+
|
|
88
|
+
| State | What to do |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `queued` | Wait for the matching stage to finish startup. |
|
|
91
|
+
| `session-replaced` | Check startup status. The new session must receive retained context before its first turn. |
|
|
92
|
+
| `delivery-unavailable` | Enable Intercom for that stage and keep it in the workflow invocation group. |
|
|
93
|
+
| `stage-terminal` | Steer a live stage or start separately authorized work; the ended stage cannot consume the update. |
|
|
94
|
+
| `root-unresolved` | Check the reported ownership problem before retrying. Preserve the run ID and diagnostic when reporting it. |
|
|
95
|
+
|
|
96
|
+
The workflows extension persists up to **50 queued messages per target** with workflow state. Messages survive resume/replay and broker restart. Reusing a stage's existing session transcript does not duplicate acknowledged messages; a replacement session with a new transcript receives the retained sticky context again. When a matching stage session initializes, it receives the FIFO entries through the ordinary Intercom inbound path before its first model turn, under the heading **Messages received before you started**, with sender identity and `Sent:` timestamps visible separately from the task prompt.
|
|
85
97
|
|
|
86
98
|
Only a workflow invocation member with eligible invocation-control authority can queue to its invocation-owned stages; this includes a main-chat session that explicitly joined `workflow:<rootRunId>`. Subgroup peers and another root run remain refused even if they add that membership. An explicit stage `group: "default"` is a shared-group escape, is not workflow-owned, and does not receive pending invocation delivery. An ineligible attempt is refused with `Target workflow run is in a different intercom group`. The 51st queued message is refused with `Pending stage message queue is full (limit 50)` rather than evicting an earlier entry.
|
|
87
99
|
|
|
@@ -35,6 +35,8 @@ intercom({
|
|
|
35
35
|
|
|
36
36
|
Send material updates through Intercom to every affected workflow stage, including stages that have not started. Name and pattern sends remain sticky for every future matching stage until root termination. When shared scope or acceptance criteria change, broadcast one authoritative update to `workflow:<rootRunId>/**` (or a narrower path pattern) rather than enumerating stages; live matches receive it immediately and future descendants receive it before their first model turn. A syntactically valid path outside the persisted known set queues with a `notInKnownSet` warning and settles undeliverable at terminal only if never delivered; an entry delivered at least once is not reported undeliverable. Use `ask` once the stage session is live and can reply.
|
|
37
37
|
|
|
38
|
+
To verify a sticky update, inspect its per-stage `deliveryStates` in `intercom list` or `workflow({ action: "status", runId: "<rootRunId>" })`. The future target's queued count includes messages retained for stages that have not started yet, even after delivery to earlier stages. It is not an unread count or proof of receipt by every stage. `delivered` confirms admission to stage context, not compliance with the update. A transport-only or older receipt appears as `receipt-unverified`; check the stage transcript before resending. See [pending delivery states](/intercom/reference#deferred-delivery-to-pending-stages) for skip reasons and recovery.
|
|
39
|
+
|
|
38
40
|
### Reading and scrolling the panel
|
|
39
41
|
|
|
40
42
|
At 80 columns and wider, each `BACKGROUND` card shows the full run identity, mode, progress, live-tool details, and elapsed/status metadata. Remaining row space may show pending stages. Each target appears exactly or is replaced by a `stage`-labeled canonical ID; `… N more` counts omitted stages. If neither form fits, the pending label is omitted rather than displacing existing metadata. Tool nodes are read-only durable graph nodes, not attachable stage chats.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.26-alpha.
|
|
3
|
+
"version": "0.9.26-alpha.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@bastani/atomic",
|
|
9
|
-
"version": "0.9.26-alpha.
|
|
9
|
+
"version": "0.9.26-alpha.4",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@bastani/atomic-natives": "0.9.26-alpha.
|
|
13
|
-
"@bastani/pi-ai": "0.9.26-alpha.
|
|
12
|
+
"@bastani/atomic-natives": "0.9.26-alpha.4",
|
|
13
|
+
"@bastani/pi-ai": "0.9.26-alpha.4",
|
|
14
14
|
"@dbos-inc/dbos-sdk": "4.25.14",
|
|
15
15
|
"@earendil-works/pi-agent-core": "1.0.0",
|
|
16
16
|
"@earendil-works/pi-client": "1.0.0",
|
|
@@ -432,18 +432,18 @@
|
|
|
432
432
|
}
|
|
433
433
|
},
|
|
434
434
|
"node_modules/@bastani/atomic-natives": {
|
|
435
|
-
"version": "0.9.26-alpha.
|
|
436
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.26-alpha.
|
|
435
|
+
"version": "0.9.26-alpha.4",
|
|
436
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.26-alpha.4.tgz",
|
|
437
437
|
"license": "MIT",
|
|
438
438
|
"optionalDependencies": {
|
|
439
|
-
"@bastani/atomic-natives-darwin-arm64": "0.9.26-alpha.
|
|
440
|
-
"@bastani/atomic-natives-darwin-x64": "0.9.26-alpha.
|
|
441
|
-
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.26-alpha.
|
|
442
|
-
"@bastani/atomic-natives-linux-arm64-musl": "0.9.26-alpha.
|
|
443
|
-
"@bastani/atomic-natives-linux-x64-gnu": "0.9.26-alpha.
|
|
444
|
-
"@bastani/atomic-natives-linux-x64-musl": "0.9.26-alpha.
|
|
445
|
-
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.26-alpha.
|
|
446
|
-
"@bastani/atomic-natives-win32-x64-msvc": "0.9.26-alpha.
|
|
439
|
+
"@bastani/atomic-natives-darwin-arm64": "0.9.26-alpha.4",
|
|
440
|
+
"@bastani/atomic-natives-darwin-x64": "0.9.26-alpha.4",
|
|
441
|
+
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.26-alpha.4",
|
|
442
|
+
"@bastani/atomic-natives-linux-arm64-musl": "0.9.26-alpha.4",
|
|
443
|
+
"@bastani/atomic-natives-linux-x64-gnu": "0.9.26-alpha.4",
|
|
444
|
+
"@bastani/atomic-natives-linux-x64-musl": "0.9.26-alpha.4",
|
|
445
|
+
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.26-alpha.4",
|
|
446
|
+
"@bastani/atomic-natives-win32-x64-msvc": "0.9.26-alpha.4"
|
|
447
447
|
},
|
|
448
448
|
"engines": {
|
|
449
449
|
"bun": ">=1.4.2",
|
|
@@ -451,8 +451,8 @@
|
|
|
451
451
|
}
|
|
452
452
|
},
|
|
453
453
|
"node_modules/@bastani/atomic-natives-darwin-arm64": {
|
|
454
|
-
"version": "0.9.26-alpha.
|
|
455
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.26-alpha.
|
|
454
|
+
"version": "0.9.26-alpha.4",
|
|
455
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.26-alpha.4.tgz",
|
|
456
456
|
"license": "MIT",
|
|
457
457
|
"os": [
|
|
458
458
|
"darwin"
|
|
@@ -463,8 +463,8 @@
|
|
|
463
463
|
"optional": true
|
|
464
464
|
},
|
|
465
465
|
"node_modules/@bastani/atomic-natives-darwin-x64": {
|
|
466
|
-
"version": "0.9.26-alpha.
|
|
467
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.26-alpha.
|
|
466
|
+
"version": "0.9.26-alpha.4",
|
|
467
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.26-alpha.4.tgz",
|
|
468
468
|
"license": "MIT",
|
|
469
469
|
"os": [
|
|
470
470
|
"darwin"
|
|
@@ -475,8 +475,8 @@
|
|
|
475
475
|
"optional": true
|
|
476
476
|
},
|
|
477
477
|
"node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
|
|
478
|
-
"version": "0.9.26-alpha.
|
|
479
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.26-alpha.
|
|
478
|
+
"version": "0.9.26-alpha.4",
|
|
479
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.26-alpha.4.tgz",
|
|
480
480
|
"license": "MIT",
|
|
481
481
|
"os": [
|
|
482
482
|
"linux"
|
|
@@ -490,8 +490,8 @@
|
|
|
490
490
|
"optional": true
|
|
491
491
|
},
|
|
492
492
|
"node_modules/@bastani/atomic-natives-linux-arm64-musl": {
|
|
493
|
-
"version": "0.9.26-alpha.
|
|
494
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.26-alpha.
|
|
493
|
+
"version": "0.9.26-alpha.4",
|
|
494
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.26-alpha.4.tgz",
|
|
495
495
|
"license": "MIT",
|
|
496
496
|
"os": [
|
|
497
497
|
"linux"
|
|
@@ -505,8 +505,8 @@
|
|
|
505
505
|
"optional": true
|
|
506
506
|
},
|
|
507
507
|
"node_modules/@bastani/atomic-natives-linux-x64-gnu": {
|
|
508
|
-
"version": "0.9.26-alpha.
|
|
509
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.26-alpha.
|
|
508
|
+
"version": "0.9.26-alpha.4",
|
|
509
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.26-alpha.4.tgz",
|
|
510
510
|
"license": "MIT",
|
|
511
511
|
"os": [
|
|
512
512
|
"linux"
|
|
@@ -520,8 +520,8 @@
|
|
|
520
520
|
"optional": true
|
|
521
521
|
},
|
|
522
522
|
"node_modules/@bastani/atomic-natives-linux-x64-musl": {
|
|
523
|
-
"version": "0.9.26-alpha.
|
|
524
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.26-alpha.
|
|
523
|
+
"version": "0.9.26-alpha.4",
|
|
524
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.26-alpha.4.tgz",
|
|
525
525
|
"license": "MIT",
|
|
526
526
|
"os": [
|
|
527
527
|
"linux"
|
|
@@ -535,8 +535,8 @@
|
|
|
535
535
|
"optional": true
|
|
536
536
|
},
|
|
537
537
|
"node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
|
|
538
|
-
"version": "0.9.26-alpha.
|
|
539
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.26-alpha.
|
|
538
|
+
"version": "0.9.26-alpha.4",
|
|
539
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.26-alpha.4.tgz",
|
|
540
540
|
"license": "MIT",
|
|
541
541
|
"os": [
|
|
542
542
|
"win32"
|
|
@@ -547,8 +547,8 @@
|
|
|
547
547
|
"optional": true
|
|
548
548
|
},
|
|
549
549
|
"node_modules/@bastani/atomic-natives-win32-x64-msvc": {
|
|
550
|
-
"version": "0.9.26-alpha.
|
|
551
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.26-alpha.
|
|
550
|
+
"version": "0.9.26-alpha.4",
|
|
551
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.26-alpha.4.tgz",
|
|
552
552
|
"license": "MIT",
|
|
553
553
|
"os": [
|
|
554
554
|
"win32"
|
|
@@ -559,8 +559,8 @@
|
|
|
559
559
|
"optional": true
|
|
560
560
|
},
|
|
561
561
|
"node_modules/@bastani/pi-ai": {
|
|
562
|
-
"version": "0.9.26-alpha.
|
|
563
|
-
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.26-alpha.
|
|
562
|
+
"version": "0.9.26-alpha.4",
|
|
563
|
+
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.26-alpha.4.tgz",
|
|
564
564
|
"license": "MIT",
|
|
565
565
|
"dependencies": {
|
|
566
566
|
"@anthropic-ai/sdk": "0.129.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.26-alpha.
|
|
3
|
+
"version": "0.9.26-alpha.4",
|
|
4
4
|
"description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"atomicConfig": {
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@bastani/atomic-natives": "0.9.26-alpha.
|
|
84
|
-
"@bastani/pi-ai": "0.9.26-alpha.
|
|
83
|
+
"@bastani/atomic-natives": "0.9.26-alpha.4",
|
|
84
|
+
"@bastani/pi-ai": "0.9.26-alpha.4",
|
|
85
85
|
"@dbos-inc/dbos-sdk": "4.25.14",
|
|
86
86
|
"@earendil-works/pi-agent-core": "1.0.0",
|
|
87
87
|
"@earendil-works/pi-client": "1.0.0",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"@types/proper-lockfile": "4.1.4",
|
|
139
139
|
"@types/semver": "7.7.1",
|
|
140
140
|
"ajv": "8.20.0",
|
|
141
|
-
"shx": "0.4
|
|
141
|
+
"shx": "0.3.4",
|
|
142
142
|
"typescript": "7.0.2",
|
|
143
143
|
"vitest": "4.1.11"
|
|
144
144
|
},
|