@action-llama/action-llama 0.27.5 → 0.29.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/agents/credential-setup.d.ts +0 -1
- package/dist/agents/credential-setup.d.ts.map +1 -1
- package/dist/agents/credential-setup.js +2 -23
- package/dist/agents/credential-setup.js.map +1 -1
- package/dist/agents/prompt.d.ts.map +1 -1
- package/dist/agents/prompt.js +12 -50
- package/dist/agents/prompt.js.map +1 -1
- package/dist/agents/scheduler-tools.d.ts +47 -0
- package/dist/agents/scheduler-tools.d.ts.map +1 -0
- package/dist/agents/scheduler-tools.js +276 -0
- package/dist/agents/scheduler-tools.js.map +1 -0
- package/dist/agents/status-reporter.d.ts +1 -1
- package/dist/agents/status-reporter.js +1 -1
- package/dist/agents/transport-runner.d.ts +123 -0
- package/dist/agents/transport-runner.d.ts.map +1 -0
- package/dist/agents/transport-runner.js +791 -0
- package/dist/agents/transport-runner.js.map +1 -0
- package/dist/build-info.json +1 -1
- package/dist/cli/commands/add.d.ts +1 -0
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/add.js +24 -9
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/agent.d.ts +0 -3
- package/dist/cli/commands/agent.d.ts.map +1 -1
- package/dist/cli/commands/agent.js +3 -67
- package/dist/cli/commands/agent.js.map +1 -1
- package/dist/cli/commands/logs.d.ts.map +1 -1
- package/dist/cli/commands/logs.js +51 -339
- package/dist/cli/commands/logs.js.map +1 -1
- package/dist/cli/main.js +1 -30
- package/dist/cli/main.js.map +1 -1
- package/dist/control/routes/dashboard-api.d.ts.map +1 -1
- package/dist/control/routes/dashboard-api.js +3 -2
- package/dist/control/routes/dashboard-api.js.map +1 -1
- package/dist/control/routes/log-helpers.d.ts +4 -4
- package/dist/control/routes/log-helpers.d.ts.map +1 -1
- package/dist/control/routes/log-helpers.js +12 -7
- package/dist/control/routes/log-helpers.js.map +1 -1
- package/dist/control/routes/logs.d.ts.map +1 -1
- package/dist/control/routes/logs.js +10 -10
- package/dist/control/routes/logs.js.map +1 -1
- package/dist/control/session-store.js +1 -1
- package/dist/control/session-store.js.map +1 -1
- package/dist/docker/image.d.ts +26 -12
- package/dist/docker/image.d.ts.map +1 -1
- package/dist/docker/image.js +80 -88
- package/dist/docker/image.js.map +1 -1
- package/dist/docker/local-runtime.js +1 -1
- package/dist/docker/local-runtime.js.map +1 -1
- package/dist/docker/providers/index.d.ts +0 -4
- package/dist/docker/providers/index.d.ts.map +1 -1
- package/dist/docker/providers/index.js +0 -38
- package/dist/docker/providers/index.js.map +1 -1
- package/dist/docker/ssh-docker-runtime.js +1 -1
- package/dist/docker/ssh-docker-runtime.js.map +1 -1
- package/dist/execution/execution.d.ts +4 -2
- package/dist/execution/execution.d.ts.map +1 -1
- package/dist/execution/execution.js +14 -9
- package/dist/execution/execution.js.map +1 -1
- package/dist/execution/index.d.ts +1 -11
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +1 -8
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/lifecycle/agent-lifecycle.d.ts +7 -0
- package/dist/execution/lifecycle/agent-lifecycle.d.ts.map +1 -1
- package/dist/execution/lifecycle/agent-lifecycle.js +65 -5
- package/dist/execution/lifecycle/agent-lifecycle.js.map +1 -1
- package/dist/execution/lifecycle/index.d.ts +2 -2
- package/dist/execution/lifecycle/index.d.ts.map +1 -1
- package/dist/execution/lifecycle/index.js +4 -2
- package/dist/execution/lifecycle/index.js.map +1 -1
- package/dist/execution/lifecycle/instance-lifecycle.d.ts +24 -0
- package/dist/execution/lifecycle/instance-lifecycle.d.ts.map +1 -1
- package/dist/execution/lifecycle/instance-lifecycle.js +41 -3
- package/dist/execution/lifecycle/instance-lifecycle.js.map +1 -1
- package/dist/execution/runner-setup.d.ts +9 -11
- package/dist/execution/runner-setup.d.ts.map +1 -1
- package/dist/execution/runner-setup.js +19 -14
- package/dist/execution/runner-setup.js.map +1 -1
- package/dist/execution/runtime-factory.d.ts +1 -15
- package/dist/execution/runtime-factory.d.ts.map +1 -1
- package/dist/execution/runtime-factory.js +1 -18
- package/dist/execution/runtime-factory.js.map +1 -1
- package/dist/execution/waiting-registry.d.ts +84 -0
- package/dist/execution/waiting-registry.d.ts.map +1 -0
- package/dist/execution/waiting-registry.js +185 -0
- package/dist/execution/waiting-registry.js.map +1 -0
- package/dist/frontend/assets/index-Bij4b7-g.js +16 -0
- package/dist/frontend/assets/index-Bij4b7-g.js.map +1 -0
- package/dist/frontend/assets/index-D11bfFWQ.css +2 -0
- package/dist/frontend/index.html +2 -2
- package/dist/gateway/index.d.ts +1 -1
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +6 -47
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/routes/system.d.ts +1 -4
- package/dist/gateway/routes/system.d.ts.map +1 -1
- package/dist/gateway/routes/system.js +3 -8
- package/dist/gateway/routes/system.js.map +1 -1
- package/dist/gateway/stores.d.ts +0 -4
- package/dist/gateway/stores.d.ts.map +1 -1
- package/dist/gateway/stores.js +2 -10
- package/dist/gateway/stores.js.map +1 -1
- package/dist/gateway/types.d.ts +0 -13
- package/dist/gateway/types.d.ts.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +11 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/scheduler/gateway-setup.d.ts +0 -2
- package/dist/scheduler/gateway-setup.d.ts.map +1 -1
- package/dist/scheduler/gateway-setup.js +2 -11
- package/dist/scheduler/gateway-setup.js.map +1 -1
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +113 -55
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/scheduler/types.d.ts.map +1 -1
- package/dist/scheduler/validation.js +1 -1
- package/dist/scheduler/validation.js.map +1 -1
- package/dist/scheduler/watcher.d.ts +2 -8
- package/dist/scheduler/watcher.d.ts.map +1 -1
- package/dist/scheduler/watcher.js +7 -104
- package/dist/scheduler/watcher.js.map +1 -1
- package/dist/shared/config/load-agent.js +2 -2
- package/dist/shared/config/load-agent.js.map +1 -1
- package/dist/shared/config/load-project.js +2 -2
- package/dist/shared/config/load-project.js.map +1 -1
- package/dist/shared/config/types.d.ts +12 -2
- package/dist/shared/config/types.d.ts.map +1 -1
- package/dist/shared/constants.d.ts +3 -1
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/constants.js +4 -2
- package/dist/shared/constants.js.map +1 -1
- package/dist/shared/credential-refs.js +1 -1
- package/dist/shared/credential-refs.js.map +1 -1
- package/dist/shared/paths.d.ts.map +1 -1
- package/dist/shared/paths.js +2 -2
- package/dist/shared/paths.js.map +1 -1
- package/dist/shared/validation.js +1 -1
- package/dist/shared/validation.js.map +1 -1
- package/dist/transport/docker-exec.d.ts +41 -0
- package/dist/transport/docker-exec.d.ts.map +1 -0
- package/dist/transport/docker-exec.js +243 -0
- package/dist/transport/docker-exec.js.map +1 -0
- package/dist/transport/host-user.d.ts +37 -0
- package/dist/transport/host-user.d.ts.map +1 -0
- package/dist/transport/host-user.js +232 -0
- package/dist/transport/host-user.js.map +1 -0
- package/dist/transport/index.d.ts +8 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/dist/transport/index.js +7 -0
- package/dist/transport/index.js.map +1 -0
- package/dist/transport/memory.d.ts +36 -0
- package/dist/transport/memory.d.ts.map +1 -0
- package/dist/transport/memory.js +113 -0
- package/dist/transport/memory.js.map +1 -0
- package/dist/transport/operations.d.ts +68 -0
- package/dist/transport/operations.d.ts.map +1 -0
- package/dist/transport/operations.js +164 -0
- package/dist/transport/operations.js.map +1 -0
- package/dist/transport/ssh.d.ts +43 -0
- package/dist/transport/ssh.d.ts.map +1 -0
- package/dist/transport/ssh.js +225 -0
- package/dist/transport/ssh.js.map +1 -0
- package/dist/transport/transport.d.ts +61 -0
- package/dist/transport/transport.d.ts.map +1 -0
- package/dist/transport/transport.js +29 -0
- package/dist/transport/transport.js.map +1 -0
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +5 -4
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/status-tracker.d.ts +11 -2
- package/dist/tui/status-tracker.d.ts.map +1 -1
- package/dist/tui/status-tracker.js +44 -0
- package/dist/tui/status-tracker.js.map +1 -1
- package/package.json +7 -2
- package/dist/agents/bash-prefix.d.ts +0 -9
- package/dist/agents/bash-prefix.d.ts.map +0 -1
- package/dist/agents/bash-prefix.js +0 -25
- package/dist/agents/bash-prefix.js.map +0 -1
- package/dist/agents/container-entry.d.ts +0 -31
- package/dist/agents/container-entry.d.ts.map +0 -1
- package/dist/agents/container-entry.js +0 -302
- package/dist/agents/container-entry.js.map +0 -1
- package/dist/agents/container-runner.d.ts +0 -59
- package/dist/agents/container-runner.d.ts.map +0 -1
- package/dist/agents/container-runner.js +0 -472
- package/dist/agents/container-runner.js.map +0 -1
- package/dist/agents/harness/claude-cli-harness.d.ts +0 -15
- package/dist/agents/harness/claude-cli-harness.d.ts.map +0 -1
- package/dist/agents/harness/claude-cli-harness.js +0 -260
- package/dist/agents/harness/claude-cli-harness.js.map +0 -1
- package/dist/agents/harness/consumer.d.ts +0 -31
- package/dist/agents/harness/consumer.d.ts.map +0 -1
- package/dist/agents/harness/consumer.js +0 -165
- package/dist/agents/harness/consumer.js.map +0 -1
- package/dist/agents/harness/factory.d.ts +0 -9
- package/dist/agents/harness/factory.d.ts.map +0 -1
- package/dist/agents/harness/factory.js +0 -25
- package/dist/agents/harness/factory.js.map +0 -1
- package/dist/agents/harness/index.d.ts +0 -9
- package/dist/agents/harness/index.d.ts.map +0 -1
- package/dist/agents/harness/index.js +0 -5
- package/dist/agents/harness/index.js.map +0 -1
- package/dist/agents/harness/pi-harness.d.ts +0 -18
- package/dist/agents/harness/pi-harness.d.ts.map +0 -1
- package/dist/agents/harness/pi-harness.js +0 -278
- package/dist/agents/harness/pi-harness.js.map +0 -1
- package/dist/agents/harness/types.d.ts +0 -57
- package/dist/agents/harness/types.d.ts.map +0 -1
- package/dist/agents/harness/types.js +0 -2
- package/dist/agents/harness/types.js.map +0 -1
- package/dist/agents/session-loop.d.ts +0 -36
- package/dist/agents/session-loop.d.ts.map +0 -1
- package/dist/agents/session-loop.js +0 -216
- package/dist/agents/session-loop.js.map +0 -1
- package/dist/agents/signals.d.ts +0 -34
- package/dist/agents/signals.d.ts.map +0 -1
- package/dist/agents/signals.js +0 -122
- package/dist/agents/signals.js.map +0 -1
- package/dist/cli/commands/claude.d.ts +0 -4
- package/dist/cli/commands/claude.d.ts.map +0 -1
- package/dist/cli/commands/claude.js +0 -6
- package/dist/cli/commands/claude.js.map +0 -1
- package/dist/cli/commands/run-agent.d.ts +0 -14
- package/dist/cli/commands/run-agent.d.ts.map +0 -1
- package/dist/cli/commands/run-agent.js +0 -270
- package/dist/cli/commands/run-agent.js.map +0 -1
- package/dist/docker/cloud-run-runtime.d.ts +0 -48
- package/dist/docker/cloud-run-runtime.d.ts.map +0 -1
- package/dist/docker/cloud-run-runtime.js +0 -490
- package/dist/docker/cloud-run-runtime.js.map +0 -1
- package/dist/execution/call-dispatcher.d.ts +0 -11
- package/dist/execution/call-dispatcher.d.ts.map +0 -1
- package/dist/execution/call-dispatcher.js +0 -75
- package/dist/execution/call-dispatcher.js.map +0 -1
- package/dist/execution/container-registry.d.ts +0 -42
- package/dist/execution/container-registry.d.ts.map +0 -1
- package/dist/execution/container-registry.js +0 -76
- package/dist/execution/container-registry.js.map +0 -1
- package/dist/execution/image-builder.d.ts +0 -48
- package/dist/execution/image-builder.d.ts.map +0 -1
- package/dist/execution/image-builder.js +0 -155
- package/dist/execution/image-builder.js.map +0 -1
- package/dist/execution/routes/calls.d.ts +0 -18
- package/dist/execution/routes/calls.d.ts.map +0 -1
- package/dist/execution/routes/calls.js +0 -74
- package/dist/execution/routes/calls.js.map +0 -1
- package/dist/execution/routes/locks.d.ts +0 -10
- package/dist/execution/routes/locks.d.ts.map +0 -1
- package/dist/execution/routes/locks.js +0 -166
- package/dist/execution/routes/locks.js.map +0 -1
- package/dist/execution/routes/shutdown.d.ts +0 -5
- package/dist/execution/routes/shutdown.d.ts.map +0 -1
- package/dist/execution/routes/shutdown.js +0 -24
- package/dist/execution/routes/shutdown.js.map +0 -1
- package/dist/execution/routes/signals.d.ts +0 -12
- package/dist/execution/routes/signals.d.ts.map +0 -1
- package/dist/execution/routes/signals.js +0 -123
- package/dist/execution/routes/signals.js.map +0 -1
- package/dist/execution/types.d.ts +0 -23
- package/dist/execution/types.d.ts.map +0 -1
- package/dist/execution/types.js +0 -2
- package/dist/execution/types.js.map +0 -1
- package/dist/frontend/assets/index-DnSu-8Kw.js +0 -16
- package/dist/frontend/assets/index-DnSu-8Kw.js.map +0 -1
- package/dist/frontend/assets/index-Z0IOXEax.css +0 -2
- package/dist/gateway/routes/execution.d.ts +0 -24
- package/dist/gateway/routes/execution.d.ts.map +0 -1
- package/dist/gateway/routes/execution.js +0 -13
- package/dist/gateway/routes/execution.js.map +0 -1
- package/dist/scheduler/orphan-recovery.d.ts +0 -25
- package/dist/scheduler/orphan-recovery.d.ts.map +0 -1
- package/dist/scheduler/orphan-recovery.js +0 -144
- package/dist/scheduler/orphan-recovery.js.map +0 -1
- package/docker/bin/_http-exit +0 -35
- package/docker/bin/al-exit +0 -4
- package/docker/bin/al-export +0 -50
- package/docker/bin/al-rerun +0 -8
- package/docker/bin/al-return +0 -14
- package/docker/bin/al-shutdown +0 -5
- package/docker/bin/al-status +0 -9
- package/docker/bin/al-subagent +0 -13
- package/docker/bin/al-subagent-check +0 -10
- package/docker/bin/al-subagent-wait +0 -37
- package/docker/bin/rlock +0 -12
- package/docker/bin/rlock-heartbeat +0 -12
- package/docker/bin/runlock +0 -12
|
@@ -13,7 +13,6 @@ export interface LoadedCredentials {
|
|
|
13
13
|
bundle: CredentialBundle;
|
|
14
14
|
providerKeys: Map<string, string>;
|
|
15
15
|
}
|
|
16
|
-
export declare function resolveHarnessEnv(agentConfig: AgentConfig, providerKeys: Map<string, string>): Record<string, string>;
|
|
17
16
|
/**
|
|
18
17
|
* Load credentials from volume or env vars, resolve provider API keys,
|
|
19
18
|
* inject env vars for git, SSH, and other credential types.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-setup.d.ts","sourceRoot":"","sources":["../../src/agents/credential-setup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,qBAAqB,CAAC;AAKpE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAWtF,wBAAgB,mBAAmB,IAAI,OAAO,CAO7C;AAED,wBAAgB,yBAAyB,IAAI,gBAAgB,CAiB5D;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAYzD;AAUD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,gBAAgB,CAAC;IACzB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED
|
|
1
|
+
{"version":3,"file":"credential-setup.d.ts","sourceRoot":"","sources":["../../src/agents/credential-setup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,qBAAqB,CAAC;AAKpE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AAWtF,wBAAgB,mBAAmB,IAAI,OAAO,CAO7C;AAED,wBAAgB,yBAAyB,IAAI,gBAAgB,CAiB5D;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAYzD;AAUD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,gBAAgB,CAAC;IACzB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,WAAW,GAAG,iBAAiB,CAmFpF"}
|
|
@@ -76,27 +76,6 @@ function readCredentialField(bundle, type, instance, field) {
|
|
|
76
76
|
function readCredentialFields(bundle, type, instance) {
|
|
77
77
|
return bundle[type]?.[instance] || {};
|
|
78
78
|
}
|
|
79
|
-
export function resolveHarnessEnv(agentConfig, providerKeys) {
|
|
80
|
-
const env = {};
|
|
81
|
-
if ((agentConfig.harness?.type || "pi") !== "claude") {
|
|
82
|
-
return env;
|
|
83
|
-
}
|
|
84
|
-
const anthropicModel = agentConfig.models.find((model) => model.provider === "anthropic");
|
|
85
|
-
if (!anthropicModel) {
|
|
86
|
-
return env;
|
|
87
|
-
}
|
|
88
|
-
const token = providerKeys.get("anthropic");
|
|
89
|
-
if (!token) {
|
|
90
|
-
return env;
|
|
91
|
-
}
|
|
92
|
-
if (anthropicModel.authType === "oauth_token" || token.startsWith("sk-ant-oat")) {
|
|
93
|
-
env.ANTHROPIC_AUTH_TOKEN = token;
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
env.ANTHROPIC_API_KEY = token;
|
|
97
|
-
}
|
|
98
|
-
return env;
|
|
99
|
-
}
|
|
100
79
|
/**
|
|
101
80
|
* Load credentials from volume or env vars, resolve provider API keys,
|
|
102
81
|
* inject env vars for git, SSH, and other credential types.
|
|
@@ -132,7 +111,7 @@ export function loadContainerCredentials(agentConfig) {
|
|
|
132
111
|
throw new Error(`missing provider API key credentials. Run 'al doctor' to configure them.`);
|
|
133
112
|
}
|
|
134
113
|
// Generic credential → env var injection from credential definitions
|
|
135
|
-
for (const credRef of agentConfig.credentials) {
|
|
114
|
+
for (const credRef of agentConfig.credentials ?? []) {
|
|
136
115
|
const { type, instance } = parseCredentialRef(credRef);
|
|
137
116
|
const def = builtinCredentials[type];
|
|
138
117
|
if (!def?.envVars)
|
|
@@ -158,7 +137,7 @@ export function loadContainerCredentials(agentConfig) {
|
|
|
158
137
|
emitLog("info", "git HTTPS credential helper configured");
|
|
159
138
|
}
|
|
160
139
|
// Set up SSH key for git push/clone if git_ssh credential is available
|
|
161
|
-
const gitSshRef = agentConfig.credentials.find((ref) => parseCredentialRef(ref).type === "git_ssh");
|
|
140
|
+
const gitSshRef = (agentConfig.credentials ?? []).find((ref) => parseCredentialRef(ref).type === "git_ssh");
|
|
162
141
|
if (gitSshRef) {
|
|
163
142
|
const { instance } = parseCredentialRef(gitSshRef);
|
|
164
143
|
const sshKey = readCredentialField(bundle, "git_ssh", instance, "id_rsa");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-setup.js","sourceRoot":"","sources":["../../src/agents/credential-setup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAc,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAE/F,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAKtE,SAAS,OAAO,CAAC,KAAa,EAAE,GAAW,EAAE,IAA0B;IACrE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,0FAA0F;AAC1F,SAAS,eAAe;IACtB,OAAO,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,cAAc,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,WAAW,CAAC,e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mCtG;AAiCD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAO3F;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAG9E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAGlE;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAE5F;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAG1G;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAE/H;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAEnH"}
|
package/dist/agents/prompt.js
CHANGED
|
@@ -5,47 +5,15 @@ export function buildLockSkill() {
|
|
|
5
5
|
"<skill-lock>",
|
|
6
6
|
"## Skill: Resource Locking",
|
|
7
7
|
"",
|
|
8
|
-
"Use
|
|
9
|
-
"You may hold **at most one lock at a time**. Release your current lock before acquiring another.",
|
|
10
|
-
"",
|
|
11
|
-
"**Important:** Resource keys must be valid URIs with proper schemes (e.g., github://, file://, https://).",
|
|
12
|
-
"",
|
|
13
|
-
"### Commands",
|
|
14
|
-
"",
|
|
15
|
-
"**`rlock <resourceKey>`** — Acquire an exclusive lock before working on a shared resource.",
|
|
16
|
-
"```",
|
|
17
|
-
'rlock "github://acme/app/issues/42"',
|
|
18
|
-
"```",
|
|
19
|
-
"",
|
|
20
|
-
"**`runlock <resourceKey>`** — Release a lock when done with the resource.",
|
|
21
|
-
"```",
|
|
22
|
-
'runlock "github://acme/app/issues/42"',
|
|
23
|
-
"```",
|
|
24
|
-
"",
|
|
25
|
-
"**`rlock-heartbeat <resourceKey>`** — Extend the TTL on a lock you hold. Use during long-running work.",
|
|
26
|
-
"```",
|
|
27
|
-
'rlock-heartbeat "github://acme/app/issues/42"',
|
|
28
|
-
"```",
|
|
29
|
-
"",
|
|
30
|
-
"### Responses",
|
|
31
|
-
'- Acquired: `{"ok":true}`',
|
|
32
|
-
'- Conflict: `{"ok":false,"holder":"<other-agent>","heldSince":...}`',
|
|
33
|
-
" → Another instance is already working on this. Skip it and move on.",
|
|
34
|
-
'- Already holding another lock: `{"ok":false,"reason":"already holding lock on ..."}`',
|
|
35
|
-
" → Release your current lock first.",
|
|
36
|
-
'- Gateway unreachable: `{"ok":false,"reason":"gateway unreachable"}`',
|
|
37
|
-
" → The lock service is down. **Do not proceed** — skip the resource.",
|
|
38
|
-
'- Released: `{"ok":true}`',
|
|
39
|
-
'- Heartbeat: `{"ok":true,"expiresAt":...}`',
|
|
8
|
+
"Use the `acquire_lock` and `release_lock` tools to coordinate with other agent instances and avoid duplicate work.",
|
|
40
9
|
"",
|
|
41
10
|
"### Guidelines",
|
|
42
|
-
"- You
|
|
43
|
-
"- Always
|
|
44
|
-
"- Always
|
|
45
|
-
|
|
46
|
-
"-
|
|
47
|
-
|
|
48
|
-
'- Resource keys must be valid URIs: `"github://acme/app/issues/42"`, `"file:///deployments/api-prod"`',
|
|
11
|
+
"- You may hold **at most one lock at a time**. Release your current lock before acquiring another.",
|
|
12
|
+
"- Always acquire a lock before starting work on a shared resource (issues, PRs, deployments).",
|
|
13
|
+
"- Always release the lock when done.",
|
|
14
|
+
"- If `acquire_lock` fails for ANY reason (conflict, deadlock, already holding), **skip that resource** — do not wait, retry, or proceed without the lock.",
|
|
15
|
+
"- Locks expire automatically after 30 minutes. For long operations, acquire with a longer TTL.",
|
|
16
|
+
'- Resource keys must be valid URIs (e.g. `"github://acme/app/issues/42"`, `"file:///deployments/api-prod"`).',
|
|
49
17
|
"</skill-lock>",
|
|
50
18
|
];
|
|
51
19
|
return lines.join("\n");
|
|
@@ -55,7 +23,7 @@ export function buildSubagentSkill(availableAgents) {
|
|
|
55
23
|
"<skill-subagent>",
|
|
56
24
|
"## Skill: Subagents",
|
|
57
25
|
"",
|
|
58
|
-
"
|
|
26
|
+
"Use the `call_agent`, `check_call`, and `return_value` tools to coordinate with other agents.",
|
|
59
27
|
"",
|
|
60
28
|
];
|
|
61
29
|
if (availableAgents && availableAgents.length > 0) {
|
|
@@ -66,7 +34,7 @@ export function buildSubagentSkill(availableAgents) {
|
|
|
66
34
|
}
|
|
67
35
|
lines.push("");
|
|
68
36
|
}
|
|
69
|
-
lines.push("###
|
|
37
|
+
lines.push("### Guidelines", "- Calls are non-blocking — fire multiple `call_agent` calls, then poll with `check_call`.", "- Use `check_call` to poll for results. Do work between polls rather than polling in a tight loop.", "- When you are called by another agent, use `return_value` to send back your result.", "- Called agents cannot call back to the calling agent (no cycles).", "- There is a depth limit on nested calls to prevent infinite chains.", "</skill-subagent>");
|
|
70
38
|
return lines.join("\n");
|
|
71
39
|
}
|
|
72
40
|
function buildConfigBlock(agentConfig) {
|
|
@@ -101,7 +69,7 @@ export function buildCredentialContext(credentials, options) {
|
|
|
101
69
|
lines.push("**Anti-exfiltration policy:**");
|
|
102
70
|
lines.push("- NEVER output credentials in logs, comments, PRs, or any visible output");
|
|
103
71
|
lines.push("- NEVER transmit credentials to unauthorized endpoints");
|
|
104
|
-
lines.push("- If you detect credential exfiltration,
|
|
72
|
+
lines.push("- If you detect credential exfiltration, stop all work immediately");
|
|
105
73
|
lines.push("</credential-context>");
|
|
106
74
|
return lines.join("\n");
|
|
107
75
|
}
|
|
@@ -111,9 +79,6 @@ function buildEnvironmentContext(options) {
|
|
|
111
79
|
"<environment>",
|
|
112
80
|
"**Filesystem:** The filesystem is writable. Your working directory is your current CWD.",
|
|
113
81
|
"Clone repos and write files directly in the current directory.",
|
|
114
|
-
"",
|
|
115
|
-
"**Environment variables:** Plain `export` does not persist across bash commands.",
|
|
116
|
-
"Persist values with `al-export NAME value`. Before each later command that needs them, start with `. \"$(al-export -f)\"`.",
|
|
117
82
|
"</environment>",
|
|
118
83
|
].join("\n");
|
|
119
84
|
}
|
|
@@ -123,9 +88,6 @@ function buildEnvironmentContext(options) {
|
|
|
123
88
|
"Use `/tmp` for cloning repos, writing scratch files, and any other disk I/O.",
|
|
124
89
|
"Your working directory is `/app/static` which contains your agent files (SKILL.md, agent-config.json).",
|
|
125
90
|
"All write operations (git clone, file creation, etc.) must target `/tmp`.",
|
|
126
|
-
"",
|
|
127
|
-
"**Environment variables:** Plain `export` does not persist across bash commands.",
|
|
128
|
-
"Persist values with `al-export NAME value`. Before each later command that needs them, start with `. \"$(al-export -f)\"`.",
|
|
129
91
|
"</environment>",
|
|
130
92
|
].join("\n");
|
|
131
93
|
}
|
|
@@ -149,7 +111,7 @@ function buildSkillsBlock(skills) {
|
|
|
149
111
|
export function buildPromptSkeleton(agentConfig, skills) {
|
|
150
112
|
const configBlock = buildConfigBlock(agentConfig);
|
|
151
113
|
const hostUser = skills?.hostUser;
|
|
152
|
-
const credentialBlock = buildCredentialContext(agentConfig.credentials, { hostUser });
|
|
114
|
+
const credentialBlock = buildCredentialContext(agentConfig.credentials ?? [], { hostUser });
|
|
153
115
|
const environmentBlock = buildEnvironmentContext({ hostUser });
|
|
154
116
|
const skillsBlock = buildSkillsBlock(skills);
|
|
155
117
|
return `<agent-config>\n${configBlock}\n</agent-config>\n\n${credentialBlock}\n\n${environmentBlock}${skillsBlock}`;
|
|
@@ -169,7 +131,7 @@ export function buildUserPromptSuffix(prompt) {
|
|
|
169
131
|
}
|
|
170
132
|
export function buildCalledSuffix(callerAgent, context) {
|
|
171
133
|
const callBlock = JSON.stringify({ caller: callerAgent, context });
|
|
172
|
-
return `<agent-call>\n${callBlock}\n</agent-call>\n\nYou were called by the "${callerAgent}" agent. Review the call context above, do the requested work, and use \`
|
|
134
|
+
return `<agent-call>\n${callBlock}\n</agent-call>\n\nYou were called by the "${callerAgent}" agent. Review the call context above, do the requested work, and use the \`return_value\` tool to send back your result.`;
|
|
173
135
|
}
|
|
174
136
|
export function buildWebhookSuffix(context) {
|
|
175
137
|
const webhookBlock = JSON.stringify(context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/agents/prompt.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAU9D,MAAM,UAAU,cAAc;IAC5B,MAAM,KAAK,GAAG;QACZ,cAAc;QACd,4BAA4B;QAC5B,EAAE;QACF,
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/agents/prompt.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAU9D,MAAM,UAAU,cAAc;IAC5B,MAAM,KAAK,GAAG;QACZ,cAAc;QACd,4BAA4B;QAC5B,EAAE;QACF,oHAAoH;QACpH,EAAE;QACF,gBAAgB;QAChB,oGAAoG;QACpG,+FAA+F;QAC/F,sCAAsC;QACtC,2JAA2J;QAC3J,gGAAgG;QAChG,8GAA8G;QAC9G,eAAe;KAChB,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,eAA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locks, subagent calls, status, return values).
|
|
4
|
+
*
|
|
5
|
+
* These replace the old HTTP gateway routes + signal files with in-process
|
|
6
|
+
* tool calls, since Pi sessions now run inside the scheduler process.
|
|
7
|
+
*/
|
|
8
|
+
import { type ToolDefinition } from "@mariozechner/pi-coding-agent";
|
|
9
|
+
import type { LockStore } from "../execution/lock-store.js";
|
|
10
|
+
import type { CallStore } from "../execution/call-store.js";
|
|
11
|
+
import type { StatusTracker } from "../tui/status-tracker.js";
|
|
12
|
+
import type { Logger } from "../shared/logger.js";
|
|
13
|
+
export interface SchedulerToolsOpts {
|
|
14
|
+
lockStore: LockStore;
|
|
15
|
+
callStore: CallStore;
|
|
16
|
+
/** Dispatch a call to a target agent. Returns { ok, reason? }. */
|
|
17
|
+
dispatchCall: (entry: {
|
|
18
|
+
callerAgent: string;
|
|
19
|
+
callerInstanceId: string;
|
|
20
|
+
targetAgent: string;
|
|
21
|
+
context: string;
|
|
22
|
+
depth: number;
|
|
23
|
+
callId: string;
|
|
24
|
+
}) => {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
reason?: string;
|
|
27
|
+
};
|
|
28
|
+
statusTracker?: StatusTracker;
|
|
29
|
+
logger: Logger;
|
|
30
|
+
/** Name of the agent these tools belong to. */
|
|
31
|
+
agentName: string;
|
|
32
|
+
/** Instance ID used as the lock holder and call caller. */
|
|
33
|
+
instanceId: string;
|
|
34
|
+
/** Current trigger depth (for subagent calls). */
|
|
35
|
+
depth: number;
|
|
36
|
+
/** Callback invoked when the agent calls return_value. */
|
|
37
|
+
onReturnValue: (value: string) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Callback invoked when the agent calls wait_for_trigger.
|
|
40
|
+
* Returns a promise that resolves with the trigger payload when matched.
|
|
41
|
+
*/
|
|
42
|
+
onWait?: (filter: import("../execution/waiting-registry.js").WaitFilter, timeoutMs: number) => Promise<any>;
|
|
43
|
+
/** Default wait timeout in seconds (from agent/global config). */
|
|
44
|
+
defaultWaitTimeout?: number;
|
|
45
|
+
}
|
|
46
|
+
export declare function createSchedulerTools(opts: SchedulerToolsOpts): ToolDefinition[];
|
|
47
|
+
//# sourceMappingURL=scheduler-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler-tools.d.ts","sourceRoot":"","sources":["../../src/agents/scheduler-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAMlD,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,SAAS,CAAC;IACrB,kEAAkE;IAClE,YAAY,EAAE,CAAC,KAAK,EAAE;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,gBAAgB,EAAE,MAAM,CAAC;QACzB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,KAAK;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,kCAAkC,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5G,kEAAkE;IAClE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAQD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,GAAG,cAAc,EAAE,CAe/E"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduler tools — Pi custom tools that give agents direct access
|
|
3
|
+
* to scheduler services (locks, subagent calls, status, return values).
|
|
4
|
+
*
|
|
5
|
+
* These replace the old HTTP gateway routes + signal files with in-process
|
|
6
|
+
* tool calls, since Pi sessions now run inside the scheduler process.
|
|
7
|
+
*/
|
|
8
|
+
import { Type } from "@sinclair/typebox";
|
|
9
|
+
import { defineTool } from "@mariozechner/pi-coding-agent";
|
|
10
|
+
import { DEFAULT_WAIT_TIMEOUT } from "../shared/constants.js";
|
|
11
|
+
// ── Tool definitions ──────────────────────────────────────────
|
|
12
|
+
function textResult(text) {
|
|
13
|
+
return { content: [{ type: "text", text }], details: undefined };
|
|
14
|
+
}
|
|
15
|
+
export function createSchedulerTools(opts) {
|
|
16
|
+
const tools = [
|
|
17
|
+
createAcquireLockTool(opts),
|
|
18
|
+
createReleaseLockTool(opts),
|
|
19
|
+
createCallAgentTool(opts),
|
|
20
|
+
createCheckCallTool(opts),
|
|
21
|
+
createSetStatusTool(opts),
|
|
22
|
+
createReturnValueTool(opts),
|
|
23
|
+
];
|
|
24
|
+
if (opts.onWait) {
|
|
25
|
+
tools.push(createWaitTool(opts));
|
|
26
|
+
}
|
|
27
|
+
return tools;
|
|
28
|
+
}
|
|
29
|
+
// ── acquire_lock ──────────────────────────────────────────────
|
|
30
|
+
const AcquireLockParams = Type.Object({
|
|
31
|
+
resource_key: Type.String({ description: "URI identifying the resource to lock (e.g. lock://repo/main-branch)" }),
|
|
32
|
+
ttl_seconds: Type.Optional(Type.Number({ description: "Lock TTL in seconds (default: 1800)" })),
|
|
33
|
+
});
|
|
34
|
+
function createAcquireLockTool(opts) {
|
|
35
|
+
return defineTool({
|
|
36
|
+
name: "acquire_lock",
|
|
37
|
+
label: "Acquire Lock",
|
|
38
|
+
description: "Acquire a distributed lock on a resource. Returns whether the lock was acquired. If another agent holds the lock, returns the holder's identity. Use URI format for resource keys (e.g. lock://repo/branch-name).",
|
|
39
|
+
promptSnippet: "acquire_lock — acquire a distributed lock on a resource",
|
|
40
|
+
parameters: AcquireLockParams,
|
|
41
|
+
async execute(_toolCallId, params) {
|
|
42
|
+
const result = opts.lockStore.acquire(params.resource_key, opts.instanceId, params.ttl_seconds);
|
|
43
|
+
if (result.ok) {
|
|
44
|
+
opts.logger.info({ resource: params.resource_key }, "lock acquired");
|
|
45
|
+
return textResult(`Lock acquired on ${params.resource_key}`);
|
|
46
|
+
}
|
|
47
|
+
const reason = result.deadlock
|
|
48
|
+
? `Deadlock detected: ${result.cycle?.join(" → ")}`
|
|
49
|
+
: `Lock held by ${result.holder}${result.reason ? ` (${result.reason})` : ""}`;
|
|
50
|
+
opts.logger.info({ resource: params.resource_key, reason }, "lock acquire failed");
|
|
51
|
+
return textResult(`Lock not acquired: ${reason}`);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// ── release_lock ──────────────────────────────────────────────
|
|
56
|
+
const ReleaseLockParams = Type.Object({
|
|
57
|
+
resource_key: Type.String({ description: "URI identifying the resource to unlock" }),
|
|
58
|
+
});
|
|
59
|
+
function createReleaseLockTool(opts) {
|
|
60
|
+
return defineTool({
|
|
61
|
+
name: "release_lock",
|
|
62
|
+
label: "Release Lock",
|
|
63
|
+
description: "Release a distributed lock that you previously acquired.",
|
|
64
|
+
promptSnippet: "release_lock — release a previously acquired lock",
|
|
65
|
+
parameters: ReleaseLockParams,
|
|
66
|
+
async execute(_toolCallId, params) {
|
|
67
|
+
const result = opts.lockStore.release(params.resource_key, opts.instanceId);
|
|
68
|
+
if (result.ok) {
|
|
69
|
+
opts.logger.info({ resource: params.resource_key }, "lock released");
|
|
70
|
+
return textResult(`Lock released on ${params.resource_key}`);
|
|
71
|
+
}
|
|
72
|
+
return textResult(`Could not release lock: ${result.reason}`);
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
// ── call_agent ────────────────────────────────────────────────
|
|
77
|
+
const CallAgentParams = Type.Object({
|
|
78
|
+
target_agent: Type.String({ description: "Name of the agent to call" }),
|
|
79
|
+
context: Type.String({ description: "Context/instructions to pass to the target agent" }),
|
|
80
|
+
});
|
|
81
|
+
function createCallAgentTool(opts) {
|
|
82
|
+
return defineTool({
|
|
83
|
+
name: "call_agent",
|
|
84
|
+
label: "Call Agent",
|
|
85
|
+
description: "Call another agent to perform a task. Returns a call_id that you can poll with check_call. The target agent runs asynchronously — use check_call to wait for its result.",
|
|
86
|
+
promptSnippet: "call_agent — dispatch a task to another agent (returns call_id)",
|
|
87
|
+
promptGuidelines: [
|
|
88
|
+
"After calling call_agent, use check_call to poll for the result. Do not assume the call completes instantly.",
|
|
89
|
+
"You cannot call yourself. The call will be rejected if the target agent is not available.",
|
|
90
|
+
],
|
|
91
|
+
parameters: CallAgentParams,
|
|
92
|
+
async execute(_toolCallId, params) {
|
|
93
|
+
// Create a call entry in the call store
|
|
94
|
+
const entry = opts.callStore.create({
|
|
95
|
+
callerAgent: opts.agentName,
|
|
96
|
+
callerInstanceId: opts.instanceId,
|
|
97
|
+
targetAgent: params.target_agent,
|
|
98
|
+
context: params.context,
|
|
99
|
+
depth: opts.depth,
|
|
100
|
+
});
|
|
101
|
+
// Dispatch through the scheduler
|
|
102
|
+
const result = opts.dispatchCall({
|
|
103
|
+
callerAgent: opts.agentName,
|
|
104
|
+
callerInstanceId: opts.instanceId,
|
|
105
|
+
targetAgent: params.target_agent,
|
|
106
|
+
context: params.context,
|
|
107
|
+
depth: opts.depth,
|
|
108
|
+
callId: entry.callId,
|
|
109
|
+
});
|
|
110
|
+
if (!result.ok) {
|
|
111
|
+
opts.callStore.fail(entry.callId, result.reason || "dispatch rejected");
|
|
112
|
+
opts.logger.warn({ target: params.target_agent, reason: result.reason }, "call_agent rejected");
|
|
113
|
+
return textResult(`Call rejected: ${result.reason}`);
|
|
114
|
+
}
|
|
115
|
+
opts.logger.info({ target: params.target_agent, callId: entry.callId }, "call_agent dispatched");
|
|
116
|
+
return textResult(`Call dispatched. call_id: ${entry.callId}\n\nUse check_call with this call_id to poll for the result.`);
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// ── check_call ────────────────────────────────────────────────
|
|
121
|
+
const CheckCallParams = Type.Object({
|
|
122
|
+
call_id: Type.String({ description: "The call_id returned by a previous call_agent" }),
|
|
123
|
+
});
|
|
124
|
+
function createCheckCallTool(opts) {
|
|
125
|
+
return defineTool({
|
|
126
|
+
name: "check_call",
|
|
127
|
+
label: "Check Call",
|
|
128
|
+
description: "Check the status of a previous call_agent. Returns the status (pending, running, completed, error) and the return value if completed.",
|
|
129
|
+
promptSnippet: "check_call — poll the result of a previous call_agent",
|
|
130
|
+
parameters: CheckCallParams,
|
|
131
|
+
async execute(_toolCallId, params) {
|
|
132
|
+
const result = opts.callStore.check(params.call_id, opts.instanceId);
|
|
133
|
+
if (!result) {
|
|
134
|
+
return textResult(`Call ${params.call_id} not found or not owned by this agent.`);
|
|
135
|
+
}
|
|
136
|
+
if (result.status === "completed") {
|
|
137
|
+
const rv = result.returnValue ? `\n\nReturn value: ${result.returnValue}` : "";
|
|
138
|
+
return textResult(`Call completed.${rv}`);
|
|
139
|
+
}
|
|
140
|
+
if (result.status === "error") {
|
|
141
|
+
return textResult(`Call failed: ${result.errorMessage || "unknown error"}`);
|
|
142
|
+
}
|
|
143
|
+
return textResult(`Call status: ${result.status}. Use check_call again later to poll for completion.`);
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
// ── set_status ────────────────────────────────────────────────
|
|
148
|
+
const SetStatusParams = Type.Object({
|
|
149
|
+
text: Type.String({ description: "Short status text to display (e.g. 'reviewing PR #42', 'waiting for build')" }),
|
|
150
|
+
});
|
|
151
|
+
function createSetStatusTool(opts) {
|
|
152
|
+
return defineTool({
|
|
153
|
+
name: "set_status",
|
|
154
|
+
label: "Set Status",
|
|
155
|
+
description: "Update your status text shown in the terminal dashboard. Use this to communicate what you're currently working on.",
|
|
156
|
+
promptSnippet: "set_status — update your status in the dashboard",
|
|
157
|
+
parameters: SetStatusParams,
|
|
158
|
+
async execute(_toolCallId, params) {
|
|
159
|
+
opts.statusTracker?.setAgentStatusText(opts.agentName, params.text);
|
|
160
|
+
opts.logger.info({ status: params.text }, "status updated");
|
|
161
|
+
return textResult(`Status updated: ${params.text}`);
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
// ── return_value ──────────────────────────────────────────────
|
|
166
|
+
const ReturnValueParams = Type.Object({
|
|
167
|
+
value: Type.String({ description: "The value to return to the calling agent" }),
|
|
168
|
+
});
|
|
169
|
+
function createReturnValueTool(opts) {
|
|
170
|
+
return defineTool({
|
|
171
|
+
name: "return_value",
|
|
172
|
+
label: "Return Value",
|
|
173
|
+
description: "Return a value to the agent that called you. Only useful when this agent was invoked via call_agent by another agent. The calling agent will see this value when it uses check_call.",
|
|
174
|
+
promptSnippet: "return_value — return a value to the calling agent",
|
|
175
|
+
parameters: ReturnValueParams,
|
|
176
|
+
async execute(_toolCallId, params) {
|
|
177
|
+
opts.onReturnValue(params.value);
|
|
178
|
+
opts.logger.info("return value set");
|
|
179
|
+
return textResult(`Return value set. It will be visible to the calling agent via check_call.`);
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
// ── wait_for_trigger ──────────────────────────────────────────
|
|
184
|
+
/**
|
|
185
|
+
* Parse a human-readable duration string to milliseconds.
|
|
186
|
+
* Supports: "30s", "5m", "2h", "1h30m".
|
|
187
|
+
*/
|
|
188
|
+
function parseDuration(duration) {
|
|
189
|
+
const parts = duration.match(/(\d+)\s*(s|m|h)/g);
|
|
190
|
+
if (!parts)
|
|
191
|
+
return null;
|
|
192
|
+
let totalMs = 0;
|
|
193
|
+
for (const part of parts) {
|
|
194
|
+
const match = part.match(/(\d+)\s*(s|m|h)/);
|
|
195
|
+
if (!match)
|
|
196
|
+
return null;
|
|
197
|
+
const value = parseInt(match[1], 10);
|
|
198
|
+
switch (match[2]) {
|
|
199
|
+
case "s":
|
|
200
|
+
totalMs += value * 1000;
|
|
201
|
+
break;
|
|
202
|
+
case "m":
|
|
203
|
+
totalMs += value * 60_000;
|
|
204
|
+
break;
|
|
205
|
+
case "h":
|
|
206
|
+
totalMs += value * 3_600_000;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return totalMs > 0 ? totalMs : null;
|
|
211
|
+
}
|
|
212
|
+
const WaitForTriggerParams = Type.Object({
|
|
213
|
+
type: Type.Union([Type.Literal("webhook"), Type.Literal("agent_trigger")], {
|
|
214
|
+
description: "The type of trigger to wait for",
|
|
215
|
+
}),
|
|
216
|
+
source: Type.Optional(Type.String({ description: "Webhook source name to match (e.g. 'github')" })),
|
|
217
|
+
event: Type.Optional(Type.String({ description: "Event type to match (e.g. 'pull_request')" })),
|
|
218
|
+
match: Type.Optional(Type.Record(Type.String(), Type.String(), {
|
|
219
|
+
description: "Dot-path equality predicates on the trigger payload (e.g. {\"action\": \"closed\", \"pull_request.merged\": \"true\"})",
|
|
220
|
+
})),
|
|
221
|
+
source_agent: Type.Optional(Type.String({ description: "For agent_trigger: only match triggers from this agent" })),
|
|
222
|
+
timeout: Type.Optional(Type.String({ description: "How long to wait before timing out (e.g. '30m', '2h'). Defaults to agent/project config." })),
|
|
223
|
+
});
|
|
224
|
+
function createWaitTool(opts) {
|
|
225
|
+
return defineTool({
|
|
226
|
+
name: "wait_for_trigger",
|
|
227
|
+
label: "Wait for Trigger",
|
|
228
|
+
description: "Suspend this agent and wait for a specific trigger (webhook event or agent trigger) before resuming. The agent's container is paused while waiting to save resources. When the trigger arrives, the agent resumes with the trigger payload.",
|
|
229
|
+
promptSnippet: "wait_for_trigger — suspend and wait for a webhook or agent trigger",
|
|
230
|
+
promptGuidelines: [
|
|
231
|
+
"Use this to build multi-step workflows. For example: process a PR opened event, then wait for it to merge.",
|
|
232
|
+
"The agent is suspended while waiting — no resources are consumed. You will resume exactly where you left off.",
|
|
233
|
+
"The timeout defaults to 30 minutes. Use the timeout parameter for longer waits.",
|
|
234
|
+
],
|
|
235
|
+
parameters: WaitForTriggerParams,
|
|
236
|
+
async execute(_toolCallId, params) {
|
|
237
|
+
if (!opts.onWait) {
|
|
238
|
+
return textResult("Error: wait_for_trigger is not available in this context.");
|
|
239
|
+
}
|
|
240
|
+
// Build the filter
|
|
241
|
+
let filter;
|
|
242
|
+
if (params.type === "webhook") {
|
|
243
|
+
filter = {
|
|
244
|
+
type: "webhook",
|
|
245
|
+
source: params.source,
|
|
246
|
+
event: params.event,
|
|
247
|
+
match: params.match,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
filter = {
|
|
252
|
+
type: "agent-trigger",
|
|
253
|
+
sourceAgent: params.source_agent,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
// Parse timeout
|
|
257
|
+
const defaultTimeoutMs = (opts.defaultWaitTimeout ?? DEFAULT_WAIT_TIMEOUT) * 1000;
|
|
258
|
+
const timeoutMs = params.timeout ? (parseDuration(params.timeout) ?? defaultTimeoutMs) : defaultTimeoutMs;
|
|
259
|
+
opts.logger.info({ filter, timeoutMs }, "agent requesting wait_for_trigger");
|
|
260
|
+
opts.statusTracker?.setAgentStatusText(opts.agentName, `waiting for ${params.type}${params.event ? `: ${params.event}` : ""}`);
|
|
261
|
+
try {
|
|
262
|
+
const payload = await opts.onWait(filter, timeoutMs);
|
|
263
|
+
opts.logger.info("wait_for_trigger resolved with trigger payload");
|
|
264
|
+
opts.statusTracker?.setAgentStatusText(opts.agentName, null);
|
|
265
|
+
const payloadStr = typeof payload === "string" ? payload : JSON.stringify(payload, null, 2);
|
|
266
|
+
return textResult(`Trigger received. Payload:\n\n${payloadStr}`);
|
|
267
|
+
}
|
|
268
|
+
catch (err) {
|
|
269
|
+
opts.logger.warn({ err: err.message }, "wait_for_trigger failed");
|
|
270
|
+
opts.statusTracker?.setAgentStatusText(opts.agentName, null);
|
|
271
|
+
return textResult(`Wait failed: ${err.message}`);
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=scheduler-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler-tools.js","sourceRoot":"","sources":["../../src/agents/scheduler-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAMhF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAmC9D,iEAAiE;AAEjE,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAwB;IAC3D,MAAM,KAAK,GAAG;QACZ,qBAAqB,CAAC,IAAI,CAAC;QAC3B,qBAAqB,CAAC,IAAI,CAAC;QAC3B,mBAAmB,CAAC,IAAI,CAAC;QACzB,mBAAmB,CAAC,IAAI,CAAC;QACzB,mBAAmB,CAAC,IAAI,CAAC;QACzB,qBAAqB,CAAC,IAAI,CAAC;KAC5B,CAAC;IAEF,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,c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AC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;gBAE7D,MAAM,UAAU,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC5F,OAAO,UAAU,CAAC,iCAAiC,UAAU,EAAE,CAAC,CAAC;YACnE,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,yBAAyB,CAAC,CAAC;gBAClE,IAAI,CAAC,aAAa,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;gBAC7D,OAAO,UAAU,CAAC,gBAAgB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -7,7 +7,7 @@ export declare class AgentStatusReporter {
|
|
|
7
7
|
*/
|
|
8
8
|
startRun(agentName: string, reason?: string): void;
|
|
9
9
|
/**
|
|
10
|
-
* Report status text for an agent (from
|
|
10
|
+
* Report status text for an agent (from set_status tool)
|
|
11
11
|
*/
|
|
12
12
|
reportStatus(agentName: string, text: string): void;
|
|
13
13
|
/**
|
|
@@ -12,7 +12,7 @@ export class AgentStatusReporter {
|
|
|
12
12
|
this.statusTracker.startRun(agentName, reason);
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* Report status text for an agent (from
|
|
15
|
+
* Report status text for an agent (from set_status tool)
|
|
16
16
|
*/
|
|
17
17
|
reportStatus(agentName, text) {
|
|
18
18
|
if (!this.statusTracker)
|