@nebutra/agent-runtime 0.2.0 → 0.2.2
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/LICENSE +21 -676
- package/README.md +2 -0
- package/dist/adapters/dispatcher-sse.js +1 -0
- package/dist/adapters/index.d.ts +24 -5
- package/dist/adapters/index.js +28 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/mcp-catalog.js +1 -0
- package/dist/adapters/prisma-rollout.js +1 -0
- package/dist/chunk-424PT5DM.js +23 -0
- package/dist/chunk-424PT5DM.js.map +1 -0
- package/dist/{chunk-NN7DATXA.js → chunk-4Y25ZTKI.js} +3 -3
- package/dist/chunk-4Y25ZTKI.js.map +1 -0
- package/dist/{chunk-BJBBR3QA.js → chunk-D4YAPLOW.js} +4 -4
- package/dist/chunk-D4YAPLOW.js.map +1 -0
- package/dist/{chunk-ZMYX5VBU.js → chunk-GQZKYWFT.js} +23 -7
- package/dist/chunk-GQZKYWFT.js.map +1 -0
- package/dist/chunk-KCNN4QUQ.js +255 -0
- package/dist/chunk-KCNN4QUQ.js.map +1 -0
- package/dist/{chunk-PGGWSUTM.js → chunk-NI4EDT4T.js} +2 -2
- package/dist/chunk-NI4EDT4T.js.map +1 -0
- package/dist/chunk-Q62VKHIT.js +178 -0
- package/dist/chunk-Q62VKHIT.js.map +1 -0
- package/dist/{chunk-MUF7ZZTO.js → chunk-R5HOSQUW.js} +2 -1
- package/dist/{chunk-MUF7ZZTO.js.map → chunk-R5HOSQUW.js.map} +1 -1
- package/dist/{chunk-5N4644PB.js → chunk-SD2ZJ7XG.js} +4 -4
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +52 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands.js +1 -0
- package/dist/definitions.js +1 -0
- package/dist/dispatcher.js +1 -0
- package/dist/durable-turn.js +3 -2
- package/dist/hook-pipeline.js +1 -0
- package/dist/index.d.ts +8 -85
- package/dist/index.js +249 -134
- package/dist/index.js.map +1 -1
- package/dist/loop.d.ts +2 -2
- package/dist/loop.js +3 -2
- package/dist/mcp-bridge.d.ts +3 -3
- package/dist/mcp-bridge.js +3 -2
- package/dist/model.js +1 -0
- package/dist/orchestration.d.ts +84 -0
- package/dist/orchestration.js +16 -0
- package/dist/orchestration.js.map +1 -0
- package/dist/policy.js +1 -0
- package/dist/protocol.js +1 -0
- package/dist/pulsar.d.ts +78 -0
- package/dist/pulsar.js +17 -0
- package/dist/pulsar.js.map +1 -0
- package/dist/rollout-store-persistent.js +1 -0
- package/dist/rollout.js +1 -0
- package/dist/sandbox.js +2 -1
- package/dist/skills.js +2 -1
- package/dist/subagents.js +1 -0
- package/dist/tools.d.ts +4 -3
- package/dist/tools.js +5 -3
- package/package.json +84 -27
- package/.turbo/turbo-build.log +0 -115
- package/.turbo/turbo-test.log +0 -44
- package/.turbo/turbo-typecheck.log +0 -4
- package/CHANGELOG.md +0 -253
- package/dist/chunk-BJBBR3QA.js.map +0 -1
- package/dist/chunk-NN7DATXA.js.map +0 -1
- package/dist/chunk-PGGWSUTM.js.map +0 -1
- package/dist/chunk-ZMYX5VBU.js.map +0 -1
- package/src/adapters/dispatcher-sse.test.ts +0 -218
- package/src/adapters/dispatcher-sse.ts +0 -222
- package/src/adapters/index.ts +0 -18
- package/src/adapters/mcp-catalog.test.ts +0 -213
- package/src/adapters/mcp-catalog.ts +0 -188
- package/src/adapters/prisma-rollout.test.ts +0 -153
- package/src/adapters/prisma-rollout.ts +0 -104
- package/src/agent-runtime.test.ts +0 -176
- package/src/artifact-stream.test.ts +0 -330
- package/src/artifact-stream.ts +0 -453
- package/src/channel-gateway.test.ts +0 -432
- package/src/channel-gateway.ts +0 -357
- package/src/code-review.test.ts +0 -501
- package/src/code-review.ts +0 -495
- package/src/command-suggestions.test.ts +0 -251
- package/src/command-suggestions.ts +0 -338
- package/src/commands.test.ts +0 -184
- package/src/commands.ts +0 -140
- package/src/commit-message.test.ts +0 -249
- package/src/commit-message.ts +0 -180
- package/src/context-compaction.test.ts +0 -522
- package/src/context-compaction.ts +0 -434
- package/src/definitions.test.ts +0 -78
- package/src/definitions.ts +0 -190
- package/src/deployment-status.test.ts +0 -215
- package/src/deployment-status.ts +0 -227
- package/src/design-context.test.ts +0 -195
- package/src/design-context.ts +0 -198
- package/src/dispatcher.test.ts +0 -234
- package/src/dispatcher.ts +0 -189
- package/src/durable-turn.test.ts +0 -209
- package/src/durable-turn.ts +0 -135
- package/src/edit-planner.test.ts +0 -204
- package/src/edit-planner.ts +0 -325
- package/src/fuzzy-match.test.ts +0 -311
- package/src/fuzzy-match.ts +0 -444
- package/src/hook-pipeline.test.ts +0 -279
- package/src/hook-pipeline.ts +0 -373
- package/src/inbound-admission.test.ts +0 -394
- package/src/inbound-admission.ts +0 -246
- package/src/index.ts +0 -47
- package/src/loop.test.ts +0 -161
- package/src/loop.ts +0 -211
- package/src/mcp-bridge.test.ts +0 -165
- package/src/mcp-bridge.ts +0 -76
- package/src/memory-provider.test.ts +0 -232
- package/src/memory-provider.ts +0 -257
- package/src/model.ts +0 -168
- package/src/permission-ruleset.test.ts +0 -301
- package/src/permission-ruleset.ts +0 -200
- package/src/policy.ts +0 -151
- package/src/project-repo.test.ts +0 -232
- package/src/project-repo.ts +0 -311
- package/src/protocol.ts +0 -159
- package/src/rollout-store-persistent.test.ts +0 -217
- package/src/rollout-store-persistent.ts +0 -166
- package/src/rollout.ts +0 -150
- package/src/sandbox.ts +0 -113
- package/src/session-share.test.ts +0 -360
- package/src/session-share.ts +0 -310
- package/src/skill-distillation.test.ts +0 -177
- package/src/skill-distillation.ts +0 -369
- package/src/skills.test.ts +0 -277
- package/src/skills.ts +0 -255
- package/src/subagents.test.ts +0 -290
- package/src/subagents.ts +0 -332
- package/src/tools.ts +0 -126
- package/src/workbench.test.ts +0 -0
- package/src/workbench.ts +0 -0
- package/tsconfig.json +0 -12
- package/tsup.config.ts +0 -33
- /package/dist/{chunk-5N4644PB.js.map → chunk-SD2ZJ7XG.js.map} +0 -0
package/dist/loop.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { TurnConfig, TurnUsage, ThreadEvent } from './model.js';
|
|
|
2
2
|
import { ReviewDecision, RuleDecision, ApprovalPolicy } from './policy.js';
|
|
3
3
|
import { ServerRequest } from './protocol.js';
|
|
4
4
|
import { RolloutStore } from './rollout.js';
|
|
5
|
-
import {
|
|
5
|
+
import { RuntimeToolRegistry } from './tools.js';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -60,7 +60,7 @@ interface RunTurnDeps {
|
|
|
60
60
|
readonly config: TurnConfig;
|
|
61
61
|
readonly approvalPolicy: ApprovalPolicy;
|
|
62
62
|
readonly model: ModelInvoker;
|
|
63
|
-
readonly tools:
|
|
63
|
+
readonly tools: RuntimeToolRegistry;
|
|
64
64
|
readonly store: RolloutStore;
|
|
65
65
|
readonly approvalGate: ApprovalGate;
|
|
66
66
|
/** Defaults to: everything requires a prompt (safe). */
|
package/dist/loop.js
CHANGED
package/dist/mcp-bridge.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToolDefinition,
|
|
1
|
+
import { ToolDefinition, RuntimeToolRegistry, McpClientLike } from './tools.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -36,11 +36,11 @@ interface ActivateMcpToolsResult {
|
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* List the tenant/plan-visible MCP tools, adapt each via {@link adaptMcpTool},
|
|
39
|
-
* and register them into the {@link
|
|
39
|
+
* and register them into the {@link RuntimeToolRegistry}. A tool whose name is already
|
|
40
40
|
* registered is skipped (reported, never thrown). Empty/blank tenantId fails
|
|
41
41
|
* closed before any catalog call.
|
|
42
42
|
*/
|
|
43
|
-
declare function activateMcpTools(registry:
|
|
43
|
+
declare function activateMcpTools(registry: RuntimeToolRegistry, catalog: McpServerCatalogPort, client: McpClientLike, ctx: {
|
|
44
44
|
tenantId: string;
|
|
45
45
|
plan?: string;
|
|
46
46
|
}): Promise<ActivateMcpToolsResult>;
|
package/dist/mcp-bridge.js
CHANGED
package/dist/model.js
CHANGED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { TurnUsage } from './model.js';
|
|
2
|
+
|
|
3
|
+
interface BudgetCap {
|
|
4
|
+
readonly durationMs: number;
|
|
5
|
+
readonly costUsd: number;
|
|
6
|
+
readonly tokenLimit: number;
|
|
7
|
+
}
|
|
8
|
+
/** Thinking/reasoning effort for a node (maps to provider reasoning controls). */
|
|
9
|
+
type ReasoningEffort = "low" | "medium" | "high" | "xhigh";
|
|
10
|
+
/** Output modality a node produces. Mirrors @nebutra/ai-providers ModelModality. */
|
|
11
|
+
type ModelModality = "text" | "image" | "video" | "audio" | "embedding";
|
|
12
|
+
/**
|
|
13
|
+
* Per-node model selection — the full model meta-info a node can declare. ALL
|
|
14
|
+
* fields optional; an unset field inherits the run-level default
|
|
15
|
+
* (WorkflowDefinition.defaultModel / runTurn config). The executor resolves
|
|
16
|
+
* these HINTS against @nebutra/ai-providers/catalog (listModelsByModality /
|
|
17
|
+
* resolveFrontierModel) to a concrete model — so a node can either PIN one
|
|
18
|
+
* (`id`) or DESCRIBE what it needs ("the latest fast text model with vision").
|
|
19
|
+
*/
|
|
20
|
+
interface NodeModelSpec {
|
|
21
|
+
/** Explicit pin: preset alias (`flagship`/`reasoning`/`fast`) or `provider/model` id. */
|
|
22
|
+
readonly id?: string;
|
|
23
|
+
/** Thinking effort: `low` → cheap/quick, `xhigh` → deepest reasoning. */
|
|
24
|
+
readonly reasoningEffort?: ReasoningEffort;
|
|
25
|
+
/** Output modality — selects a model of this modality when `id` is unset. */
|
|
26
|
+
readonly modality?: ModelModality;
|
|
27
|
+
/** Capabilities the selected model MUST have (e.g. a node needing image input). */
|
|
28
|
+
readonly capabilities?: {
|
|
29
|
+
readonly vision?: boolean;
|
|
30
|
+
readonly toolCall?: boolean;
|
|
31
|
+
readonly reasoning?: boolean;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
interface Brief {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly objective: string;
|
|
37
|
+
readonly outputFormat: Record<string, unknown>;
|
|
38
|
+
readonly allowedTools: readonly string[];
|
|
39
|
+
readonly contextRefs: readonly string[];
|
|
40
|
+
readonly boundaries: readonly string[];
|
|
41
|
+
readonly budget: BudgetCap;
|
|
42
|
+
readonly dependsOn?: readonly string[];
|
|
43
|
+
/** Per-node model meta-info (id/preset · thinking effort · modality · capabilities). */
|
|
44
|
+
readonly model?: NodeModelSpec;
|
|
45
|
+
}
|
|
46
|
+
type DispatchStrategy = "auto" | "sequential" | "fanout";
|
|
47
|
+
interface DispatchPlan {
|
|
48
|
+
readonly strategy: Exclude<DispatchStrategy, "auto">;
|
|
49
|
+
readonly order: readonly Brief[];
|
|
50
|
+
}
|
|
51
|
+
interface DispatchPlanOptions {
|
|
52
|
+
readonly strategy?: DispatchStrategy;
|
|
53
|
+
}
|
|
54
|
+
interface SubagentResult {
|
|
55
|
+
readonly briefId: string;
|
|
56
|
+
readonly output: unknown;
|
|
57
|
+
readonly usage: TurnUsage;
|
|
58
|
+
readonly durationMs: number;
|
|
59
|
+
}
|
|
60
|
+
interface SubagentCostReport {
|
|
61
|
+
readonly totalInputTokens: number;
|
|
62
|
+
readonly totalOutputTokens: number;
|
|
63
|
+
readonly totalReasoningTokens: number;
|
|
64
|
+
readonly maxDurationMs: number;
|
|
65
|
+
readonly subagents: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Dependency-resolved execution WAVES — the agent node-topology scheduler. Each
|
|
69
|
+
* wave is the set of briefs whose dependencies are satisfied by earlier waves;
|
|
70
|
+
* waves run in order, briefs within a wave run in parallel. Input order is
|
|
71
|
+
* preserved within a wave.
|
|
72
|
+
*/
|
|
73
|
+
declare function planWaves(briefs: readonly Brief[]): readonly (readonly Brief[])[];
|
|
74
|
+
declare function planSubagentDispatch(briefs: readonly Brief[], options?: DispatchPlanOptions): DispatchPlan;
|
|
75
|
+
declare function fanOutSubagents(briefs: readonly Brief[], run: (brief: Brief) => Promise<SubagentResult>): Promise<readonly SubagentResult[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Execute briefs as a dependency graph: each wave runs in parallel, waves run
|
|
78
|
+
* sequentially. The node-topology execution path — `fanOutSubagents` is the
|
|
79
|
+
* degenerate single-wave (all-independent) case of this.
|
|
80
|
+
*/
|
|
81
|
+
declare function runAgentWaves(briefs: readonly Brief[], run: (brief: Brief) => Promise<SubagentResult>): Promise<readonly SubagentResult[]>;
|
|
82
|
+
declare function costReport(results: readonly SubagentResult[]): SubagentCostReport;
|
|
83
|
+
|
|
84
|
+
export { type Brief, type BudgetCap, type DispatchPlan, type DispatchPlanOptions, type DispatchStrategy, type ModelModality, type NodeModelSpec, type ReasoningEffort, type SubagentCostReport, type SubagentResult, costReport, fanOutSubagents, planSubagentDispatch, planWaves, runAgentWaves };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
costReport,
|
|
3
|
+
fanOutSubagents,
|
|
4
|
+
planSubagentDispatch,
|
|
5
|
+
planWaves,
|
|
6
|
+
runAgentWaves
|
|
7
|
+
} from "./chunk-Q62VKHIT.js";
|
|
8
|
+
import "./chunk-424PT5DM.js";
|
|
9
|
+
export {
|
|
10
|
+
costReport,
|
|
11
|
+
fanOutSubagents,
|
|
12
|
+
planSubagentDispatch,
|
|
13
|
+
planWaves,
|
|
14
|
+
runAgentWaves
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=orchestration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/policy.js
CHANGED
package/dist/protocol.js
CHANGED
package/dist/pulsar.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ModelInvoker, ApprovalGate } from './loop.js';
|
|
2
|
+
import { TurnConfig, ThreadEvent } from './model.js';
|
|
3
|
+
import { ApprovalPolicy } from './policy.js';
|
|
4
|
+
import { RolloutStore } from './rollout.js';
|
|
5
|
+
import { RuntimeToolRegistry } from './tools.js';
|
|
6
|
+
import './protocol.js';
|
|
7
|
+
import 'zod';
|
|
8
|
+
|
|
9
|
+
type EventLogKind = "llm_call" | "tool_call" | "sub_agent_call" | "content_write";
|
|
10
|
+
interface PulsarEventInput {
|
|
11
|
+
readonly traceId: string;
|
|
12
|
+
readonly kind: EventLogKind;
|
|
13
|
+
readonly affected: readonly string[];
|
|
14
|
+
readonly parent: string | null;
|
|
15
|
+
readonly snapshot?: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
interface PulsarBranchRecord {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly from: string;
|
|
20
|
+
readonly at: string;
|
|
21
|
+
}
|
|
22
|
+
interface PulsarEventLogPort {
|
|
23
|
+
commit(event: PulsarEventInput): Promise<string>;
|
|
24
|
+
branchFrom(id: string, name: string): Promise<PulsarBranchRecord>;
|
|
25
|
+
}
|
|
26
|
+
interface StartThreadOptions {
|
|
27
|
+
readonly threadId?: string;
|
|
28
|
+
readonly maxSteps?: number;
|
|
29
|
+
}
|
|
30
|
+
interface PulsarDeps {
|
|
31
|
+
readonly tenantId: string;
|
|
32
|
+
readonly config: TurnConfig;
|
|
33
|
+
readonly model: ModelInvoker;
|
|
34
|
+
readonly tools: RuntimeToolRegistry;
|
|
35
|
+
readonly store: RolloutStore;
|
|
36
|
+
readonly approvalGate: ApprovalGate;
|
|
37
|
+
readonly approvalPolicy: ApprovalPolicy;
|
|
38
|
+
readonly eventLog?: PulsarEventLogPort;
|
|
39
|
+
}
|
|
40
|
+
declare class PulsarThread {
|
|
41
|
+
#private;
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly playId: string;
|
|
44
|
+
readonly tenantId: string;
|
|
45
|
+
constructor(input: {
|
|
46
|
+
readonly id: string;
|
|
47
|
+
readonly playId: string;
|
|
48
|
+
readonly tenantId: string;
|
|
49
|
+
readonly deps: PulsarDeps;
|
|
50
|
+
readonly mode: "start" | "resume";
|
|
51
|
+
readonly userInput: string;
|
|
52
|
+
readonly maxSteps?: number;
|
|
53
|
+
});
|
|
54
|
+
subscribe(): AsyncGenerator<ThreadEvent>;
|
|
55
|
+
}
|
|
56
|
+
declare class PulsarBuilder {
|
|
57
|
+
#private;
|
|
58
|
+
withTenant(tenantId: string): this;
|
|
59
|
+
withConfig(config: TurnConfig): this;
|
|
60
|
+
withModel(model: ModelInvoker): this;
|
|
61
|
+
withTools(tools: RuntimeToolRegistry): this;
|
|
62
|
+
withRolloutStore(store: RolloutStore): this;
|
|
63
|
+
withApprovalGate(approvalGate: ApprovalGate): this;
|
|
64
|
+
withApprovalPolicy(policy: ApprovalPolicy): this;
|
|
65
|
+
withEventLog(eventLog: PulsarEventLogPort): this;
|
|
66
|
+
build(): Pulsar;
|
|
67
|
+
}
|
|
68
|
+
declare class Pulsar {
|
|
69
|
+
#private;
|
|
70
|
+
static readonly itemCommitIds: Map<string, string>;
|
|
71
|
+
constructor(deps: PulsarDeps);
|
|
72
|
+
static builder(): PulsarBuilder;
|
|
73
|
+
startPlay(playId: string, input: string, options?: StartThreadOptions): Promise<PulsarThread>;
|
|
74
|
+
resume(threadId: string): Promise<PulsarThread>;
|
|
75
|
+
branchFromItem(threadId: string, itemId: string, name: string): Promise<PulsarBranchRecord>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { Pulsar, type PulsarBranchRecord, PulsarBuilder, type PulsarDeps, type PulsarEventInput, type PulsarEventLogPort, PulsarThread, type StartThreadOptions };
|
package/dist/pulsar.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Pulsar,
|
|
3
|
+
PulsarBuilder,
|
|
4
|
+
PulsarThread
|
|
5
|
+
} from "./chunk-KCNN4QUQ.js";
|
|
6
|
+
import "./chunk-D4YAPLOW.js";
|
|
7
|
+
import "./chunk-37BBB2P2.js";
|
|
8
|
+
import "./chunk-4Y25ZTKI.js";
|
|
9
|
+
import "./chunk-6EGG2OZC.js";
|
|
10
|
+
import "./chunk-CGRCUKGT.js";
|
|
11
|
+
import "./chunk-424PT5DM.js";
|
|
12
|
+
export {
|
|
13
|
+
Pulsar,
|
|
14
|
+
PulsarBuilder,
|
|
15
|
+
PulsarThread
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=pulsar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/rollout.js
CHANGED
package/dist/sandbox.js
CHANGED
package/dist/skills.js
CHANGED
package/dist/subagents.js
CHANGED
package/dist/tools.d.ts
CHANGED
|
@@ -46,16 +46,17 @@ interface ToolHooks {
|
|
|
46
46
|
readonly postToolUse?: (name: string, output: unknown, ctx: ToolDispatchContext) => Promise<void>;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* registry -> router -> orchestrator pipeline. MCP tools register via
|
|
49
|
+
* runtime registry -> router -> orchestrator pipeline. MCP tools register via
|
|
50
50
|
* {@link adaptMcpTool} and are dispatched identically to native tools.
|
|
51
51
|
*/
|
|
52
|
-
declare class
|
|
52
|
+
declare class RuntimeToolRegistry {
|
|
53
53
|
#private;
|
|
54
54
|
constructor(hooks?: ToolHooks);
|
|
55
55
|
register<I, O>(definition: ToolDefinition<I, O>, handler: ToolHandler<I, O>, origin?: ToolOrigin): void;
|
|
56
56
|
list(): readonly RegisteredTool[];
|
|
57
57
|
dispatch(name: string, rawInput: unknown, ctx: ToolDispatchContext): Promise<unknown>;
|
|
58
58
|
}
|
|
59
|
+
|
|
59
60
|
/** Minimal shape of an MCP client (satisfied by `@nebutra/mcp`'s `mcpClient`). */
|
|
60
61
|
interface McpClientLike {
|
|
61
62
|
executeTool(name: string, args: unknown, ctx: {
|
|
@@ -74,4 +75,4 @@ declare function adaptMcpTool(server: string, definition: ToolDefinition, client
|
|
|
74
75
|
origin: ToolOrigin;
|
|
75
76
|
};
|
|
76
77
|
|
|
77
|
-
export { type McpClientLike, type RegisteredTool, type ToolDefinition, type ToolDispatchContext, type ToolHandler, type ToolHooks, type ToolOrigin, ToolRegistry, adaptMcpTool };
|
|
78
|
+
export { type McpClientLike, type RegisteredTool, RuntimeToolRegistry, type ToolDefinition, type ToolDispatchContext, type ToolHandler, type ToolHooks, type ToolOrigin, RuntimeToolRegistry as ToolRegistry, adaptMcpTool };
|
package/dist/tools.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
RuntimeToolRegistry,
|
|
3
3
|
adaptMcpTool
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4Y25ZTKI.js";
|
|
5
|
+
import "./chunk-424PT5DM.js";
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
RuntimeToolRegistry,
|
|
8
|
+
RuntimeToolRegistry as ToolRegistry,
|
|
7
9
|
adaptMcpTool
|
|
8
10
|
};
|
|
9
11
|
//# sourceMappingURL=tools.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebutra/agent-runtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,44 +14,98 @@
|
|
|
14
14
|
"gaps": [
|
|
15
15
|
"Track-B kernel sidecar transport not yet wired",
|
|
16
16
|
"Durable-turn queue binding is interface-only",
|
|
17
|
-
"Rollout store backed by in-memory reference impl only"
|
|
17
|
+
"Rollout store backed by in-memory reference impl only",
|
|
18
|
+
"Pulsar facade is runnable but still delegates model execution through injected ports"
|
|
18
19
|
],
|
|
19
20
|
"featureId": "agent-runtime",
|
|
20
21
|
"category": "ai",
|
|
22
|
+
"surface": "agent-runtime",
|
|
21
23
|
"summary": "Multi-tenant agent-runtime grammar: thread/turn/item model, approval+capability policy, tool/MCP abstraction, event-sourced rollout, external-sandbox delegation seam"
|
|
22
24
|
},
|
|
23
|
-
"main": "./
|
|
24
|
-
"types": "./
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
25
27
|
"exports": {
|
|
26
|
-
".":
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"./
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"./
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./model": {
|
|
34
|
+
"types": "./dist/model.d.ts",
|
|
35
|
+
"import": "./dist/model.js",
|
|
36
|
+
"default": "./dist/model.js"
|
|
37
|
+
},
|
|
38
|
+
"./protocol": {
|
|
39
|
+
"types": "./dist/protocol.d.ts",
|
|
40
|
+
"import": "./dist/protocol.js",
|
|
41
|
+
"default": "./dist/protocol.js"
|
|
42
|
+
},
|
|
43
|
+
"./pulsar": {
|
|
44
|
+
"types": "./dist/pulsar.d.ts",
|
|
45
|
+
"import": "./dist/pulsar.js",
|
|
46
|
+
"default": "./dist/pulsar.js"
|
|
47
|
+
},
|
|
48
|
+
"./orchestration": {
|
|
49
|
+
"types": "./dist/orchestration.d.ts",
|
|
50
|
+
"import": "./dist/orchestration.js",
|
|
51
|
+
"default": "./dist/orchestration.js"
|
|
52
|
+
},
|
|
53
|
+
"./policy": {
|
|
54
|
+
"types": "./dist/policy.d.ts",
|
|
55
|
+
"import": "./dist/policy.js",
|
|
56
|
+
"default": "./dist/policy.js"
|
|
57
|
+
},
|
|
58
|
+
"./tools": {
|
|
59
|
+
"types": "./dist/tools.d.ts",
|
|
60
|
+
"import": "./dist/tools.js",
|
|
61
|
+
"default": "./dist/tools.js"
|
|
62
|
+
},
|
|
63
|
+
"./rollout": {
|
|
64
|
+
"types": "./dist/rollout.d.ts",
|
|
65
|
+
"import": "./dist/rollout.js",
|
|
66
|
+
"default": "./dist/rollout.js"
|
|
67
|
+
},
|
|
68
|
+
"./sandbox": {
|
|
69
|
+
"types": "./dist/sandbox.d.ts",
|
|
70
|
+
"import": "./dist/sandbox.js",
|
|
71
|
+
"default": "./dist/sandbox.js"
|
|
72
|
+
},
|
|
73
|
+
"./adapters": {
|
|
74
|
+
"types": "./dist/adapters/index.d.ts",
|
|
75
|
+
"import": "./dist/adapters/index.js",
|
|
76
|
+
"default": "./dist/adapters/index.js"
|
|
77
|
+
},
|
|
78
|
+
"./adapters/mcp-catalog": {
|
|
79
|
+
"types": "./dist/adapters/mcp-catalog.d.ts",
|
|
80
|
+
"import": "./dist/adapters/mcp-catalog.js",
|
|
81
|
+
"default": "./dist/adapters/mcp-catalog.js"
|
|
82
|
+
},
|
|
83
|
+
"./adapters/dispatcher-sse": {
|
|
84
|
+
"types": "./dist/adapters/dispatcher-sse.d.ts",
|
|
85
|
+
"import": "./dist/adapters/dispatcher-sse.js",
|
|
86
|
+
"default": "./dist/adapters/dispatcher-sse.js"
|
|
87
|
+
},
|
|
88
|
+
"./adapters/prisma-rollout": {
|
|
89
|
+
"types": "./dist/adapters/prisma-rollout.d.ts",
|
|
90
|
+
"import": "./dist/adapters/prisma-rollout.js",
|
|
91
|
+
"default": "./dist/adapters/prisma-rollout.js"
|
|
92
|
+
}
|
|
37
93
|
},
|
|
38
94
|
"dependencies": {
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"@nebutra/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"@nebutra/
|
|
46
|
-
|
|
47
|
-
}
|
|
95
|
+
"p-limit": "^7.3.0",
|
|
96
|
+
"zod": "^4.3.6",
|
|
97
|
+
"@nebutra/agents": "1.1.2",
|
|
98
|
+
"@nebutra/ai-primitives": "0.1.2",
|
|
99
|
+
"@nebutra/graph-model": "0.2.2",
|
|
100
|
+
"@nebutra/mcp": "0.1.3",
|
|
101
|
+
"@nebutra/capability-kit": "0.2.2",
|
|
102
|
+
"@nebutra/execution-policy": "0.1.2"
|
|
48
103
|
},
|
|
49
104
|
"devDependencies": {
|
|
50
|
-
"@types/node": "^
|
|
105
|
+
"@types/node": "^25.9.1",
|
|
51
106
|
"tsup": "^8.5.1",
|
|
52
107
|
"typescript": "^5.9.3",
|
|
53
|
-
"vitest": "^4.0.18"
|
|
54
|
-
"@nebutra/mcp": "0.1.1"
|
|
108
|
+
"vitest": "^4.0.18"
|
|
55
109
|
},
|
|
56
110
|
"homepage": "https://github.com/Nebutra/Nebutra-Sailor/tree/main/packages/ai/agent-runtime#readme",
|
|
57
111
|
"repository": {
|
|
@@ -65,6 +119,9 @@
|
|
|
65
119
|
"publishConfig": {
|
|
66
120
|
"access": "public"
|
|
67
121
|
},
|
|
122
|
+
"files": [
|
|
123
|
+
"dist"
|
|
124
|
+
],
|
|
68
125
|
"scripts": {
|
|
69
126
|
"build": "tsup",
|
|
70
127
|
"dev": "tsup --watch",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @nebutra/agent-runtime@0.2.0 build /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/ai/agent-runtime
|
|
3
|
-
> tsup
|
|
4
|
-
|
|
5
|
-
[34mCLI[39m Building entry: {"index":"src/index.ts","adapters/index":"src/adapters/index.ts","adapters/dispatcher-sse":"src/adapters/dispatcher-sse.ts","adapters/mcp-catalog":"src/adapters/mcp-catalog.ts","adapters/prisma-rollout":"src/adapters/prisma-rollout.ts","commands":"src/commands.ts","definitions":"src/definitions.ts","dispatcher":"src/dispatcher.ts","durable-turn":"src/durable-turn.ts","hook-pipeline":"src/hook-pipeline.ts","loop":"src/loop.ts","mcp-bridge":"src/mcp-bridge.ts","model":"src/model.ts","policy":"src/policy.ts","protocol":"src/protocol.ts","rollout":"src/rollout.ts","rollout-store-persistent":"src/rollout-store-persistent.ts","sandbox":"src/sandbox.ts","skills":"src/skills.ts","subagents":"src/subagents.ts","tools":"src/tools.ts"}
|
|
6
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.5.1
|
|
8
|
-
[34mCLI[39m Using tsup config: /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/ai/agent-runtime/tsup.config.ts
|
|
9
|
-
[34mCLI[39m Target: es2022
|
|
10
|
-
[34mCLI[39m Cleaning output folder
|
|
11
|
-
[34mESM[39m Build start
|
|
12
|
-
[32mESM[39m [1mdist/rollout-store-persistent.js [22m[32m189.00 B[39m
|
|
13
|
-
[32mESM[39m [1mdist/adapters/index.js [22m[32m449.00 B[39m
|
|
14
|
-
[32mESM[39m [1mdist/sandbox.js [22m[32m318.00 B[39m
|
|
15
|
-
[32mESM[39m [1mdist/skills.js [22m[32m185.00 B[39m
|
|
16
|
-
[32mESM[39m [1mdist/subagents.js [22m[32m374.00 B[39m
|
|
17
|
-
[32mESM[39m [1mdist/tools.js [22m[32m146.00 B[39m
|
|
18
|
-
[32mESM[39m [1mdist/durable-turn.js [22m[32m191.00 B[39m
|
|
19
|
-
[32mESM[39m [1mdist/hook-pipeline.js [22m[32m214.00 B[39m
|
|
20
|
-
[32mESM[39m [1mdist/loop.js [22m[32m163.00 B[39m
|
|
21
|
-
[32mESM[39m [1mdist/mcp-bridge.js [22m[32m157.00 B[39m
|
|
22
|
-
[32mESM[39m [1mdist/model.js [22m[32m156.00 B[39m
|
|
23
|
-
[32mESM[39m [1mdist/policy.js [22m[32m497.00 B[39m
|
|
24
|
-
[32mESM[39m [1mdist/protocol.js [22m[32m263.00 B[39m
|
|
25
|
-
[32mESM[39m [1mdist/rollout.js [22m[32m286.00 B[39m
|
|
26
|
-
[32mESM[39m [1mdist/index.js [22m[32m93.88 KB[39m
|
|
27
|
-
[32mESM[39m [1mdist/chunk-2DA6Q6TN.js [22m[32m3.42 KB[39m
|
|
28
|
-
[32mESM[39m [1mdist/chunk-MUF7ZZTO.js [22m[32m1.62 KB[39m
|
|
29
|
-
[32mESM[39m [1mdist/chunk-ZMYX5VBU.js [22m[32m4.14 KB[39m
|
|
30
|
-
[32mESM[39m [1mdist/chunk-5N4644PB.js [22m[32m1.92 KB[39m
|
|
31
|
-
[32mESM[39m [1mdist/chunk-5YS7WAPS.js [22m[32m5.67 KB[39m
|
|
32
|
-
[32mESM[39m [1mdist/chunk-BJBBR3QA.js [22m[32m4.19 KB[39m
|
|
33
|
-
[32mESM[39m [1mdist/chunk-LO24VOA3.js [22m[32m6.31 KB[39m
|
|
34
|
-
[32mESM[39m [1mdist/chunk-PGGWSUTM.js [22m[32m1.00 KB[39m
|
|
35
|
-
[32mESM[39m [1mdist/chunk-NN7DATXA.js [22m[32m1.38 KB[39m
|
|
36
|
-
[32mESM[39m [1mdist/chunk-6EGG2OZC.js [22m[32m324.00 B[39m
|
|
37
|
-
[32mESM[39m [1mdist/chunk-CGRCUKGT.js [22m[32m2.38 KB[39m
|
|
38
|
-
[32mESM[39m [1mdist/chunk-37BBB2P2.js [22m[32m2.19 KB[39m
|
|
39
|
-
[32mESM[39m [1mdist/adapters/dispatcher-sse.js [22m[32m214.00 B[39m
|
|
40
|
-
[32mESM[39m [1mdist/chunk-ZTSKS42I.js [22m[32m3.65 KB[39m
|
|
41
|
-
[32mESM[39m [1mdist/adapters/mcp-catalog.js [22m[32m187.00 B[39m
|
|
42
|
-
[32mESM[39m [1mdist/chunk-24ZXP7FI.js [22m[32m2.47 KB[39m
|
|
43
|
-
[32mESM[39m [1mdist/adapters/prisma-rollout.js [22m[32m160.00 B[39m
|
|
44
|
-
[32mESM[39m [1mdist/chunk-57W3AR43.js [22m[32m1.55 KB[39m
|
|
45
|
-
[32mESM[39m [1mdist/commands.js [22m[32m187.00 B[39m
|
|
46
|
-
[32mESM[39m [1mdist/chunk-YYFPDBJG.js [22m[32m1.86 KB[39m
|
|
47
|
-
[32mESM[39m [1mdist/definitions.js [22m[32m292.00 B[39m
|
|
48
|
-
[32mESM[39m [1mdist/chunk-7BUOF367.js [22m[32m4.13 KB[39m
|
|
49
|
-
[32mESM[39m [1mdist/dispatcher.js [22m[32m161.00 B[39m
|
|
50
|
-
[32mESM[39m [1mdist/chunk-RDKYDMXT.js [22m[32m4.08 KB[39m
|
|
51
|
-
[32mESM[39m [1mdist/chunk-FUG5DT2C.js [22m[32m2.45 KB[39m
|
|
52
|
-
[32mESM[39m [1mdist/rollout-store-persistent.js.map [22m[32m71.00 B[39m
|
|
53
|
-
[32mESM[39m [1mdist/adapters/index.js.map [22m[32m71.00 B[39m
|
|
54
|
-
[32mESM[39m [1mdist/sandbox.js.map [22m[32m71.00 B[39m
|
|
55
|
-
[32mESM[39m [1mdist/skills.js.map [22m[32m71.00 B[39m
|
|
56
|
-
[32mESM[39m [1mdist/subagents.js.map [22m[32m71.00 B[39m
|
|
57
|
-
[32mESM[39m [1mdist/tools.js.map [22m[32m71.00 B[39m
|
|
58
|
-
[32mESM[39m [1mdist/durable-turn.js.map [22m[32m71.00 B[39m
|
|
59
|
-
[32mESM[39m [1mdist/hook-pipeline.js.map [22m[32m71.00 B[39m
|
|
60
|
-
[32mESM[39m [1mdist/loop.js.map [22m[32m71.00 B[39m
|
|
61
|
-
[32mESM[39m [1mdist/mcp-bridge.js.map [22m[32m71.00 B[39m
|
|
62
|
-
[32mESM[39m [1mdist/model.js.map [22m[32m71.00 B[39m
|
|
63
|
-
[32mESM[39m [1mdist/policy.js.map [22m[32m71.00 B[39m
|
|
64
|
-
[32mESM[39m [1mdist/protocol.js.map [22m[32m71.00 B[39m
|
|
65
|
-
[32mESM[39m [1mdist/rollout.js.map [22m[32m71.00 B[39m
|
|
66
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m251.69 KB[39m
|
|
67
|
-
[32mESM[39m [1mdist/chunk-2DA6Q6TN.js.map [22m[32m8.01 KB[39m
|
|
68
|
-
[32mESM[39m [1mdist/chunk-MUF7ZZTO.js.map [22m[32m4.91 KB[39m
|
|
69
|
-
[32mESM[39m [1mdist/chunk-ZMYX5VBU.js.map [22m[32m12.29 KB[39m
|
|
70
|
-
[32mESM[39m [1mdist/chunk-5N4644PB.js.map [22m[32m6.73 KB[39m
|
|
71
|
-
[32mESM[39m [1mdist/chunk-5YS7WAPS.js.map [22m[32m15.75 KB[39m
|
|
72
|
-
[32mESM[39m [1mdist/chunk-BJBBR3QA.js.map [22m[32m10.81 KB[39m
|
|
73
|
-
[32mESM[39m [1mdist/chunk-LO24VOA3.js.map [22m[32m17.32 KB[39m
|
|
74
|
-
[32mESM[39m [1mdist/chunk-PGGWSUTM.js.map [22m[32m3.50 KB[39m
|
|
75
|
-
[32mESM[39m [1mdist/chunk-NN7DATXA.js.map [22m[32m5.34 KB[39m
|
|
76
|
-
[32mESM[39m [1mdist/chunk-6EGG2OZC.js.map [22m[32m5.96 KB[39m
|
|
77
|
-
[32mESM[39m [1mdist/chunk-CGRCUKGT.js.map [22m[32m7.65 KB[39m
|
|
78
|
-
[32mESM[39m [1mdist/chunk-37BBB2P2.js.map [22m[32m6.88 KB[39m
|
|
79
|
-
[32mESM[39m [1mdist/adapters/dispatcher-sse.js.map [22m[32m71.00 B[39m
|
|
80
|
-
[32mESM[39m [1mdist/chunk-ZTSKS42I.js.map [22m[32m10.83 KB[39m
|
|
81
|
-
[32mESM[39m [1mdist/adapters/mcp-catalog.js.map [22m[32m71.00 B[39m
|
|
82
|
-
[32mESM[39m [1mdist/chunk-24ZXP7FI.js.map [22m[32m8.26 KB[39m
|
|
83
|
-
[32mESM[39m [1mdist/adapters/prisma-rollout.js.map [22m[32m71.00 B[39m
|
|
84
|
-
[32mESM[39m [1mdist/chunk-57W3AR43.js.map [22m[32m4.88 KB[39m
|
|
85
|
-
[32mESM[39m [1mdist/commands.js.map [22m[32m71.00 B[39m
|
|
86
|
-
[32mESM[39m [1mdist/chunk-YYFPDBJG.js.map [22m[32m6.97 KB[39m
|
|
87
|
-
[32mESM[39m [1mdist/definitions.js.map [22m[32m71.00 B[39m
|
|
88
|
-
[32mESM[39m [1mdist/chunk-7BUOF367.js.map [22m[32m10.17 KB[39m
|
|
89
|
-
[32mESM[39m [1mdist/dispatcher.js.map [22m[32m71.00 B[39m
|
|
90
|
-
[32mESM[39m [1mdist/chunk-RDKYDMXT.js.map [22m[32m8.81 KB[39m
|
|
91
|
-
[32mESM[39m [1mdist/chunk-FUG5DT2C.js.map [22m[32m7.87 KB[39m
|
|
92
|
-
[32mESM[39m ⚡️ Build success in 132ms
|
|
93
|
-
[34mDTS[39m Build start
|
|
94
|
-
[32mDTS[39m ⚡️ Build success in 8571ms
|
|
95
|
-
[32mDTS[39m [1mdist/adapters/index.d.ts [22m[32m581.00 B[39m
|
|
96
|
-
[32mDTS[39m [1mdist/adapters/dispatcher-sse.d.ts [22m[32m3.18 KB[39m
|
|
97
|
-
[32mDTS[39m [1mdist/adapters/mcp-catalog.d.ts [22m[32m2.77 KB[39m
|
|
98
|
-
[32mDTS[39m [1mdist/adapters/prisma-rollout.d.ts [22m[32m2.10 KB[39m
|
|
99
|
-
[32mDTS[39m [1mdist/commands.d.ts [22m[32m3.64 KB[39m
|
|
100
|
-
[32mDTS[39m [1mdist/dispatcher.d.ts [22m[32m1.91 KB[39m
|
|
101
|
-
[32mDTS[39m [1mdist/durable-turn.d.ts [22m[32m2.55 KB[39m
|
|
102
|
-
[32mDTS[39m [1mdist/hook-pipeline.d.ts [22m[32m5.33 KB[39m
|
|
103
|
-
[32mDTS[39m [1mdist/loop.d.ts [22m[32m3.15 KB[39m
|
|
104
|
-
[32mDTS[39m [1mdist/mcp-bridge.d.ts [22m[32m1.89 KB[39m
|
|
105
|
-
[32mDTS[39m [1mdist/protocol.d.ts [22m[32m5.32 KB[39m
|
|
106
|
-
[32mDTS[39m [1mdist/rollout-store-persistent.d.ts [22m[32m1.77 KB[39m
|
|
107
|
-
[32mDTS[39m [1mdist/rollout.d.ts [22m[32m3.28 KB[39m
|
|
108
|
-
[32mDTS[39m [1mdist/sandbox.d.ts [22m[32m2.80 KB[39m
|
|
109
|
-
[32mDTS[39m [1mdist/policy.d.ts [22m[32m5.59 KB[39m
|
|
110
|
-
[32mDTS[39m [1mdist/skills.d.ts [22m[32m4.40 KB[39m
|
|
111
|
-
[32mDTS[39m [1mdist/subagents.d.ts [22m[32m5.74 KB[39m
|
|
112
|
-
[32mDTS[39m [1mdist/model.d.ts [22m[32m5.79 KB[39m
|
|
113
|
-
[32mDTS[39m [1mdist/definitions.d.ts [22m[32m3.96 KB[39m
|
|
114
|
-
[32mDTS[39m [1mdist/tools.d.ts [22m[32m2.95 KB[39m
|
|
115
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m86.35 KB[39m
|