@moxxy/sdk 0.8.1 → 0.9.0
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/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/session-like.d.ts +32 -0
- package/dist/session-like.d.ts.map +1 -1
- package/dist/subagent.d.ts +15 -0
- package/dist/subagent.d.ts.map +1 -1
- package/dist/tunnel.d.ts +31 -7
- package/dist/tunnel.d.ts.map +1 -1
- package/dist/tunnel.js +153 -1
- package/dist/tunnel.js.map +1 -1
- package/dist/workflow.d.ts +73 -6
- package/dist/workflow.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +18 -1
- package/src/session-like.ts +29 -0
- package/src/subagent.ts +16 -0
- package/src/tunnel.test.ts +78 -0
- package/src/tunnel.ts +172 -0
- package/src/workflow.ts +82 -5
package/dist/index.d.ts
CHANGED
|
@@ -2,18 +2,19 @@ export type { EventId, TurnId, ToolCallId, SessionId, PluginId, SkillId, } from
|
|
|
2
2
|
export { asEventId, asTurnId, asToolCallId, asSessionId, asPluginId, asSkillId } from './ids.js';
|
|
3
3
|
export type { EventBase, EventSource, MoxxyEvent, MoxxyEventType, MoxxyEventOfType, EmittedEvent, UserPromptEvent, UserPromptAttachment, AssistantChunkEvent, AssistantMessageEvent, ToolCallRequestedEvent, ToolCallApprovedEvent, ToolCallDeniedEvent, ToolResultEvent, SkillInvokedEvent, SkillCreatedEvent, PluginRegisteredEvent, PluginUnregisteredEvent, ModeIterationEvent, CompactionEvent, ProviderRequestEvent, ProviderResponseEvent, ErrorEvent, AbortEvent, PluginEvent, } from './events.js';
|
|
4
4
|
export type { EventLogReader } from './log.js';
|
|
5
|
-
export type { RunTurnOptions, SessionLogReader, SessionLike, SessionInfo, ProviderInfo, ToolInfo, SkillInfo, CommandInfo, CredentialResolver, McpAdminView, McpServerStatusView, WorkflowsView, WorkflowSummaryView, WorkflowRunView, PluginsAdminView, InstallablePluginView, LoadedPluginView, } from './session-like.js';
|
|
5
|
+
export type { RunTurnOptions, SessionLogReader, SessionLike, SessionInfo, ProviderInfo, ToolInfo, SkillInfo, CommandInfo, CredentialResolver, McpAdminView, McpServerStatusView, WorkflowsView, WorkflowSummaryView, WorkflowRunView, WorkflowValidateView, WorkflowSaveView, PluginsAdminView, InstallablePluginView, LoadedPluginView, } from './session-like.js';
|
|
6
6
|
export type { ClientSession, ProvidersClientView, ModesClientView, ToolsClientView, CommandsClientView, SkillsClientView, AgentsClientView, TranscribersClientView, SynthesizersClientView, RequirementsClientView, PermissionsClientView, } from './client-session.js';
|
|
7
7
|
export type { PermissionMode, PermissionDecision, PermissionRule, PendingToolCall, PermissionContext, PermissionResolver, } from './permission.js';
|
|
8
8
|
export type { ToolContext, ToolDef, ToolCompactPresentation, BrokeredFs, BrokeredStat, BrokeredFetch, BrokeredFetchInit, BrokeredFetchResponse, BrokeredExec, BrokeredExecOpts, BrokeredExecResult, } from './tool.js';
|
|
9
9
|
export type { FsCapability, NetCapability, CapabilitySpec, IsolationStrength, ToolIsolationSpec, IsolatedToolCall, Isolator, HandlerModuleRef, } from './isolation.js';
|
|
10
10
|
export { ISOLATION_RANK } from './isolation.js';
|
|
11
|
-
export type { SubagentSpec, SubagentResult, SubagentSpawner, } from './subagent.js';
|
|
11
|
+
export type { SubagentSpec, SubagentResult, SubagentSpawner, SubagentContinueArgs, } from './subagent.js';
|
|
12
12
|
export type { ContentBlock, ProviderMessage, ProviderRequest, ProviderEvent, CacheHint, TokenUsage, ModelDescriptor, LLMProvider, ProviderDef, ProviderKeyValidation, ProviderVault, ProviderAuthContext, ProviderOAuthResult, ProviderOAuthStatus, ProviderAuthDescriptor, } from './provider.js';
|
|
13
13
|
export type { CacheStrategyDef, CacheStrategyContext } from './cache-strategy.js';
|
|
14
14
|
export type { ViewNode, ViewAction, ViewDoc, ViewParseError, ViewParseResult, AttrType, AttrSpec, ViewTagSpec, ViewRendererDef, } from './view-renderer.js';
|
|
15
15
|
export { VIEW_PRIMITIVES, VIEW_COMPONENTS, DEFAULT_VIEW_TAGS, isSafeViewUrl } from './view-renderer.js';
|
|
16
|
-
export type { TunnelProviderDef, TunnelHandle, TunnelOpenOptions } from './tunnel.js';
|
|
16
|
+
export type { TunnelProviderDef, TunnelHandle, TunnelOpenOptions, SpawnCliTunnelOptions, CliTunnelHandle, } from './tunnel.js';
|
|
17
|
+
export { spawnCliTunnel, isCliTunnelAvailable } from './tunnel.js';
|
|
17
18
|
export { isRetryableError, toFriendlyError, zodToJsonSchema, estimateTextTokens, type StopReason } from './provider-utils.js';
|
|
18
19
|
export { writeFileAtomic, moxxyHome, moxxyPath, type WriteFileAtomicOptions } from './fs-utils.js';
|
|
19
20
|
export { createMutex, type Mutex } from './mutex.js';
|
|
@@ -30,7 +31,7 @@ export { computeElisionState, toolResultStub, conversationalStub, toolResultByte
|
|
|
30
31
|
export { applyLazyTools, buildToolIndex, loadedToolNames, ALWAYS_ON_TOOLS, type GatedTools, } from './tool-gating.js';
|
|
31
32
|
export { summarizeSessionTokens, summarizeSessionTokensFromEvents, summarizeTokensByModel, addModelTotals, usageEventFields, type SessionTokenSummary, type ModelUsageTotals, } from './token-accounting.js';
|
|
32
33
|
export type { Skill, SkillDef, SkillFrontmatter, SkillScope, SkillSchedule } from './skill.js';
|
|
33
|
-
export type { Workflow, WorkflowStep, WorkflowTrigger, WorkflowStepErrorMode, WorkflowInputSpec, WorkflowDelivery, WorkflowToolRunner, WorkflowLookup, WorkflowEventSubtype, WorkflowRunDeps, WorkflowStepStatus, WorkflowStepResult, WorkflowRunResult, WorkflowExecutorDef, } from './workflow.js';
|
|
34
|
+
export type { Workflow, WorkflowStep, WorkflowLoopAction, WorkflowTrigger, WorkflowStepErrorMode, WorkflowLogicStepFormat, WorkflowInputSpec, WorkflowDelivery, WorkflowUi, WorkflowUiLayout, WorkflowUiLayoutNode, WorkflowUiViewport, WorkflowToolRunner, WorkflowLookup, WorkflowEventSubtype, WorkflowRunDeps, WorkflowStepStatus, WorkflowRunStatus, WorkflowStepResult, WorkflowRunResult, WorkflowExecutorDef, } from './workflow.js';
|
|
34
35
|
export type { AgentDef } from './agent.js';
|
|
35
36
|
export type { CommandDef, CommandContext, CommandOutput, CommandHandlerResult, } from './command.js';
|
|
36
37
|
export type { ToolRegistry, SkillRegistry, PluginHostHandle, ModeContext, ModeDef, ModeBadge, ElisionSettings, ApprovalResolver, ApprovalRequest, ApprovalDecision, ApprovalOption, } from './mode.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,QAAQ,EACR,OAAO,GACR,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEjG,YAAY,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,UAAU,EACV,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,WAAW,EACX,OAAO,EACP,uBAAuB,EACvB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,YAAY,EACV,YAAY,EACZ,cAAc,EACd,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,QAAQ,EACR,OAAO,GACR,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEjG,YAAY,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,sBA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AAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,WAAW,EACX,cAAc,EACd,wBAAwB,EACxB,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,QAAQ,EAAE,OAAO,aAAa,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,aAAa,EAAE,MAAM,CAAC,CAAC;CACrG;AAED,OAAO,EACL,YAAY,EACZ,UAAU,EACV,cAAc,EACd,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,WAAW,EACX,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { asEventId, asTurnId, asToolCallId, asSessionId, asPluginId, asSkillId } from './ids.js';
|
|
2
2
|
export { ISOLATION_RANK } from './isolation.js';
|
|
3
3
|
export { VIEW_PRIMITIVES, VIEW_COMPONENTS, DEFAULT_VIEW_TAGS, isSafeViewUrl } from './view-renderer.js';
|
|
4
|
+
export { spawnCliTunnel, isCliTunnelAvailable } from './tunnel.js';
|
|
4
5
|
export { isRetryableError, toFriendlyError, zodToJsonSchema, estimateTextTokens } from './provider-utils.js';
|
|
5
6
|
export { writeFileAtomic, moxxyHome, moxxyPath } from './fs-utils.js';
|
|
6
7
|
export { createMutex } from './mutex.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAqGjG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAuChD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQxG,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAmB,MAAM,qBAAqB,CAAC;AAC9H,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAA+B,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,E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B,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,WAAW,EACX,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,GAIlB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,cAAc,GAGf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}
|
package/dist/session-like.d.ts
CHANGED
|
@@ -157,16 +157,48 @@ export interface WorkflowRunView {
|
|
|
157
157
|
readonly error?: string;
|
|
158
158
|
}>;
|
|
159
159
|
}
|
|
160
|
+
/** Validation result for a draft YAML — backs the visual builder (phase 2). */
|
|
161
|
+
export interface WorkflowValidateView {
|
|
162
|
+
readonly ok: boolean;
|
|
163
|
+
/** One readable line per issue; empty when `ok`. */
|
|
164
|
+
readonly errors: ReadonlyArray<string>;
|
|
165
|
+
}
|
|
166
|
+
/** Result of persisting a workflow from the builder. */
|
|
167
|
+
export interface WorkflowSaveView {
|
|
168
|
+
readonly name: string;
|
|
169
|
+
readonly scope: string;
|
|
170
|
+
readonly path: string;
|
|
171
|
+
}
|
|
160
172
|
/**
|
|
161
173
|
* The slice of the workflows API a channel needs to drive the `/workflows`
|
|
162
174
|
* modal (list, enable/disable toggle, run). Present on a local Session when
|
|
163
175
|
* `@moxxy/plugin-workflows` is wired; a `RemoteSession` leaves
|
|
164
176
|
* {@link SessionLike.workflows} undefined and the UI degrades gracefully.
|
|
177
|
+
*
|
|
178
|
+
* `validateDraft` / `save` / `getRun` back the upcoming visual workflow
|
|
179
|
+
* builder (phase 2); they are optional so older hosts and remote sessions
|
|
180
|
+
* stay capability-detectable — a channel must feature-check before calling.
|
|
165
181
|
*/
|
|
166
182
|
export interface WorkflowsView {
|
|
167
183
|
list(): Promise<ReadonlyArray<WorkflowSummaryView>>;
|
|
168
184
|
setEnabled(name: string, enabled: boolean): Promise<void>;
|
|
169
185
|
run(name: string): Promise<WorkflowRunView>;
|
|
186
|
+
/** Parse + validate a draft YAML without saving it. */
|
|
187
|
+
validateDraft?(yaml: string): Promise<WorkflowValidateView>;
|
|
188
|
+
/**
|
|
189
|
+
* Persist a workflow from full YAML (create or overwrite). `previousName`
|
|
190
|
+
* (the name the builder loaded) supports rename: when it differs from the
|
|
191
|
+
* YAML's name, the old file + registry entry are removed so a rename doesn't
|
|
192
|
+
* leave an orphaned duplicate.
|
|
193
|
+
*/
|
|
194
|
+
save?(yaml: string, previousName?: string): Promise<WorkflowSaveView>;
|
|
195
|
+
/** Fetch one saved workflow's canonical YAML + on-disk metadata. */
|
|
196
|
+
getRun?(name: string): Promise<{
|
|
197
|
+
readonly name: string;
|
|
198
|
+
readonly scope: string;
|
|
199
|
+
readonly path: string;
|
|
200
|
+
readonly yaml: string;
|
|
201
|
+
} | null>;
|
|
170
202
|
}
|
|
171
203
|
/** One installable plugin in {@link PluginsAdminView.catalog}. */
|
|
172
204
|
export interface InstallablePluginView {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-like.d.ts","sourceRoot":"","sources":["../src/session-like.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,cAAc;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AsD;IACtD,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,6DAA6D;IAC7D,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC"}
|
package/dist/subagent.d.ts
CHANGED
|
@@ -24,6 +24,17 @@ export interface SubagentSpec {
|
|
|
24
24
|
readonly allowedTools?: ReadonlyArray<string>;
|
|
25
25
|
/** Human-readable label surfaced in `subagent_*` event payloads. */
|
|
26
26
|
readonly label?: string;
|
|
27
|
+
/**
|
|
28
|
+
* When true, the child session stays alive after the first turn for
|
|
29
|
+
* {@link SubagentSpawner.continue}. `subagent_completed` is deferred until
|
|
30
|
+
* continue or release. Used by the workflow `awaitInput` pause/resume flow.
|
|
31
|
+
*/
|
|
32
|
+
readonly retainSession?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface SubagentContinueArgs {
|
|
35
|
+
readonly childSessionId: SessionId;
|
|
36
|
+
readonly prompt: string;
|
|
37
|
+
readonly label?: string;
|
|
27
38
|
}
|
|
28
39
|
export interface SubagentResult {
|
|
29
40
|
readonly label: string;
|
|
@@ -41,5 +52,9 @@ export interface SubagentSpawner {
|
|
|
41
52
|
spawn(spec: SubagentSpec): Promise<SubagentResult>;
|
|
42
53
|
/** Run N children in parallel; resolves with results in input order. */
|
|
43
54
|
spawnAll(specs: ReadonlyArray<SubagentSpec>): Promise<ReadonlyArray<SubagentResult>>;
|
|
55
|
+
/** Append a user turn and run a retained child again (requires `retainSession`). */
|
|
56
|
+
continue?(args: SubagentContinueArgs): Promise<SubagentResult>;
|
|
57
|
+
/** Drop a retained session without completing it. */
|
|
58
|
+
release?(childSessionId: SessionId): void;
|
|
44
59
|
}
|
|
45
60
|
//# sourceMappingURL=subagent.d.ts.map
|
package/dist/subagent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent.d.ts","sourceRoot":"","sources":["../src/subagent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS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IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACnD,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;IACrF,oFAAoF;IACpF,QAAQ,CAAC,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/D,qDAAqD;IACrD,OAAO,CAAC,CAAC,cAAc,EAAE,SAAS,GAAG,IAAI,CAAC;CAC3C"}
|
package/dist/tunnel.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A swappable way to expose a locally-bound surface (the web channel) to the
|
|
3
|
-
* user over the public internet — so an agent on Telegram/TUI can hand the user
|
|
4
|
-
* a URL they can open. One provider is active per session (registered via
|
|
5
|
-
* plugins, like every other block); core seeds a `localhost` no-op provider so
|
|
6
|
-
* `getActive()` is non-null.
|
|
7
|
-
*/
|
|
8
1
|
export interface TunnelOpenOptions {
|
|
9
2
|
readonly port: number;
|
|
10
3
|
readonly host: string;
|
|
@@ -22,4 +15,35 @@ export interface TunnelProviderDef {
|
|
|
22
15
|
/** Optional readiness gate (e.g. the `cloudflared` binary is installed). */
|
|
23
16
|
isAvailable?(): Promise<boolean>;
|
|
24
17
|
}
|
|
18
|
+
export interface SpawnCliTunnelOptions {
|
|
19
|
+
/** Executable to spawn (e.g. `cloudflared`, `ngrok`). */
|
|
20
|
+
readonly cmd: string;
|
|
21
|
+
/** Arguments passed to the executable. */
|
|
22
|
+
readonly args: ReadonlyArray<string>;
|
|
23
|
+
/** Matches the assigned public URL in a chunk of the CLI's stdout/stderr. */
|
|
24
|
+
readonly urlRegex: RegExp;
|
|
25
|
+
/** How long to wait for the URL before giving up. Default 30s. */
|
|
26
|
+
readonly timeoutMs?: number;
|
|
27
|
+
/** Human-readable name used in error messages. Defaults to `cmd`. */
|
|
28
|
+
readonly name?: string;
|
|
29
|
+
}
|
|
30
|
+
/** A spawned CLI tunnel: the public-URL handle plus the child's pid. */
|
|
31
|
+
export interface CliTunnelHandle extends TunnelHandle {
|
|
32
|
+
/** Spawned process id (-1 if the platform didn't assign one). */
|
|
33
|
+
readonly pid: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Spawn a CLI tunnel, parse the assigned public URL out of its output, and
|
|
37
|
+
* resolve a {@link CliTunnelHandle}. The child is tracked so it is killed on
|
|
38
|
+
* `close()`, on tunnel-switch, and on process exit (no orphans). Rejects on
|
|
39
|
+
* timeout, spawn error, or premature exit (the child is killed in every reject
|
|
40
|
+
* path). This is the single spawn-and-parse implementation behind the
|
|
41
|
+
* cloudflared/ngrok tunnel providers and the webhooks tunnel.
|
|
42
|
+
*/
|
|
43
|
+
export declare function spawnCliTunnel(opts: SpawnCliTunnelOptions): Promise<CliTunnelHandle>;
|
|
44
|
+
/**
|
|
45
|
+
* Probe whether a tunnel CLI is installed and runnable (`<cmd> --version`
|
|
46
|
+
* exits 0). Used as the `isAvailable()` gate by CLI-backed tunnel providers.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isCliTunnelAvailable(cmd: string): Promise<boolean>;
|
|
25
49
|
//# sourceMappingURL=tunnel.d.ts.map
|
package/dist/tunnel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../src/tunnel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../src/tunnel.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mFAAmF;IACnF,IAAI,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACrD,4EAA4E;IAC5E,WAAW,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAClC;AA2ED,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wEAAwE;AACxE,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,iEAAiE;IACjE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAID;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAsDpF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMlE"}
|
package/dist/tunnel.js
CHANGED
|
@@ -1,2 +1,154 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A swappable way to expose a locally-bound surface (the web channel) to the
|
|
3
|
+
* user over the public internet — so an agent on Telegram/TUI can hand the user
|
|
4
|
+
* a URL they can open. One provider is active per session (registered via
|
|
5
|
+
* plugins, like every other block); core seeds a `localhost` no-op provider so
|
|
6
|
+
* `getActive()` is non-null.
|
|
7
|
+
*/
|
|
8
|
+
import { spawn } from 'node:child_process';
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
// Shared CLI-tunnel subprocess management
|
|
11
|
+
//
|
|
12
|
+
// cloudflared/ngrok (channel-web) and the webhooks tunnel all do the same
|
|
13
|
+
// thing: spawn a CLI, watch its stdout/stderr for the assigned public URL,
|
|
14
|
+
// resolve once it's seen (or reject on timeout/exit/error), and guarantee the
|
|
15
|
+
// child is killed on close *and* on process exit (Node does not reap children).
|
|
16
|
+
// `spawnCliTunnel` is the single implementation they all share.
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
/**
|
|
19
|
+
* Guarantees spawned tunnel children (cloudflared/ngrok/…) never orphan or
|
|
20
|
+
* leak. Node does NOT kill child processes when the parent exits, so we track
|
|
21
|
+
* every live child and kill any survivors on process teardown — in addition to
|
|
22
|
+
* the explicit `close()` path. Each tracked child is also force-killed
|
|
23
|
+
* (SIGKILL) if it ignores SIGTERM, so a wedged tunnel can't drain
|
|
24
|
+
* memory/handles.
|
|
25
|
+
*/
|
|
26
|
+
const liveChildren = new Set();
|
|
27
|
+
let exitHookInstalled = false;
|
|
28
|
+
function killChild(child) {
|
|
29
|
+
if (child.exitCode != null || child.signalCode != null)
|
|
30
|
+
return;
|
|
31
|
+
try {
|
|
32
|
+
child.kill('SIGTERM');
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
/* already gone */
|
|
36
|
+
}
|
|
37
|
+
// Escalate if it doesn't exit promptly. unref so this timer never holds the
|
|
38
|
+
// event loop open on its own.
|
|
39
|
+
const t = setTimeout(() => {
|
|
40
|
+
try {
|
|
41
|
+
child.kill('SIGKILL');
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
/* gone */
|
|
45
|
+
}
|
|
46
|
+
}, 2000);
|
|
47
|
+
t.unref?.();
|
|
48
|
+
child.once('exit', () => clearTimeout(t));
|
|
49
|
+
}
|
|
50
|
+
function ensureExitHook() {
|
|
51
|
+
if (exitHookInstalled)
|
|
52
|
+
return;
|
|
53
|
+
exitHookInstalled = true;
|
|
54
|
+
const killAll = () => {
|
|
55
|
+
for (const child of liveChildren) {
|
|
56
|
+
try {
|
|
57
|
+
child.kill('SIGKILL'); // process is exiting; be decisive, no async escalation
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
/* gone */
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
liveChildren.clear();
|
|
64
|
+
};
|
|
65
|
+
process.once('exit', killAll);
|
|
66
|
+
process.once('SIGINT', killAll);
|
|
67
|
+
process.once('SIGTERM', killAll);
|
|
68
|
+
}
|
|
69
|
+
/** Track a spawned child; returns an `untrack()` that also kills it cleanly. */
|
|
70
|
+
function trackChild(child) {
|
|
71
|
+
ensureExitHook();
|
|
72
|
+
liveChildren.add(child);
|
|
73
|
+
child.once('exit', () => liveChildren.delete(child));
|
|
74
|
+
return () => new Promise((resolve) => {
|
|
75
|
+
liveChildren.delete(child);
|
|
76
|
+
if (child.exitCode != null || child.signalCode != null)
|
|
77
|
+
return resolve();
|
|
78
|
+
child.once('exit', () => resolve());
|
|
79
|
+
killChild(child);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const DEFAULT_TUNNEL_URL_TIMEOUT_MS = 30_000;
|
|
83
|
+
/**
|
|
84
|
+
* Spawn a CLI tunnel, parse the assigned public URL out of its output, and
|
|
85
|
+
* resolve a {@link CliTunnelHandle}. The child is tracked so it is killed on
|
|
86
|
+
* `close()`, on tunnel-switch, and on process exit (no orphans). Rejects on
|
|
87
|
+
* timeout, spawn error, or premature exit (the child is killed in every reject
|
|
88
|
+
* path). This is the single spawn-and-parse implementation behind the
|
|
89
|
+
* cloudflared/ngrok tunnel providers and the webhooks tunnel.
|
|
90
|
+
*/
|
|
91
|
+
export function spawnCliTunnel(opts) {
|
|
92
|
+
const { cmd, args, urlRegex } = opts;
|
|
93
|
+
const name = opts.name ?? cmd;
|
|
94
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULT_TUNNEL_URL_TIMEOUT_MS;
|
|
95
|
+
return new Promise((resolve, reject) => {
|
|
96
|
+
let child;
|
|
97
|
+
try {
|
|
98
|
+
child = spawn(cmd, args, { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
reject(new Error(`failed to spawn ${name} — is it installed? (${err instanceof Error ? err.message : String(err)})`));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const untrack = trackChild(child);
|
|
105
|
+
let settled = false;
|
|
106
|
+
const timer = setTimeout(() => {
|
|
107
|
+
if (settled)
|
|
108
|
+
return;
|
|
109
|
+
settled = true;
|
|
110
|
+
void untrack();
|
|
111
|
+
reject(new Error(`${name}: timed out after ${timeoutMs}ms waiting for the tunnel URL`));
|
|
112
|
+
}, timeoutMs);
|
|
113
|
+
timer.unref?.();
|
|
114
|
+
const onData = (buf) => {
|
|
115
|
+
if (settled)
|
|
116
|
+
return; // drain quietly once resolved so the pipe never fills
|
|
117
|
+
const url = urlRegex.exec(buf.toString('utf8'))?.[0] ?? null;
|
|
118
|
+
if (!url)
|
|
119
|
+
return;
|
|
120
|
+
settled = true;
|
|
121
|
+
clearTimeout(timer);
|
|
122
|
+
resolve({ url, pid: child.pid ?? -1, close: untrack });
|
|
123
|
+
};
|
|
124
|
+
child.stdout?.on('data', onData);
|
|
125
|
+
child.stderr?.on('data', onData);
|
|
126
|
+
child.on('error', (err) => {
|
|
127
|
+
if (settled)
|
|
128
|
+
return;
|
|
129
|
+
settled = true;
|
|
130
|
+
clearTimeout(timer);
|
|
131
|
+
void untrack();
|
|
132
|
+
reject(err);
|
|
133
|
+
});
|
|
134
|
+
child.on('exit', (code) => {
|
|
135
|
+
if (settled)
|
|
136
|
+
return;
|
|
137
|
+
settled = true;
|
|
138
|
+
clearTimeout(timer);
|
|
139
|
+
reject(new Error(`${name} exited (code ${code ?? 'null'}) before emitting a URL`));
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Probe whether a tunnel CLI is installed and runnable (`<cmd> --version`
|
|
145
|
+
* exits 0). Used as the `isAvailable()` gate by CLI-backed tunnel providers.
|
|
146
|
+
*/
|
|
147
|
+
export function isCliTunnelAvailable(cmd) {
|
|
148
|
+
return new Promise((resolve) => {
|
|
149
|
+
const child = spawn(cmd, ['--version'], { stdio: 'ignore' });
|
|
150
|
+
child.once('error', () => resolve(false));
|
|
151
|
+
child.once('exit', (code) => resolve(code === 0));
|
|
152
|
+
});
|
|
153
|
+
}
|
|
2
154
|
//# sourceMappingURL=tunnel.js.map
|
package/dist/tunnel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel.js","sourceRoot":"","sources":["../src/tunnel.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"tunnel.js","sourceRoot":"","sources":["../src/tunnel.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAsB9D,8EAA8E;AAC9E,0CAA0C;AAC1C,EAAE;AACF,0EAA0E;AAC1E,2EAA2E;AAC3E,8EAA8E;AAC9E,gFAAgF;AAChF,gEAAgE;AAChE,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,YAAY,GAAG,IAAI,GAAG,EAAgB,CAAC;AAC7C,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B,SAAS,SAAS,CAAC,KAAmB;IACpC,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,UAAU,IAAI,IAAI;QAAE,OAAO;IAC/D,IAAI,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,kBAAkB;IACpB,CAAC;IACD,4EAA4E;IAC5E,8BAA8B;IAC9B,MAAM,CAAC,GAAG,UAAU,CAAC,G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ACpB,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,IAAI,iBAAiB,IAAI,IAAI,MAAM,yBAAyB,CAAC,CAAC,CAAC;QACrF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,OAAO,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,EAAE;QACtC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/workflow.d.ts
CHANGED
|
@@ -29,11 +29,32 @@ export interface WorkflowTrigger {
|
|
|
29
29
|
}
|
|
30
30
|
/** How a failed step is handled: abort the workflow, skip past it, or retry. */
|
|
31
31
|
export type WorkflowStepErrorMode = 'fail' | 'continue' | 'retry';
|
|
32
|
+
/** Response format for logic steps (`bridge` only may use `plain`). */
|
|
33
|
+
export type WorkflowLogicStepFormat = 'json' | 'plain';
|
|
34
|
+
/**
|
|
35
|
+
* Bounded iteration node. `body` is an ordered list of step ids that run once
|
|
36
|
+
* per iteration; after each pass the LLM evaluates `condition` as a
|
|
37
|
+
* `then`=continue / `else`=stop predicate (same mechanism as a `condition`
|
|
38
|
+
* step). The loop stops when the predicate says stop OR after `maxIterations`
|
|
39
|
+
* passes — there is no unbounded path. The iteration cap is independent of the
|
|
40
|
+
* nested-workflow {@link WorkflowRunDeps.depth} guard: a loop body that calls
|
|
41
|
+
* nested workflows still obeys the executor's depth cap.
|
|
42
|
+
*/
|
|
43
|
+
export interface WorkflowLoopAction {
|
|
44
|
+
/** Ordered step ids run once per iteration (must resolve; ≥1). */
|
|
45
|
+
readonly body: ReadonlyArray<string>;
|
|
46
|
+
/** LLM predicate: `then` = run another iteration, `else` = stop. */
|
|
47
|
+
readonly condition: string;
|
|
48
|
+
/** Hard cap on iterations (1..50). Hitting it ends the loop cleanly. */
|
|
49
|
+
readonly maxIterations: number;
|
|
50
|
+
}
|
|
32
51
|
/**
|
|
33
52
|
* One node in the DAG. Exactly one *action* key is set
|
|
34
|
-
* (`skill` | `prompt` | `tool` | `workflow`
|
|
35
|
-
*
|
|
36
|
-
*
|
|
53
|
+
* (`skill` | `prompt` | `tool` | `workflow` | `bridge` | `condition` | `switch`
|
|
54
|
+
* | `loop`). Logic steps run a single no-tools subagent turn; default response
|
|
55
|
+
* is JSON (`vars`, `branch`, optional `text`). `input` is the templated prompt
|
|
56
|
+
* for skill/prompt; `args` for tool/workflow; `bridge` / `condition` / `switch`
|
|
57
|
+
* hold the logic instruction text; `loop` holds a bounded iteration spec.
|
|
37
58
|
*/
|
|
38
59
|
export interface WorkflowStep {
|
|
39
60
|
readonly id: string;
|
|
@@ -41,14 +62,34 @@ export interface WorkflowStep {
|
|
|
41
62
|
readonly prompt?: string;
|
|
42
63
|
readonly tool?: string;
|
|
43
64
|
readonly workflow?: string;
|
|
65
|
+
/** Extract/transform upstream data into `vars` (and optional `text`). */
|
|
66
|
+
readonly bridge?: string;
|
|
67
|
+
/** If/else gate: agent returns `{"branch":"then"|"else"}`. */
|
|
68
|
+
readonly condition?: string;
|
|
69
|
+
readonly then?: ReadonlyArray<string>;
|
|
70
|
+
readonly else?: ReadonlyArray<string>;
|
|
71
|
+
/** Multi-way gate: agent returns `{"branch":"<caseId>"}`. */
|
|
72
|
+
readonly switch?: string;
|
|
73
|
+
readonly cases?: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
74
|
+
readonly default?: ReadonlyArray<string>;
|
|
75
|
+
/** Bounded iteration over `loop.body`, gated by an LLM predicate. */
|
|
76
|
+
readonly loop?: WorkflowLoopAction;
|
|
44
77
|
readonly input?: string;
|
|
45
78
|
readonly args?: Record<string, unknown>;
|
|
46
79
|
readonly needs: ReadonlyArray<string>;
|
|
47
|
-
/**
|
|
80
|
+
/** Legacy deterministic guard DSL; prefer `condition`/`switch` for semantics. */
|
|
48
81
|
readonly when?: string;
|
|
49
82
|
readonly onError: WorkflowStepErrorMode;
|
|
50
83
|
readonly retries: number;
|
|
51
84
|
readonly label?: string;
|
|
85
|
+
/** `plain` only on `bridge`; `condition`/`switch` always require JSON. */
|
|
86
|
+
readonly format?: WorkflowLogicStepFormat;
|
|
87
|
+
/**
|
|
88
|
+
* When true on a `prompt` or `skill` step, the DAG pauses after the
|
|
89
|
+
* subagent's first turn so the operator can reply once; the step completes
|
|
90
|
+
* after a follow-up turn. Ignored on logic / `tool` / `workflow` steps.
|
|
91
|
+
*/
|
|
92
|
+
readonly awaitInput?: boolean;
|
|
52
93
|
}
|
|
53
94
|
export interface WorkflowInputSpec {
|
|
54
95
|
readonly default?: unknown;
|
|
@@ -60,6 +101,23 @@ export interface WorkflowDelivery {
|
|
|
60
101
|
/** Also drop the final output into `~/.moxxy/inbox/`. Default true. */
|
|
61
102
|
readonly inbox: boolean;
|
|
62
103
|
}
|
|
104
|
+
/** Visual editor metadata. Runtime executors must ignore this field. */
|
|
105
|
+
export interface WorkflowUiLayoutNode {
|
|
106
|
+
readonly x: number;
|
|
107
|
+
readonly y: number;
|
|
108
|
+
}
|
|
109
|
+
export interface WorkflowUiViewport {
|
|
110
|
+
readonly x: number;
|
|
111
|
+
readonly y: number;
|
|
112
|
+
readonly zoom: number;
|
|
113
|
+
}
|
|
114
|
+
export interface WorkflowUiLayout {
|
|
115
|
+
readonly nodes: Record<string, WorkflowUiLayoutNode>;
|
|
116
|
+
readonly viewport?: WorkflowUiViewport;
|
|
117
|
+
}
|
|
118
|
+
export interface WorkflowUi {
|
|
119
|
+
readonly layout?: WorkflowUiLayout;
|
|
120
|
+
}
|
|
63
121
|
export interface Workflow {
|
|
64
122
|
readonly name: string;
|
|
65
123
|
readonly description: string;
|
|
@@ -73,6 +131,8 @@ export interface Workflow {
|
|
|
73
131
|
readonly inputs: Record<string, WorkflowInputSpec>;
|
|
74
132
|
readonly on?: WorkflowTrigger;
|
|
75
133
|
readonly delivery?: WorkflowDelivery;
|
|
134
|
+
/** GUI-only metadata persisted with the YAML artifact. */
|
|
135
|
+
readonly ui?: WorkflowUi;
|
|
76
136
|
/** Max steps to run concurrently in one ready-set round. */
|
|
77
137
|
readonly concurrency: number;
|
|
78
138
|
readonly steps: ReadonlyArray<WorkflowStep>;
|
|
@@ -88,7 +148,7 @@ export interface WorkflowLookup {
|
|
|
88
148
|
workflow(name: string): Workflow | undefined;
|
|
89
149
|
}
|
|
90
150
|
/** Lifecycle subtypes an executor emits as `plugin_event`s (mirrors plan_*). */
|
|
91
|
-
export type WorkflowEventSubtype = 'workflow_started' | 'workflow_step_started' | 'workflow_step_completed' | 'workflow_step_skipped' | 'workflow_step_failed' | 'workflow_completed' | 'workflow_failed';
|
|
151
|
+
export type WorkflowEventSubtype = 'workflow_started' | 'workflow_step_started' | 'workflow_step_completed' | 'workflow_step_skipped' | 'workflow_step_failed' | 'workflow_step_awaiting_input' | 'workflow_paused' | 'workflow_resumed' | 'workflow_completed' | 'workflow_failed';
|
|
92
152
|
/**
|
|
93
153
|
* Everything an executor needs to run a workflow, supplied by the caller.
|
|
94
154
|
* The in-turn `workflow_run` tool wires `spawner` from `ctx.subagents`; the
|
|
@@ -115,7 +175,8 @@ export interface WorkflowRunDeps {
|
|
|
115
175
|
/** Nested-workflow recursion depth; executors guard against runaway nesting. */
|
|
116
176
|
readonly depth?: number;
|
|
117
177
|
}
|
|
118
|
-
export type WorkflowStepStatus = 'completed' | 'skipped' | 'failed';
|
|
178
|
+
export type WorkflowStepStatus = 'completed' | 'skipped' | 'failed' | 'awaiting_input';
|
|
179
|
+
export type WorkflowRunStatus = 'completed' | 'paused' | 'failed';
|
|
119
180
|
export interface WorkflowStepResult {
|
|
120
181
|
readonly id: string;
|
|
121
182
|
readonly status: WorkflowStepStatus;
|
|
@@ -126,10 +187,16 @@ export interface WorkflowStepResult {
|
|
|
126
187
|
}
|
|
127
188
|
export interface WorkflowRunResult {
|
|
128
189
|
readonly ok: boolean;
|
|
190
|
+
readonly status: WorkflowRunStatus;
|
|
129
191
|
readonly steps: ReadonlyArray<WorkflowStepResult>;
|
|
130
192
|
/** Output of the terminal (sink) step(s) — what delivery sends. */
|
|
131
193
|
readonly output: string;
|
|
132
194
|
readonly error?: string;
|
|
195
|
+
/** Set when `status` is `paused` — use with workflow reply API. */
|
|
196
|
+
readonly runId?: string;
|
|
197
|
+
readonly pendingStepId?: string;
|
|
198
|
+
/** Child subagent session id for chat / permissions while paused. */
|
|
199
|
+
readonly interactionAgentId?: string;
|
|
133
200
|
}
|
|
134
201
|
/**
|
|
135
202
|
* A swappable workflow-execution strategy. v1 ships one (`dag`); a plugin can
|
package/dist/workflow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,aA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xB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAClD,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,mEAAmE;IACnE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,qEAAqE;IACrE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC5E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moxxy/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Typed public surface for the moxxy framework: event types, define* factories, lifecycle hook signatures.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"moxxy",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"typescript": "^5.7.3",
|
|
62
62
|
"vitest": "^2.1.8",
|
|
63
63
|
"zod": "^3.24.0",
|
|
64
|
-
"@moxxy/
|
|
65
|
-
"@moxxy/
|
|
64
|
+
"@moxxy/vitest-preset": "0.0.0",
|
|
65
|
+
"@moxxy/tsconfig": "0.0.0"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "tsc -p tsconfig.json",
|
package/src/index.ts
CHANGED
|
@@ -53,6 +53,8 @@ export type {
|
|
|
53
53
|
WorkflowsView,
|
|
54
54
|
WorkflowSummaryView,
|
|
55
55
|
WorkflowRunView,
|
|
56
|
+
WorkflowValidateView,
|
|
57
|
+
WorkflowSaveView,
|
|
56
58
|
PluginsAdminView,
|
|
57
59
|
InstallablePluginView,
|
|
58
60
|
LoadedPluginView,
|
|
@@ -111,6 +113,7 @@ export type {
|
|
|
111
113
|
SubagentSpec,
|
|
112
114
|
SubagentResult,
|
|
113
115
|
SubagentSpawner,
|
|
116
|
+
SubagentContinueArgs,
|
|
114
117
|
} from './subagent.js';
|
|
115
118
|
|
|
116
119
|
|
|
@@ -144,7 +147,14 @@ export type {
|
|
|
144
147
|
ViewRendererDef,
|
|
145
148
|
} from './view-renderer.js';
|
|
146
149
|
export { VIEW_PRIMITIVES, VIEW_COMPONENTS, DEFAULT_VIEW_TAGS, isSafeViewUrl } from './view-renderer.js';
|
|
147
|
-
export type {
|
|
150
|
+
export type {
|
|
151
|
+
TunnelProviderDef,
|
|
152
|
+
TunnelHandle,
|
|
153
|
+
TunnelOpenOptions,
|
|
154
|
+
SpawnCliTunnelOptions,
|
|
155
|
+
CliTunnelHandle,
|
|
156
|
+
} from './tunnel.js';
|
|
157
|
+
export { spawnCliTunnel, isCliTunnelAvailable } from './tunnel.js';
|
|
148
158
|
export { isRetryableError, toFriendlyError, zodToJsonSchema, estimateTextTokens, type StopReason } from './provider-utils.js';
|
|
149
159
|
export { writeFileAtomic, moxxyHome, moxxyPath, type WriteFileAtomicOptions } from './fs-utils.js';
|
|
150
160
|
export { createMutex, type Mutex } from './mutex.js';
|
|
@@ -244,15 +254,22 @@ export type { Skill, SkillDef, SkillFrontmatter, SkillScope, SkillSchedule } fro
|
|
|
244
254
|
export type {
|
|
245
255
|
Workflow,
|
|
246
256
|
WorkflowStep,
|
|
257
|
+
WorkflowLoopAction,
|
|
247
258
|
WorkflowTrigger,
|
|
248
259
|
WorkflowStepErrorMode,
|
|
260
|
+
WorkflowLogicStepFormat,
|
|
249
261
|
WorkflowInputSpec,
|
|
250
262
|
WorkflowDelivery,
|
|
263
|
+
WorkflowUi,
|
|
264
|
+
WorkflowUiLayout,
|
|
265
|
+
WorkflowUiLayoutNode,
|
|
266
|
+
WorkflowUiViewport,
|
|
251
267
|
WorkflowToolRunner,
|
|
252
268
|
WorkflowLookup,
|
|
253
269
|
WorkflowEventSubtype,
|
|
254
270
|
WorkflowRunDeps,
|
|
255
271
|
WorkflowStepStatus,
|
|
272
|
+
WorkflowRunStatus,
|
|
256
273
|
WorkflowStepResult,
|
|
257
274
|
WorkflowRunResult,
|
|
258
275
|
WorkflowExecutorDef,
|
package/src/session-like.ts
CHANGED
|
@@ -165,16 +165,45 @@ export interface WorkflowRunView {
|
|
|
165
165
|
readonly steps: ReadonlyArray<{ readonly id: string; readonly status: string; readonly error?: string }>;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
/** Validation result for a draft YAML — backs the visual builder (phase 2). */
|
|
169
|
+
export interface WorkflowValidateView {
|
|
170
|
+
readonly ok: boolean;
|
|
171
|
+
/** One readable line per issue; empty when `ok`. */
|
|
172
|
+
readonly errors: ReadonlyArray<string>;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** Result of persisting a workflow from the builder. */
|
|
176
|
+
export interface WorkflowSaveView {
|
|
177
|
+
readonly name: string;
|
|
178
|
+
readonly scope: string;
|
|
179
|
+
readonly path: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
168
182
|
/**
|
|
169
183
|
* The slice of the workflows API a channel needs to drive the `/workflows`
|
|
170
184
|
* modal (list, enable/disable toggle, run). Present on a local Session when
|
|
171
185
|
* `@moxxy/plugin-workflows` is wired; a `RemoteSession` leaves
|
|
172
186
|
* {@link SessionLike.workflows} undefined and the UI degrades gracefully.
|
|
187
|
+
*
|
|
188
|
+
* `validateDraft` / `save` / `getRun` back the upcoming visual workflow
|
|
189
|
+
* builder (phase 2); they are optional so older hosts and remote sessions
|
|
190
|
+
* stay capability-detectable — a channel must feature-check before calling.
|
|
173
191
|
*/
|
|
174
192
|
export interface WorkflowsView {
|
|
175
193
|
list(): Promise<ReadonlyArray<WorkflowSummaryView>>;
|
|
176
194
|
setEnabled(name: string, enabled: boolean): Promise<void>;
|
|
177
195
|
run(name: string): Promise<WorkflowRunView>;
|
|
196
|
+
/** Parse + validate a draft YAML without saving it. */
|
|
197
|
+
validateDraft?(yaml: string): Promise<WorkflowValidateView>;
|
|
198
|
+
/**
|
|
199
|
+
* Persist a workflow from full YAML (create or overwrite). `previousName`
|
|
200
|
+
* (the name the builder loaded) supports rename: when it differs from the
|
|
201
|
+
* YAML's name, the old file + registry entry are removed so a rename doesn't
|
|
202
|
+
* leave an orphaned duplicate.
|
|
203
|
+
*/
|
|
204
|
+
save?(yaml: string, previousName?: string): Promise<WorkflowSaveView>;
|
|
205
|
+
/** Fetch one saved workflow's canonical YAML + on-disk metadata. */
|
|
206
|
+
getRun?(name: string): Promise<{ readonly name: string; readonly scope: string; readonly path: string; readonly yaml: string } | null>;
|
|
178
207
|
}
|
|
179
208
|
|
|
180
209
|
/** One installable plugin in {@link PluginsAdminView.catalog}. */
|
package/src/subagent.ts
CHANGED
|
@@ -26,6 +26,18 @@ export interface SubagentSpec {
|
|
|
26
26
|
readonly allowedTools?: ReadonlyArray<string>;
|
|
27
27
|
/** Human-readable label surfaced in `subagent_*` event payloads. */
|
|
28
28
|
readonly label?: string;
|
|
29
|
+
/**
|
|
30
|
+
* When true, the child session stays alive after the first turn for
|
|
31
|
+
* {@link SubagentSpawner.continue}. `subagent_completed` is deferred until
|
|
32
|
+
* continue or release. Used by the workflow `awaitInput` pause/resume flow.
|
|
33
|
+
*/
|
|
34
|
+
readonly retainSession?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface SubagentContinueArgs {
|
|
38
|
+
readonly childSessionId: SessionId;
|
|
39
|
+
readonly prompt: string;
|
|
40
|
+
readonly label?: string;
|
|
29
41
|
}
|
|
30
42
|
|
|
31
43
|
export interface SubagentResult {
|
|
@@ -43,4 +55,8 @@ export interface SubagentSpawner {
|
|
|
43
55
|
spawn(spec: SubagentSpec): Promise<SubagentResult>;
|
|
44
56
|
/** Run N children in parallel; resolves with results in input order. */
|
|
45
57
|
spawnAll(specs: ReadonlyArray<SubagentSpec>): Promise<ReadonlyArray<SubagentResult>>;
|
|
58
|
+
/** Append a user turn and run a retained child again (requires `retainSession`). */
|
|
59
|
+
continue?(args: SubagentContinueArgs): Promise<SubagentResult>;
|
|
60
|
+
/** Drop a retained session without completing it. */
|
|
61
|
+
release?(childSessionId: SessionId): void;
|
|
46
62
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { isCliTunnelAvailable, spawnCliTunnel } from './tunnel.js';
|
|
3
|
+
|
|
4
|
+
const URL_RE = /https:\/\/[a-z0-9-]+\.example\.test/i;
|
|
5
|
+
|
|
6
|
+
describe('spawnCliTunnel', () => {
|
|
7
|
+
it('resolves the parsed URL + pid when the child prints a matching line', async () => {
|
|
8
|
+
const handle = await spawnCliTunnel({
|
|
9
|
+
cmd: process.execPath,
|
|
10
|
+
// Print a noise line, then the URL, then stay alive so close() can kill it.
|
|
11
|
+
args: ['-e', 'console.log("starting up"); console.log("url=https://abc-123.example.test ready"); setInterval(()=>{}, 1000);'],
|
|
12
|
+
urlRegex: URL_RE,
|
|
13
|
+
name: 'faketunnel',
|
|
14
|
+
timeoutMs: 5_000,
|
|
15
|
+
});
|
|
16
|
+
expect(handle.url).toBe('https://abc-123.example.test');
|
|
17
|
+
expect(handle.pid).toBeGreaterThan(0);
|
|
18
|
+
await handle.close();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('parses URLs printed on stderr too', async () => {
|
|
22
|
+
const handle = await spawnCliTunnel({
|
|
23
|
+
cmd: process.execPath,
|
|
24
|
+
args: ['-e', 'console.error("https://err-host.example.test"); setInterval(()=>{}, 1000);'],
|
|
25
|
+
urlRegex: URL_RE,
|
|
26
|
+
timeoutMs: 5_000,
|
|
27
|
+
});
|
|
28
|
+
expect(handle.url).toBe('https://err-host.example.test');
|
|
29
|
+
await handle.close();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('rejects when the child exits before emitting a URL', async () => {
|
|
33
|
+
await expect(
|
|
34
|
+
spawnCliTunnel({
|
|
35
|
+
cmd: process.execPath,
|
|
36
|
+
args: ['-e', 'process.exit(3)'],
|
|
37
|
+
urlRegex: URL_RE,
|
|
38
|
+
name: 'faketunnel',
|
|
39
|
+
timeoutMs: 5_000,
|
|
40
|
+
}),
|
|
41
|
+
).rejects.toThrow(/faketunnel exited \(code 3\) before emitting a URL/);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('rejects when the executable cannot be spawned', async () => {
|
|
45
|
+
await expect(
|
|
46
|
+
spawnCliTunnel({
|
|
47
|
+
cmd: 'definitely-not-a-real-binary-xyz',
|
|
48
|
+
args: [],
|
|
49
|
+
urlRegex: URL_RE,
|
|
50
|
+
name: 'nope',
|
|
51
|
+
timeoutMs: 2_000,
|
|
52
|
+
}),
|
|
53
|
+
).rejects.toThrow();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('rejects on timeout when no URL is ever printed (and kills the child)', async () => {
|
|
57
|
+
await expect(
|
|
58
|
+
spawnCliTunnel({
|
|
59
|
+
cmd: process.execPath,
|
|
60
|
+
args: ['-e', 'setInterval(()=>{}, 1000);'],
|
|
61
|
+
urlRegex: URL_RE,
|
|
62
|
+
name: 'slowtunnel',
|
|
63
|
+
timeoutMs: 150,
|
|
64
|
+
}),
|
|
65
|
+
).rejects.toThrow(/slowtunnel: timed out after 150ms/);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe('isCliTunnelAvailable', () => {
|
|
70
|
+
it('resolves true for an installed runnable binary', async () => {
|
|
71
|
+
// node is always present in the test runtime and supports --version.
|
|
72
|
+
expect(await isCliTunnelAvailable(process.execPath)).toBe(true);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('resolves false for a missing binary', async () => {
|
|
76
|
+
expect(await isCliTunnelAvailable('definitely-not-a-real-binary-xyz')).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
});
|
package/src/tunnel.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* plugins, like every other block); core seeds a `localhost` no-op provider so
|
|
6
6
|
* `getActive()` is non-null.
|
|
7
7
|
*/
|
|
8
|
+
import { spawn, type ChildProcess } from 'node:child_process';
|
|
9
|
+
|
|
8
10
|
export interface TunnelOpenOptions {
|
|
9
11
|
readonly port: number;
|
|
10
12
|
readonly host: string;
|
|
@@ -24,3 +26,173 @@ export interface TunnelProviderDef {
|
|
|
24
26
|
/** Optional readiness gate (e.g. the `cloudflared` binary is installed). */
|
|
25
27
|
isAvailable?(): Promise<boolean>;
|
|
26
28
|
}
|
|
29
|
+
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Shared CLI-tunnel subprocess management
|
|
32
|
+
//
|
|
33
|
+
// cloudflared/ngrok (channel-web) and the webhooks tunnel all do the same
|
|
34
|
+
// thing: spawn a CLI, watch its stdout/stderr for the assigned public URL,
|
|
35
|
+
// resolve once it's seen (or reject on timeout/exit/error), and guarantee the
|
|
36
|
+
// child is killed on close *and* on process exit (Node does not reap children).
|
|
37
|
+
// `spawnCliTunnel` is the single implementation they all share.
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Guarantees spawned tunnel children (cloudflared/ngrok/…) never orphan or
|
|
42
|
+
* leak. Node does NOT kill child processes when the parent exits, so we track
|
|
43
|
+
* every live child and kill any survivors on process teardown — in addition to
|
|
44
|
+
* the explicit `close()` path. Each tracked child is also force-killed
|
|
45
|
+
* (SIGKILL) if it ignores SIGTERM, so a wedged tunnel can't drain
|
|
46
|
+
* memory/handles.
|
|
47
|
+
*/
|
|
48
|
+
const liveChildren = new Set<ChildProcess>();
|
|
49
|
+
let exitHookInstalled = false;
|
|
50
|
+
|
|
51
|
+
function killChild(child: ChildProcess): void {
|
|
52
|
+
if (child.exitCode != null || child.signalCode != null) return;
|
|
53
|
+
try {
|
|
54
|
+
child.kill('SIGTERM');
|
|
55
|
+
} catch {
|
|
56
|
+
/* already gone */
|
|
57
|
+
}
|
|
58
|
+
// Escalate if it doesn't exit promptly. unref so this timer never holds the
|
|
59
|
+
// event loop open on its own.
|
|
60
|
+
const t = setTimeout(() => {
|
|
61
|
+
try {
|
|
62
|
+
child.kill('SIGKILL');
|
|
63
|
+
} catch {
|
|
64
|
+
/* gone */
|
|
65
|
+
}
|
|
66
|
+
}, 2000);
|
|
67
|
+
t.unref?.();
|
|
68
|
+
child.once('exit', () => clearTimeout(t));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function ensureExitHook(): void {
|
|
72
|
+
if (exitHookInstalled) return;
|
|
73
|
+
exitHookInstalled = true;
|
|
74
|
+
const killAll = (): void => {
|
|
75
|
+
for (const child of liveChildren) {
|
|
76
|
+
try {
|
|
77
|
+
child.kill('SIGKILL'); // process is exiting; be decisive, no async escalation
|
|
78
|
+
} catch {
|
|
79
|
+
/* gone */
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
liveChildren.clear();
|
|
83
|
+
};
|
|
84
|
+
process.once('exit', killAll);
|
|
85
|
+
process.once('SIGINT', killAll);
|
|
86
|
+
process.once('SIGTERM', killAll);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Track a spawned child; returns an `untrack()` that also kills it cleanly. */
|
|
90
|
+
function trackChild(child: ChildProcess): () => Promise<void> {
|
|
91
|
+
ensureExitHook();
|
|
92
|
+
liveChildren.add(child);
|
|
93
|
+
child.once('exit', () => liveChildren.delete(child));
|
|
94
|
+
return () =>
|
|
95
|
+
new Promise<void>((resolve) => {
|
|
96
|
+
liveChildren.delete(child);
|
|
97
|
+
if (child.exitCode != null || child.signalCode != null) return resolve();
|
|
98
|
+
child.once('exit', () => resolve());
|
|
99
|
+
killChild(child);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface SpawnCliTunnelOptions {
|
|
104
|
+
/** Executable to spawn (e.g. `cloudflared`, `ngrok`). */
|
|
105
|
+
readonly cmd: string;
|
|
106
|
+
/** Arguments passed to the executable. */
|
|
107
|
+
readonly args: ReadonlyArray<string>;
|
|
108
|
+
/** Matches the assigned public URL in a chunk of the CLI's stdout/stderr. */
|
|
109
|
+
readonly urlRegex: RegExp;
|
|
110
|
+
/** How long to wait for the URL before giving up. Default 30s. */
|
|
111
|
+
readonly timeoutMs?: number;
|
|
112
|
+
/** Human-readable name used in error messages. Defaults to `cmd`. */
|
|
113
|
+
readonly name?: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** A spawned CLI tunnel: the public-URL handle plus the child's pid. */
|
|
117
|
+
export interface CliTunnelHandle extends TunnelHandle {
|
|
118
|
+
/** Spawned process id (-1 if the platform didn't assign one). */
|
|
119
|
+
readonly pid: number;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const DEFAULT_TUNNEL_URL_TIMEOUT_MS = 30_000;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Spawn a CLI tunnel, parse the assigned public URL out of its output, and
|
|
126
|
+
* resolve a {@link CliTunnelHandle}. The child is tracked so it is killed on
|
|
127
|
+
* `close()`, on tunnel-switch, and on process exit (no orphans). Rejects on
|
|
128
|
+
* timeout, spawn error, or premature exit (the child is killed in every reject
|
|
129
|
+
* path). This is the single spawn-and-parse implementation behind the
|
|
130
|
+
* cloudflared/ngrok tunnel providers and the webhooks tunnel.
|
|
131
|
+
*/
|
|
132
|
+
export function spawnCliTunnel(opts: SpawnCliTunnelOptions): Promise<CliTunnelHandle> {
|
|
133
|
+
const { cmd, args, urlRegex } = opts;
|
|
134
|
+
const name = opts.name ?? cmd;
|
|
135
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULT_TUNNEL_URL_TIMEOUT_MS;
|
|
136
|
+
|
|
137
|
+
return new Promise<CliTunnelHandle>((resolve, reject) => {
|
|
138
|
+
let child: ChildProcess;
|
|
139
|
+
try {
|
|
140
|
+
child = spawn(cmd, args as string[], { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
141
|
+
} catch (err) {
|
|
142
|
+
reject(
|
|
143
|
+
new Error(
|
|
144
|
+
`failed to spawn ${name} — is it installed? (${err instanceof Error ? err.message : String(err)})`,
|
|
145
|
+
),
|
|
146
|
+
);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const untrack = trackChild(child);
|
|
151
|
+
let settled = false;
|
|
152
|
+
|
|
153
|
+
const timer = setTimeout(() => {
|
|
154
|
+
if (settled) return;
|
|
155
|
+
settled = true;
|
|
156
|
+
void untrack();
|
|
157
|
+
reject(new Error(`${name}: timed out after ${timeoutMs}ms waiting for the tunnel URL`));
|
|
158
|
+
}, timeoutMs);
|
|
159
|
+
timer.unref?.();
|
|
160
|
+
|
|
161
|
+
const onData = (buf: Buffer): void => {
|
|
162
|
+
if (settled) return; // drain quietly once resolved so the pipe never fills
|
|
163
|
+
const url = urlRegex.exec(buf.toString('utf8'))?.[0] ?? null;
|
|
164
|
+
if (!url) return;
|
|
165
|
+
settled = true;
|
|
166
|
+
clearTimeout(timer);
|
|
167
|
+
resolve({ url, pid: child.pid ?? -1, close: untrack });
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
child.stdout?.on('data', onData);
|
|
171
|
+
child.stderr?.on('data', onData);
|
|
172
|
+
child.on('error', (err) => {
|
|
173
|
+
if (settled) return;
|
|
174
|
+
settled = true;
|
|
175
|
+
clearTimeout(timer);
|
|
176
|
+
void untrack();
|
|
177
|
+
reject(err);
|
|
178
|
+
});
|
|
179
|
+
child.on('exit', (code) => {
|
|
180
|
+
if (settled) return;
|
|
181
|
+
settled = true;
|
|
182
|
+
clearTimeout(timer);
|
|
183
|
+
reject(new Error(`${name} exited (code ${code ?? 'null'}) before emitting a URL`));
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Probe whether a tunnel CLI is installed and runnable (`<cmd> --version`
|
|
190
|
+
* exits 0). Used as the `isAvailable()` gate by CLI-backed tunnel providers.
|
|
191
|
+
*/
|
|
192
|
+
export function isCliTunnelAvailable(cmd: string): Promise<boolean> {
|
|
193
|
+
return new Promise<boolean>((resolve) => {
|
|
194
|
+
const child = spawn(cmd, ['--version'], { stdio: 'ignore' });
|
|
195
|
+
child.once('error', () => resolve(false));
|
|
196
|
+
child.once('exit', (code) => resolve(code === 0));
|
|
197
|
+
});
|
|
198
|
+
}
|
package/src/workflow.ts
CHANGED
|
@@ -33,11 +33,34 @@ export interface WorkflowTrigger {
|
|
|
33
33
|
/** How a failed step is handled: abort the workflow, skip past it, or retry. */
|
|
34
34
|
export type WorkflowStepErrorMode = 'fail' | 'continue' | 'retry';
|
|
35
35
|
|
|
36
|
+
/** Response format for logic steps (`bridge` only may use `plain`). */
|
|
37
|
+
export type WorkflowLogicStepFormat = 'json' | 'plain';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Bounded iteration node. `body` is an ordered list of step ids that run once
|
|
41
|
+
* per iteration; after each pass the LLM evaluates `condition` as a
|
|
42
|
+
* `then`=continue / `else`=stop predicate (same mechanism as a `condition`
|
|
43
|
+
* step). The loop stops when the predicate says stop OR after `maxIterations`
|
|
44
|
+
* passes — there is no unbounded path. The iteration cap is independent of the
|
|
45
|
+
* nested-workflow {@link WorkflowRunDeps.depth} guard: a loop body that calls
|
|
46
|
+
* nested workflows still obeys the executor's depth cap.
|
|
47
|
+
*/
|
|
48
|
+
export interface WorkflowLoopAction {
|
|
49
|
+
/** Ordered step ids run once per iteration (must resolve; ≥1). */
|
|
50
|
+
readonly body: ReadonlyArray<string>;
|
|
51
|
+
/** LLM predicate: `then` = run another iteration, `else` = stop. */
|
|
52
|
+
readonly condition: string;
|
|
53
|
+
/** Hard cap on iterations (1..50). Hitting it ends the loop cleanly. */
|
|
54
|
+
readonly maxIterations: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
36
57
|
/**
|
|
37
58
|
* One node in the DAG. Exactly one *action* key is set
|
|
38
|
-
* (`skill` | `prompt` | `tool` | `workflow`
|
|
39
|
-
*
|
|
40
|
-
*
|
|
59
|
+
* (`skill` | `prompt` | `tool` | `workflow` | `bridge` | `condition` | `switch`
|
|
60
|
+
* | `loop`). Logic steps run a single no-tools subagent turn; default response
|
|
61
|
+
* is JSON (`vars`, `branch`, optional `text`). `input` is the templated prompt
|
|
62
|
+
* for skill/prompt; `args` for tool/workflow; `bridge` / `condition` / `switch`
|
|
63
|
+
* hold the logic instruction text; `loop` holds a bounded iteration spec.
|
|
41
64
|
*/
|
|
42
65
|
export interface WorkflowStep {
|
|
43
66
|
readonly id: string;
|
|
@@ -45,14 +68,34 @@ export interface WorkflowStep {
|
|
|
45
68
|
readonly prompt?: string;
|
|
46
69
|
readonly tool?: string;
|
|
47
70
|
readonly workflow?: string;
|
|
71
|
+
/** Extract/transform upstream data into `vars` (and optional `text`). */
|
|
72
|
+
readonly bridge?: string;
|
|
73
|
+
/** If/else gate: agent returns `{"branch":"then"|"else"}`. */
|
|
74
|
+
readonly condition?: string;
|
|
75
|
+
readonly then?: ReadonlyArray<string>;
|
|
76
|
+
readonly else?: ReadonlyArray<string>;
|
|
77
|
+
/** Multi-way gate: agent returns `{"branch":"<caseId>"}`. */
|
|
78
|
+
readonly switch?: string;
|
|
79
|
+
readonly cases?: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
80
|
+
readonly default?: ReadonlyArray<string>;
|
|
81
|
+
/** Bounded iteration over `loop.body`, gated by an LLM predicate. */
|
|
82
|
+
readonly loop?: WorkflowLoopAction;
|
|
48
83
|
readonly input?: string;
|
|
49
84
|
readonly args?: Record<string, unknown>;
|
|
50
85
|
readonly needs: ReadonlyArray<string>;
|
|
51
|
-
/**
|
|
86
|
+
/** Legacy deterministic guard DSL; prefer `condition`/`switch` for semantics. */
|
|
52
87
|
readonly when?: string;
|
|
53
88
|
readonly onError: WorkflowStepErrorMode;
|
|
54
89
|
readonly retries: number;
|
|
55
90
|
readonly label?: string;
|
|
91
|
+
/** `plain` only on `bridge`; `condition`/`switch` always require JSON. */
|
|
92
|
+
readonly format?: WorkflowLogicStepFormat;
|
|
93
|
+
/**
|
|
94
|
+
* When true on a `prompt` or `skill` step, the DAG pauses after the
|
|
95
|
+
* subagent's first turn so the operator can reply once; the step completes
|
|
96
|
+
* after a follow-up turn. Ignored on logic / `tool` / `workflow` steps.
|
|
97
|
+
*/
|
|
98
|
+
readonly awaitInput?: boolean;
|
|
56
99
|
}
|
|
57
100
|
|
|
58
101
|
export interface WorkflowInputSpec {
|
|
@@ -67,6 +110,27 @@ export interface WorkflowDelivery {
|
|
|
67
110
|
readonly inbox: boolean;
|
|
68
111
|
}
|
|
69
112
|
|
|
113
|
+
/** Visual editor metadata. Runtime executors must ignore this field. */
|
|
114
|
+
export interface WorkflowUiLayoutNode {
|
|
115
|
+
readonly x: number;
|
|
116
|
+
readonly y: number;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface WorkflowUiViewport {
|
|
120
|
+
readonly x: number;
|
|
121
|
+
readonly y: number;
|
|
122
|
+
readonly zoom: number;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface WorkflowUiLayout {
|
|
126
|
+
readonly nodes: Record<string, WorkflowUiLayoutNode>;
|
|
127
|
+
readonly viewport?: WorkflowUiViewport;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface WorkflowUi {
|
|
131
|
+
readonly layout?: WorkflowUiLayout;
|
|
132
|
+
}
|
|
133
|
+
|
|
70
134
|
export interface Workflow {
|
|
71
135
|
readonly name: string;
|
|
72
136
|
readonly description: string;
|
|
@@ -80,6 +144,8 @@ export interface Workflow {
|
|
|
80
144
|
readonly inputs: Record<string, WorkflowInputSpec>;
|
|
81
145
|
readonly on?: WorkflowTrigger;
|
|
82
146
|
readonly delivery?: WorkflowDelivery;
|
|
147
|
+
/** GUI-only metadata persisted with the YAML artifact. */
|
|
148
|
+
readonly ui?: WorkflowUi;
|
|
83
149
|
/** Max steps to run concurrently in one ready-set round. */
|
|
84
150
|
readonly concurrency: number;
|
|
85
151
|
readonly steps: ReadonlyArray<WorkflowStep>;
|
|
@@ -104,6 +170,9 @@ export type WorkflowEventSubtype =
|
|
|
104
170
|
| 'workflow_step_completed'
|
|
105
171
|
| 'workflow_step_skipped'
|
|
106
172
|
| 'workflow_step_failed'
|
|
173
|
+
| 'workflow_step_awaiting_input'
|
|
174
|
+
| 'workflow_paused'
|
|
175
|
+
| 'workflow_resumed'
|
|
107
176
|
| 'workflow_completed'
|
|
108
177
|
| 'workflow_failed';
|
|
109
178
|
|
|
@@ -134,7 +203,9 @@ export interface WorkflowRunDeps {
|
|
|
134
203
|
readonly depth?: number;
|
|
135
204
|
}
|
|
136
205
|
|
|
137
|
-
export type WorkflowStepStatus = 'completed' | 'skipped' | 'failed';
|
|
206
|
+
export type WorkflowStepStatus = 'completed' | 'skipped' | 'failed' | 'awaiting_input';
|
|
207
|
+
|
|
208
|
+
export type WorkflowRunStatus = 'completed' | 'paused' | 'failed';
|
|
138
209
|
|
|
139
210
|
export interface WorkflowStepResult {
|
|
140
211
|
readonly id: string;
|
|
@@ -147,10 +218,16 @@ export interface WorkflowStepResult {
|
|
|
147
218
|
|
|
148
219
|
export interface WorkflowRunResult {
|
|
149
220
|
readonly ok: boolean;
|
|
221
|
+
readonly status: WorkflowRunStatus;
|
|
150
222
|
readonly steps: ReadonlyArray<WorkflowStepResult>;
|
|
151
223
|
/** Output of the terminal (sink) step(s) — what delivery sends. */
|
|
152
224
|
readonly output: string;
|
|
153
225
|
readonly error?: string;
|
|
226
|
+
/** Set when `status` is `paused` — use with workflow reply API. */
|
|
227
|
+
readonly runId?: string;
|
|
228
|
+
readonly pendingStepId?: string;
|
|
229
|
+
/** Child subagent session id for chat / permissions while paused. */
|
|
230
|
+
readonly interactionAgentId?: string;
|
|
154
231
|
}
|
|
155
232
|
|
|
156
233
|
/**
|