@stigmer/cli 3.6.0 → 3.8.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/commands/agent-exec-flags.d.ts +1 -0
- package/commands/agent-exec-flags.d.ts.map +1 -1
- package/commands/agent-exec-flags.js +3 -1
- package/commands/agent-exec-flags.js.map +1 -1
- package/commands/mcp-server.js +1 -1
- package/package.json +5 -5
- package/resources/run/agent-exec.d.ts.map +1 -1
- package/resources/run/agent-exec.js +1 -0
- package/resources/run/agent-exec.js.map +1 -1
- package/resources/run/create.d.ts +2 -1
- package/resources/run/create.d.ts.map +1 -1
- package/resources/run/create.js +12 -6
- package/resources/run/create.js.map +1 -1
- package/resources/run/prepare.d.ts +15 -0
- package/resources/run/prepare.d.ts.map +1 -1
- package/resources/run/prepare.js +13 -0
- package/resources/run/prepare.js.map +1 -1
- package/resources/schedule.d.ts +9 -6
- package/resources/schedule.d.ts.map +1 -1
- package/resources/schedule.js +32 -14
- package/resources/schedule.js.map +1 -1
- package/src/commands/agent-exec-flags.ts +5 -2
- package/src/commands/mcp-server.ts +1 -1
- package/src/resources/run/agent-exec.test.ts +1 -0
- package/src/resources/run/agent-exec.ts +1 -0
- package/src/resources/run/create.test.ts +44 -1
- package/src/resources/run/create.ts +16 -7
- package/src/resources/run/prepare.test.ts +14 -1
- package/src/resources/run/prepare.ts +25 -0
- package/src/resources/schedule.ts +32 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-exec-flags.d.ts","sourceRoot":"","sources":["../../src/commands/agent-exec-flags.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"agent-exec-flags.d.ts","sourceRoot":"","sources":["../../src/commands/agent-exec-flags.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAA4B,MAAM,6BAA6B,CAAC;AAE5F,yDAAyD;AACzD,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,EAAE,KAAG,MAAM,EAA0B,CAAC;AAE7F,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,UAAQ,GAAG,OAAO,CAqBnF;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,cAAc,CAmB1E"}
|
|
@@ -27,7 +27,8 @@ export function addAgentExecFlags(command, requireMessage = false) {
|
|
|
27
27
|
.option("--secret-file <path>", "load secrets from file (repeatable, encrypted)", collect, [])
|
|
28
28
|
.option("--model <model>", "LLM model to use (e.g. claude-sonnet-4-6)")
|
|
29
29
|
.option("--auto-approve", "automatically approve all tool executions")
|
|
30
|
-
.option("--mode <mode>", 'interaction mode: "agent" (default) or "plan" (read-only)')
|
|
30
|
+
.option("--mode <mode>", 'interaction mode: "agent" (default) or "plan" (read-only)')
|
|
31
|
+
.option("--service-tier <tier>", 'model service tier: "standard" (default) or "fast" (requires --model naming a model with a fast tier; billed at fast rates)');
|
|
31
32
|
}
|
|
32
33
|
/** Map parsed commander options onto the shared {@link AgentExecFlags} shape. */
|
|
33
34
|
export function toAgentExecFlags(options) {
|
|
@@ -47,6 +48,7 @@ export function toAgentExecFlags(options) {
|
|
|
47
48
|
model: options.model ?? "",
|
|
48
49
|
autoApprove: options.autoApprove === true,
|
|
49
50
|
mode: (options.mode ?? ""),
|
|
51
|
+
serviceTier: (options.serviceTier ?? ""),
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
//# sourceMappingURL=agent-exec-flags.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-exec-flags.js","sourceRoot":"","sources":["../../src/commands/agent-exec-flags.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,iFAAiF;AACjF,kEAAkE;AAKlE,yDAAyD;AACzD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,QAAkB,EAAY,EAAE,CAAC,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-exec-flags.js","sourceRoot":"","sources":["../../src/commands/agent-exec-flags.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,iFAAiF;AACjF,kEAAkE;AAKlE,yDAAyD;AACzD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,QAAkB,EAAY,EAAE,CAAC,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC;AAsB7F;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgB,EAAE,cAAc,GAAG,KAAK;IACxE,MAAM,WAAW,GAAG,sCAAsC,CAAC;IAC3D,IAAI,cAAc;QAAE,OAAO,CAAC,cAAc,CAAC,sBAAsB,EAAE,W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AAC,MAAM,KAAK,IAAI;QAC/B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;QAC5B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;QAC5B,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW,KAAK,IAAI;QACzC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAY;QACrC,WAAW,EAAE,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,CAAoB;KAC5D,CAAC;AACJ,CAAC"}
|
package/commands/mcp-server.js
CHANGED
|
@@ -21,7 +21,7 @@ Environment variables:
|
|
|
21
21
|
STIGMER_SERVER_ADDRESS gRPC address (default: CLI config, else localhost:7234)
|
|
22
22
|
STIGMER_API_KEY API key (auto-resolved from CLI config for cloud)
|
|
23
23
|
STIGMER_MCP_TRANSPORT stdio | http | both (default: stdio)
|
|
24
|
-
STIGMER_MCP_ROSTER full | records (default: full; records = the five record tools only)
|
|
24
|
+
STIGMER_MCP_ROSTER full | records | channels (default: full; records = the five record tools only, channels = send_channel_message only)
|
|
25
25
|
STIGMER_MCP_HTTP_PORT HTTP listen port (default: 8080)
|
|
26
26
|
STIGMER_MCP_LOG_FORMAT text | json (default: text)
|
|
27
27
|
STIGMER_MCP_LOG_LEVEL debug | info | warn | error (default: info)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"description": "Stigmer command-line interface — manage agents, workflows, MCP servers, skills, and executions from the terminal",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"@connectrpc/connect": "^2.0.0",
|
|
36
36
|
"@connectrpc/connect-node": "^2.1.1",
|
|
37
37
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
38
|
-
"@stigmer/ink": "3.
|
|
39
|
-
"@stigmer/mcp-server": "3.
|
|
40
|
-
"@stigmer/protos": "3.
|
|
41
|
-
"@stigmer/sdk": "3.
|
|
38
|
+
"@stigmer/ink": "3.8.0",
|
|
39
|
+
"@stigmer/mcp-server": "3.8.0",
|
|
40
|
+
"@stigmer/protos": "3.8.0",
|
|
41
|
+
"@stigmer/sdk": "3.8.0",
|
|
42
42
|
"commander": "^12.1.0",
|
|
43
43
|
"fflate": "^0.8.3",
|
|
44
44
|
"ink": "^7.0.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-exec.d.ts","sourceRoot":"","sources":["../../../src/resources/run/agent-exec.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oDAAoD,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEvE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC;AAED,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"agent-exec.d.ts","sourceRoot":"","sources":["../../../src/resources/run/agent-exec.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oDAAoD,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEvE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC;AAED,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+DvF"}
|
|
@@ -26,6 +26,7 @@ export async function executeResolvedAgent(input) {
|
|
|
26
26
|
workspaceEntries: prepared.workspaceEntries,
|
|
27
27
|
model: prepared.model,
|
|
28
28
|
mode: prepared.mode,
|
|
29
|
+
serviceTier: prepared.serviceTier,
|
|
29
30
|
autoApproveAll: prepared.autoApproveAll,
|
|
30
31
|
});
|
|
31
32
|
// The backend owns the canonical session id: it creates the session and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-exec.js","sourceRoot":"","sources":["../../../src/resources/run/agent-exec.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,+EAA+E;AAC/E,0EAA0E;AAC1E,yEAAyE;AACzE,mDAAmD;AAInD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAA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EAC5B,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,WAAW,EAAE,EAClD,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC;AAED,kFAAkF;AAClF,2EAA2E;AAC3E,SAAS,cAAc;IACrB,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -5,7 +5,7 @@ import type { Attachment } from "@stigmer/protos/ai/stigmer/agentic/agentexecuti
|
|
|
5
5
|
import type { WorkspaceEntry } from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
|
|
6
6
|
import { type WorkflowExecution } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/api_pb";
|
|
7
7
|
import type { RuntimeEnv } from "./env.js";
|
|
8
|
-
import type { RunMode } from "./prepare.js";
|
|
8
|
+
import type { RunMode, ServiceTierFlag } from "./prepare.js";
|
|
9
9
|
export type ControllerFn = <Desc extends DescService>(service: Desc) => Client<Desc>;
|
|
10
10
|
/**
|
|
11
11
|
* Inputs for creating an agent execution. At least one of agentId/sessionId
|
|
@@ -27,6 +27,7 @@ export interface CreateAgentExecutionInput {
|
|
|
27
27
|
readonly workspaceEntries: readonly WorkspaceEntry[];
|
|
28
28
|
readonly model: string;
|
|
29
29
|
readonly mode: RunMode;
|
|
30
|
+
readonly serviceTier: ServiceTierFlag;
|
|
30
31
|
readonly autoApproveAll: boolean;
|
|
31
32
|
}
|
|
32
33
|
/** Create an agent execution. Mirrors Go's createAgentExecution. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/resources/run/create.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE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AAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,QAAQ,CAAC,gBAAgB,EAAE,SAAS,cAAc,EAAE,CAAC;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC;AAED,oEAAoE;AACpE,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,YAAY,EACxB,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,cAAc,CAAC,CAuBzB;AAED,gDAAgD;AAChD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,YAAY,EACxB,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,iBAAiB,CAAC,CAY5B"}
|
package/resources/run/create.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { create } from "@bufbuild/protobuf";
|
|
9
9
|
import { AgentExecutionSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
10
10
|
import { AgentExecutionCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/command_pb";
|
|
11
|
-
import { InteractionMode } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
11
|
+
import { InteractionMode, ServiceTier } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
12
12
|
import { AgentExecutionSpecSchema, ExecutionConfigSchema, } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
|
|
13
13
|
import { SessionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/session/v1/spec_pb";
|
|
14
14
|
import { WorkflowExecutionSchema, } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/api_pb";
|
|
@@ -36,7 +36,7 @@ export async function createAgentExecution(controller, input) {
|
|
|
36
36
|
sessionSpec: input.workspaceEntries.length > 0
|
|
37
37
|
? create(SessionSpecSchema, { workspaceEntries: [...input.workspaceEntries] })
|
|
38
38
|
: undefined,
|
|
39
|
-
executionConfig: buildExecutionConfig(input.model, input.mode),
|
|
39
|
+
executionConfig: buildExecutionConfig(input.model, input.mode, input.serviceTier),
|
|
40
40
|
}),
|
|
41
41
|
});
|
|
42
42
|
return controller(AgentExecutionCommandController).create(execution);
|
|
@@ -59,17 +59,23 @@ export async function createWorkflowExecution(controller, input) {
|
|
|
59
59
|
});
|
|
60
60
|
return controller(WorkflowExecutionCommandController).create(execution);
|
|
61
61
|
}
|
|
62
|
-
// Build ExecutionConfig, or undefined when
|
|
62
|
+
// Build ExecutionConfig, or undefined when no flag is set so the backend
|
|
63
63
|
// applies its defaults. Mirrors Go's buildExecutionConfig (only "plan" maps to a
|
|
64
|
-
// non-default InteractionMode; "agent"/"" leave it unspecified).
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
// non-default InteractionMode; "agent"/"" leave it unspecified). An explicit
|
|
65
|
+
// --service-tier value maps to the enum even for "standard": unspecified vs
|
|
66
|
+
// explicit-standard is a load-bearing ledger distinction (#357).
|
|
67
|
+
function buildExecutionConfig(model, mode, serviceTier) {
|
|
68
|
+
if (model === "" && mode === "" && serviceTier === "")
|
|
67
69
|
return undefined;
|
|
68
70
|
const cfg = create(ExecutionConfigSchema);
|
|
69
71
|
if (model !== "")
|
|
70
72
|
cfg.modelName = model;
|
|
71
73
|
if (mode === "plan")
|
|
72
74
|
cfg.interactionMode = InteractionMode.PLAN;
|
|
75
|
+
if (serviceTier === "fast")
|
|
76
|
+
cfg.serviceTier = ServiceTier.FAST;
|
|
77
|
+
else if (serviceTier === "standard")
|
|
78
|
+
cfg.serviceTier = ServiceTier.STANDARD;
|
|
73
79
|
return cfg;
|
|
74
80
|
}
|
|
75
81
|
// Convert the merged runtime env to the proto map of ExecutionValue.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/resources/run/create.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,iFAAiF;AACjF,4EAA4E;AAC5E,kFAAkF;AAGlF,OAAO,EAAE,MAAM,EAAoB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAuB,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACxH,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AAClH,OAAO,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAC;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/resources/run/create.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,iFAAiF;AACjF,4EAA4E;AAC5E,kFAAkF;AAGlF,OAAO,EAAE,MAAM,EAAoB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAuB,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACxH,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AAClH,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,8DAA8D,CAAC;AAE5G,OAAO,EACL,wBAAwB,EAExB,qBAAqB,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AI,WAAW,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IACxE,MAAM,GAAG,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAC1C,IAAI,KAAK,KAAK,EAAE;QAAE,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC;IACxC,IAAI,IAAI,KAAK,MAAM;QAAE,GAAG,CAAC,eAAe,GAAG,eAAe,CAAC,IAAI,CAAC;IAChE,IAAI,WAAW,KAAK,MAAM;QAAE,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC;SAC1D,IAAI,WAAW,KAAK,UAAU;QAAE,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC,QAAQ,CAAC;IAC5E,OAAO,GAAG,CAAC;AACb,CAAC;AAED,qEAAqE;AACrE,SAAS,iBAAiB,CAAC,GAAe;IACxC,MAAM,GAAG,GAAmC,EAAE,CAAC;IAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE,CAAC,CAAC;IACrG,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,gFAAgF;AAChF,uDAAuD;AACvD,SAAS,aAAa;IACpB,OAAO,aAAa,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -6,6 +6,12 @@ import { type ProgressSink } from "./attachments.js";
|
|
|
6
6
|
import { type RuntimeEnv } from "./env.js";
|
|
7
7
|
/** The interaction mode requested for the run; "" means the agent default. */
|
|
8
8
|
export type RunMode = "" | "agent" | "plan";
|
|
9
|
+
/**
|
|
10
|
+
* The `--service-tier` flag's value space (#357). Empty means unset —
|
|
11
|
+
* distinct from an explicit "standard" so the ledger keeps the
|
|
12
|
+
* unspecified-vs-explicit distinction.
|
|
13
|
+
*/
|
|
14
|
+
export type ServiceTierFlag = "" | "standard" | "fast";
|
|
9
15
|
/** Raw agent-execution flags shared by `run` and `draft` (Go's agentExecFlags). */
|
|
10
16
|
export interface AgentExecFlags {
|
|
11
17
|
readonly message: string;
|
|
@@ -23,6 +29,7 @@ export interface AgentExecFlags {
|
|
|
23
29
|
readonly model: string;
|
|
24
30
|
readonly autoApprove: boolean;
|
|
25
31
|
readonly mode: RunMode;
|
|
32
|
+
readonly serviceTier: ServiceTierFlag;
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
35
|
* The validated, resolved inputs ready for create + stream. Mirrors Go's
|
|
@@ -40,6 +47,7 @@ export interface PreparedRun {
|
|
|
40
47
|
readonly model: string;
|
|
41
48
|
readonly autoApproveAll: boolean;
|
|
42
49
|
readonly mode: RunMode;
|
|
50
|
+
readonly serviceTier: ServiceTierFlag;
|
|
43
51
|
}
|
|
44
52
|
/**
|
|
45
53
|
* Validate flags and resolve all execution inputs. The `org` is used to inject
|
|
@@ -57,4 +65,11 @@ export declare function parseApprovalAction(value: string): ApprovalAction;
|
|
|
57
65
|
* (agent). Mirrors Go's validateMode.
|
|
58
66
|
*/
|
|
59
67
|
export declare function validateMode(mode: string): asserts mode is RunMode;
|
|
68
|
+
/**
|
|
69
|
+
* Validate the `--service-tier` flag. Empty means "platform default" (which
|
|
70
|
+
* resolves to standard — never the provider account default, #357). The
|
|
71
|
+
* server refuses fast on models without a registry fast variant; this check
|
|
72
|
+
* only catches spelling errors before a network round trip.
|
|
73
|
+
*/
|
|
74
|
+
export declare function validateServiceTier(tier: string): asserts tier is ServiceTierFlag;
|
|
60
75
|
//# sourceMappingURL=prepare.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../src/resources/run/prepare.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,E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ace.js";
|
|
|
18
18
|
export async function prepareAgentExec(flags, client, org, progress) {
|
|
19
19
|
const defaultAction = parseApprovalAction(flags.approveDefault);
|
|
20
20
|
validateMode(flags.mode);
|
|
21
|
+
validateServiceTier(flags.serviceTier);
|
|
21
22
|
const workspaceEntries = parseWorkspaceEntries(flags.workspace, flags.branch, flags.commit);
|
|
22
23
|
const runtimeEnv = loadAndMergeEnv({
|
|
23
24
|
envFlags: flags.env,
|
|
@@ -41,6 +42,7 @@ export async function prepareAgentExec(flags, client, org, progress) {
|
|
|
41
42
|
model: flags.model,
|
|
42
43
|
autoApproveAll: flags.autoApprove,
|
|
43
44
|
mode: flags.mode,
|
|
45
|
+
serviceTier: flags.serviceTier,
|
|
44
46
|
};
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
@@ -75,4 +77,15 @@ export function validateMode(mode) {
|
|
|
75
77
|
throw new UsageError(`invalid --mode value "${mode}": must be "agent" or "plan"`);
|
|
76
78
|
}
|
|
77
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Validate the `--service-tier` flag. Empty means "platform default" (which
|
|
82
|
+
* resolves to standard — never the provider account default, #357). The
|
|
83
|
+
* server refuses fast on models without a registry fast variant; this check
|
|
84
|
+
* only catches spelling errors before a network round trip.
|
|
85
|
+
*/
|
|
86
|
+
export function validateServiceTier(tier) {
|
|
87
|
+
if (tier !== "" && tier !== "standard" && tier !== "fast") {
|
|
88
|
+
throw new UsageError(`invalid --service-tier value "${tier}": must be "standard" or "fast"`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
78
91
|
//# sourceMappingURL=prepare.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../../src/resources/run/prepare.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,8EAA8E;AAC9E,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,gFAAgF;AAChF,oEAAoE;AAGpE,OAAO,EAAE,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Y;YACf,OAAO,cAAc,CAAC,WAAW,CAAC;QACpC;YACE,MAAM,IAAI,UAAU,CAClB,oCAAoC,KAAK,uDAAuD,CACjG,CAAC;IACN,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACvD,MAAM,IAAI,UAAU,CAAC,yBAAyB,IAAI,8BAA8B,CAAC,CAAC;IACpF,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1D,MAAM,IAAI,UAAU,CAClB,iCAAiC,IAAI,iCAAiC,CACvE,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/resources/schedule.d.ts
CHANGED
|
@@ -7,13 +7,16 @@ import { CommandResult } from "../output/index.js";
|
|
|
7
7
|
export declare function resumeSchedule(stigmer: Stigmer, ref: string, org: string): Promise<CommandResult>;
|
|
8
8
|
/**
|
|
9
9
|
* Resolve `ref` (a `sch_…` id, `org/slug`, or bare slug against `org`) and
|
|
10
|
-
* fire it once, immediately (project DD-014).
|
|
10
|
+
* fire it once, immediately (project DD-017 D-5/D-6, amending DD-014).
|
|
11
11
|
*
|
|
12
|
-
* The fire is
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* the
|
|
12
|
+
* The fire is SYNCHRONOUS: the RPC runs the full execution create pipeline
|
|
13
|
+
* and the result names the run's real outcome — the created execution's
|
|
14
|
+
* id, or the refusing gate's copy verbatim. A refused run renders as an
|
|
15
|
+
* error result (non-zero exit) so a scripted test fire fails honestly,
|
|
16
|
+
* but the trigger itself succeeded: the fire is recorded in the
|
|
17
|
+
* schedule's run history either way. A disabled schedule is refused by
|
|
18
|
+
* the server with teaching copy; the CLI relays the server's message
|
|
19
|
+
* verbatim (never pattern-match refusal text).
|
|
17
20
|
*/
|
|
18
21
|
export declare function triggerSchedule(stigmer: Stigmer, ref: string, org: string): Promise<CommandResult>;
|
|
19
22
|
//# sourceMappingURL=schedule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../src/resources/schedule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../src/resources/schedule.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMnD;;;GAGG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAavG;AAeD;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAkCxG"}
|
package/resources/schedule.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
// resume call is made either way — on the no-op path it doubles as a
|
|
15
15
|
// harmless re-arm of the schedule's clock.
|
|
16
16
|
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
17
|
+
import { ScheduleRunOutcome } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/io_pb";
|
|
17
18
|
import { UsageError } from "../errors/index.js";
|
|
18
19
|
import { CommandResult } from "../output/index.js";
|
|
19
20
|
import { parseReference } from "./reference.js";
|
|
@@ -46,13 +47,16 @@ async function loadSchedule(stigmer, ref, org) {
|
|
|
46
47
|
}
|
|
47
48
|
/**
|
|
48
49
|
* Resolve `ref` (a `sch_…` id, `org/slug`, or bare slug against `org`) and
|
|
49
|
-
* fire it once, immediately (project DD-014).
|
|
50
|
+
* fire it once, immediately (project DD-017 D-5/D-6, amending DD-014).
|
|
50
51
|
*
|
|
51
|
-
* The fire is
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* the
|
|
52
|
+
* The fire is SYNCHRONOUS: the RPC runs the full execution create pipeline
|
|
53
|
+
* and the result names the run's real outcome — the created execution's
|
|
54
|
+
* id, or the refusing gate's copy verbatim. A refused run renders as an
|
|
55
|
+
* error result (non-zero exit) so a scripted test fire fails honestly,
|
|
56
|
+
* but the trigger itself succeeded: the fire is recorded in the
|
|
57
|
+
* schedule's run history either way. A disabled schedule is refused by
|
|
58
|
+
* the server with teaching copy; the CLI relays the server's message
|
|
59
|
+
* verbatim (never pattern-match refusal text).
|
|
56
60
|
*/
|
|
57
61
|
export async function triggerSchedule(stigmer, ref, org) {
|
|
58
62
|
const before = await loadSchedule(stigmer, ref, org);
|
|
@@ -61,15 +65,29 @@ export async function triggerSchedule(stigmer, ref, org) {
|
|
|
61
65
|
throw new UsageError(`Schedule '${ref}' has no id — cannot trigger`);
|
|
62
66
|
}
|
|
63
67
|
const triggered = await stigmer.schedule.trigger(id);
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
section.field("
|
|
68
|
+
const schedule = triggered.schedule ?? before;
|
|
69
|
+
const slug = schedule.metadata?.slug ?? "";
|
|
70
|
+
const name = schedule.metadata?.name || slug;
|
|
71
|
+
if (triggered.outcome === ScheduleRunOutcome.STARTED) {
|
|
72
|
+
const result = CommandResult.success(`Schedule '${name}' fired — run started`);
|
|
73
|
+
const section = result.addSection();
|
|
74
|
+
section.field("Execution", triggered.executionId);
|
|
75
|
+
section.field("Watch it", `stigmer get agentexecution ${triggered.executionId}`);
|
|
76
|
+
if (schedule.status?.nextFireAt !== undefined) {
|
|
77
|
+
section.field("Next cron fire", timestampDate(schedule.status.nextFireAt).toISOString());
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
72
80
|
}
|
|
81
|
+
// The run was refused deterministically (a launch gate said no, or the
|
|
82
|
+
// target agent is gone). The fire happened and is recorded in run
|
|
83
|
+
// history; the refusing gate's copy relays verbatim.
|
|
84
|
+
const what = triggered.outcome === ScheduleRunOutcome.TARGET_MISSING
|
|
85
|
+
? "the target agent was not found"
|
|
86
|
+
: "a launch gate refused the run";
|
|
87
|
+
const result = CommandResult.error(`Schedule '${name}' fired, but ${what}`);
|
|
88
|
+
const section = result.addSection();
|
|
89
|
+
section.field("Reason", triggered.refusalReason);
|
|
90
|
+
result.hint("The fire is recorded in the schedule's run history; fix the cause and trigger again.");
|
|
73
91
|
return result;
|
|
74
92
|
}
|
|
75
93
|
function describeOutcome(schedule, wasPausedReason, wasFailures) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/resources/schedule.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,+BAA+B;AAC/B,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,uEAAuE;AACvE,2EAA2E;AAC3E,uEAAuE;AACvE,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,yEAAyE;AACzE,uEAAuE;AACvE,qEAAqE;AACrE,2CAA2C;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/resources/schedule.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,+BAA+B;AAC/B,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,uEAAuE;AACvE,2EAA2E;AAC3E,uEAAuE;AACvE,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,yEAAyE;AACzE,uEAAuE;AACvE,qEAAqE;AACrE,2CAA2C;AAE3C,OAAO,EAAE,aA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EF,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,eAAe,KAAK,EAAE;YAAE,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;QAC3E,IAAI,WAAW,GAAG,CAAC;YAAE,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IAClF,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC,oFAAoF,CAAC,CAAC;QAClG,MAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;IACzF,CAAC;SAAM,IAAI,QAAQ,CAAC,MAAM,EAAE,UAAU,KAAK,SAAS,EAAE,CAAC;QACrD,MAAM,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAClG,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// execution flag is added here once and both surfaces pick it up.
|
|
4
4
|
|
|
5
5
|
import type { Command } from "commander";
|
|
6
|
-
import type { AgentExecFlags, RunMode } from "../resources/run/prepare.js";
|
|
6
|
+
import type { AgentExecFlags, RunMode, ServiceTierFlag } from "../resources/run/prepare.js";
|
|
7
7
|
|
|
8
8
|
/** Commander collector for repeatable string options. */
|
|
9
9
|
export const collect = (value: string, previous: string[]): string[] => [...previous, value];
|
|
@@ -25,6 +25,7 @@ export interface AgentExecOptions {
|
|
|
25
25
|
model?: string;
|
|
26
26
|
autoApprove?: boolean;
|
|
27
27
|
mode?: string;
|
|
28
|
+
serviceTier?: string;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
/**
|
|
@@ -50,7 +51,8 @@ export function addAgentExecFlags(command: Command, requireMessage = false): Com
|
|
|
50
51
|
.option("--secret-file <path>", "load secrets from file (repeatable, encrypted)", collect, [])
|
|
51
52
|
.option("--model <model>", "LLM model to use (e.g. claude-sonnet-4-6)")
|
|
52
53
|
.option("--auto-approve", "automatically approve all tool executions")
|
|
53
|
-
.option("--mode <mode>", 'interaction mode: "agent" (default) or "plan" (read-only)')
|
|
54
|
+
.option("--mode <mode>", 'interaction mode: "agent" (default) or "plan" (read-only)')
|
|
55
|
+
.option("--service-tier <tier>", 'model service tier: "standard" (default) or "fast" (requires --model naming a model with a fast tier; billed at fast rates)');
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
/** Map parsed commander options onto the shared {@link AgentExecFlags} shape. */
|
|
@@ -71,5 +73,6 @@ export function toAgentExecFlags(options: AgentExecOptions): AgentExecFlags {
|
|
|
71
73
|
model: options.model ?? "",
|
|
72
74
|
autoApprove: options.autoApprove === true,
|
|
73
75
|
mode: (options.mode ?? "") as RunMode,
|
|
76
|
+
serviceTier: (options.serviceTier ?? "") as ServiceTierFlag,
|
|
74
77
|
};
|
|
75
78
|
}
|
|
@@ -35,7 +35,7 @@ Environment variables:
|
|
|
35
35
|
STIGMER_SERVER_ADDRESS gRPC address (default: CLI config, else localhost:7234)
|
|
36
36
|
STIGMER_API_KEY API key (auto-resolved from CLI config for cloud)
|
|
37
37
|
STIGMER_MCP_TRANSPORT stdio | http | both (default: stdio)
|
|
38
|
-
STIGMER_MCP_ROSTER full | records (default: full; records = the five record tools only)
|
|
38
|
+
STIGMER_MCP_ROSTER full | records | channels (default: full; records = the five record tools only, channels = send_channel_message only)
|
|
39
39
|
STIGMER_MCP_HTTP_PORT HTTP listen port (default: 8080)
|
|
40
40
|
STIGMER_MCP_LOG_FORMAT text | json (default: text)
|
|
41
41
|
STIGMER_MCP_LOG_LEVEL debug | info | warn | error (default: info)
|
|
@@ -42,6 +42,7 @@ export async function executeResolvedAgent(input: ResolvedAgentExecInput): Promi
|
|
|
42
42
|
workspaceEntries: prepared.workspaceEntries,
|
|
43
43
|
model: prepared.model,
|
|
44
44
|
mode: prepared.mode,
|
|
45
|
+
serviceTier: prepared.serviceTier,
|
|
45
46
|
autoApproveAll: prepared.autoApproveAll,
|
|
46
47
|
});
|
|
47
48
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// is faked to capture the exact proto sent to the RPC.
|
|
5
5
|
|
|
6
6
|
import { describe, expect, it } from "vitest";
|
|
7
|
-
import { InteractionMode } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
7
|
+
import { InteractionMode, ServiceTier } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
8
8
|
import { create } from "@bufbuild/protobuf";
|
|
9
9
|
import {
|
|
10
10
|
LocalPathSourceSchema,
|
|
@@ -40,6 +40,7 @@ describe("createAgentExecution", () => {
|
|
|
40
40
|
workspaceEntries: [],
|
|
41
41
|
model: "claude",
|
|
42
42
|
mode: "plan",
|
|
43
|
+
serviceTier: "",
|
|
43
44
|
autoApproveAll: true,
|
|
44
45
|
});
|
|
45
46
|
|
|
@@ -67,12 +68,51 @@ describe("createAgentExecution", () => {
|
|
|
67
68
|
workspaceEntries: [],
|
|
68
69
|
model: "",
|
|
69
70
|
mode: "",
|
|
71
|
+
serviceTier: "",
|
|
70
72
|
autoApproveAll: false,
|
|
71
73
|
});
|
|
72
74
|
expect(exec.spec?.message).toBe("hi");
|
|
73
75
|
expect(exec.spec?.executionConfig).toBeUndefined();
|
|
74
76
|
});
|
|
75
77
|
|
|
78
|
+
it("maps --service-tier fast to the enum (#357)", async () => {
|
|
79
|
+
const { fn } = fakeController();
|
|
80
|
+
const exec = await createAgentExecution(fn, {
|
|
81
|
+
agentId: "agt_1",
|
|
82
|
+
orgId: "acme",
|
|
83
|
+
message: "x",
|
|
84
|
+
runtimeEnv: {},
|
|
85
|
+
attachments: [],
|
|
86
|
+
workspaceFileRefs: [],
|
|
87
|
+
workspaceEntries: [],
|
|
88
|
+
model: "composer-2.5",
|
|
89
|
+
mode: "",
|
|
90
|
+
serviceTier: "fast",
|
|
91
|
+
autoApproveAll: false,
|
|
92
|
+
});
|
|
93
|
+
expect(exec.spec?.executionConfig?.serviceTier).toBe(ServiceTier.FAST);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("maps an explicit --service-tier standard to STANDARD, not UNSPECIFIED", async () => {
|
|
97
|
+
// Unspecified-vs-explicit-standard is a load-bearing ledger
|
|
98
|
+
// distinction (#357): an explicit choice must survive to the proto.
|
|
99
|
+
const { fn } = fakeController();
|
|
100
|
+
const exec = await createAgentExecution(fn, {
|
|
101
|
+
agentId: "agt_1",
|
|
102
|
+
orgId: "acme",
|
|
103
|
+
message: "x",
|
|
104
|
+
runtimeEnv: {},
|
|
105
|
+
attachments: [],
|
|
106
|
+
workspaceFileRefs: [],
|
|
107
|
+
workspaceEntries: [],
|
|
108
|
+
model: "",
|
|
109
|
+
mode: "",
|
|
110
|
+
serviceTier: "standard",
|
|
111
|
+
autoApproveAll: false,
|
|
112
|
+
});
|
|
113
|
+
expect(exec.spec?.executionConfig?.serviceTier).toBe(ServiceTier.STANDARD);
|
|
114
|
+
});
|
|
115
|
+
|
|
76
116
|
it("leaves InteractionMode unspecified for agent mode", async () => {
|
|
77
117
|
const { fn } = fakeController();
|
|
78
118
|
const exec = await createAgentExecution(fn, {
|
|
@@ -85,6 +125,7 @@ describe("createAgentExecution", () => {
|
|
|
85
125
|
workspaceEntries: [],
|
|
86
126
|
model: "m",
|
|
87
127
|
mode: "agent",
|
|
128
|
+
serviceTier: "",
|
|
88
129
|
autoApproveAll: false,
|
|
89
130
|
});
|
|
90
131
|
expect(exec.spec?.sessionId).toBe("ses_1");
|
|
@@ -110,6 +151,7 @@ describe("createAgentExecution", () => {
|
|
|
110
151
|
workspaceEntries: [entry],
|
|
111
152
|
model: "",
|
|
112
153
|
mode: "",
|
|
154
|
+
serviceTier: "",
|
|
113
155
|
autoApproveAll: false,
|
|
114
156
|
});
|
|
115
157
|
|
|
@@ -132,6 +174,7 @@ describe("createAgentExecution", () => {
|
|
|
132
174
|
workspaceEntries: [],
|
|
133
175
|
model: "",
|
|
134
176
|
mode: "",
|
|
177
|
+
serviceTier: "",
|
|
135
178
|
autoApproveAll: false,
|
|
136
179
|
});
|
|
137
180
|
expect(exec.spec?.sessionSpec).toBeUndefined();
|
|
@@ -10,7 +10,7 @@ import type { Client } from "@connectrpc/connect";
|
|
|
10
10
|
import { create, type DescService } from "@bufbuild/protobuf";
|
|
11
11
|
import { type AgentExecution, AgentExecutionSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
12
12
|
import { AgentExecutionCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/command_pb";
|
|
13
|
-
import { InteractionMode } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
13
|
+
import { InteractionMode, ServiceTier } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
14
14
|
import type { Attachment } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
|
|
15
15
|
import {
|
|
16
16
|
AgentExecutionSpecSchema,
|
|
@@ -29,7 +29,7 @@ import { WorkflowExecutionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/
|
|
|
29
29
|
import { ExecutionValueSchema } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/spec_pb";
|
|
30
30
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
31
31
|
import type { RuntimeEnv } from "./env.js";
|
|
32
|
-
import type { RunMode } from "./prepare.js";
|
|
32
|
+
import type { RunMode, ServiceTierFlag } from "./prepare.js";
|
|
33
33
|
|
|
34
34
|
const API_VERSION = "agentic.stigmer.ai/v1";
|
|
35
35
|
|
|
@@ -57,6 +57,7 @@ export interface CreateAgentExecutionInput {
|
|
|
57
57
|
readonly workspaceEntries: readonly WorkspaceEntry[];
|
|
58
58
|
readonly model: string;
|
|
59
59
|
readonly mode: RunMode;
|
|
60
|
+
readonly serviceTier: ServiceTierFlag;
|
|
60
61
|
readonly autoApproveAll: boolean;
|
|
61
62
|
}
|
|
62
63
|
|
|
@@ -83,7 +84,7 @@ export async function createAgentExecution(
|
|
|
83
84
|
input.workspaceEntries.length > 0
|
|
84
85
|
? create(SessionSpecSchema, { workspaceEntries: [...input.workspaceEntries] })
|
|
85
86
|
: undefined,
|
|
86
|
-
executionConfig: buildExecutionConfig(input.model, input.mode),
|
|
87
|
+
executionConfig: buildExecutionConfig(input.model, input.mode, input.serviceTier),
|
|
87
88
|
}),
|
|
88
89
|
});
|
|
89
90
|
return controller(AgentExecutionCommandController).create(execution);
|
|
@@ -119,14 +120,22 @@ export async function createWorkflowExecution(
|
|
|
119
120
|
return controller(WorkflowExecutionCommandController).create(execution);
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
// Build ExecutionConfig, or undefined when
|
|
123
|
+
// Build ExecutionConfig, or undefined when no flag is set so the backend
|
|
123
124
|
// applies its defaults. Mirrors Go's buildExecutionConfig (only "plan" maps to a
|
|
124
|
-
// non-default InteractionMode; "agent"/"" leave it unspecified).
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
// non-default InteractionMode; "agent"/"" leave it unspecified). An explicit
|
|
126
|
+
// --service-tier value maps to the enum even for "standard": unspecified vs
|
|
127
|
+
// explicit-standard is a load-bearing ledger distinction (#357).
|
|
128
|
+
function buildExecutionConfig(
|
|
129
|
+
model: string,
|
|
130
|
+
mode: RunMode,
|
|
131
|
+
serviceTier: ServiceTierFlag,
|
|
132
|
+
): ExecutionConfig | undefined {
|
|
133
|
+
if (model === "" && mode === "" && serviceTier === "") return undefined;
|
|
127
134
|
const cfg = create(ExecutionConfigSchema);
|
|
128
135
|
if (model !== "") cfg.modelName = model;
|
|
129
136
|
if (mode === "plan") cfg.interactionMode = InteractionMode.PLAN;
|
|
137
|
+
if (serviceTier === "fast") cfg.serviceTier = ServiceTier.FAST;
|
|
138
|
+
else if (serviceTier === "standard") cfg.serviceTier = ServiceTier.STANDARD;
|
|
130
139
|
return cfg;
|
|
131
140
|
}
|
|
132
141
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { describe, expect, it } from "vitest";
|
|
6
6
|
import { ApprovalAction } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
7
7
|
import type { Stigmer } from "@stigmer/sdk";
|
|
8
|
-
import { type AgentExecFlags, parseApprovalAction, prepareAgentExec, validateMode } from "./prepare.js";
|
|
8
|
+
import { type AgentExecFlags, parseApprovalAction, prepareAgentExec, validateMode, validateServiceTier } from "./prepare.js";
|
|
9
9
|
|
|
10
10
|
describe("parseApprovalAction", () => {
|
|
11
11
|
it("maps each accepted value (case-insensitive)", () => {
|
|
@@ -35,6 +35,18 @@ describe("validateMode", () => {
|
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
describe("validateServiceTier", () => {
|
|
39
|
+
it("accepts empty, standard, and fast", () => {
|
|
40
|
+
expect(() => validateServiceTier("")).not.toThrow();
|
|
41
|
+
expect(() => validateServiceTier("standard")).not.toThrow();
|
|
42
|
+
expect(() => validateServiceTier("fast")).not.toThrow();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("rejects anything else before a network round trip", () => {
|
|
46
|
+
expect(() => validateServiceTier("turbo")).toThrow(/must be "standard" or "fast"/);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
38
50
|
const BASE_FLAGS: AgentExecFlags = {
|
|
39
51
|
message: "hi",
|
|
40
52
|
attach: [],
|
|
@@ -51,6 +63,7 @@ const BASE_FLAGS: AgentExecFlags = {
|
|
|
51
63
|
model: "",
|
|
52
64
|
autoApprove: false,
|
|
53
65
|
mode: "",
|
|
66
|
+
serviceTier: "",
|
|
54
67
|
};
|
|
55
68
|
|
|
56
69
|
// prepareAgentExec only touches client.agentExecution for attachment uploads;
|
|
@@ -19,6 +19,13 @@ import { localWorkspaceRoots, parseWorkspaceEntries } from "./workspace.js";
|
|
|
19
19
|
/** The interaction mode requested for the run; "" means the agent default. */
|
|
20
20
|
export type RunMode = "" | "agent" | "plan";
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* The `--service-tier` flag's value space (#357). Empty means unset —
|
|
24
|
+
* distinct from an explicit "standard" so the ledger keeps the
|
|
25
|
+
* unspecified-vs-explicit distinction.
|
|
26
|
+
*/
|
|
27
|
+
export type ServiceTierFlag = "" | "standard" | "fast";
|
|
28
|
+
|
|
22
29
|
/** Raw agent-execution flags shared by `run` and `draft` (Go's agentExecFlags). */
|
|
23
30
|
export interface AgentExecFlags {
|
|
24
31
|
readonly message: string;
|
|
@@ -36,6 +43,7 @@ export interface AgentExecFlags {
|
|
|
36
43
|
readonly model: string;
|
|
37
44
|
readonly autoApprove: boolean;
|
|
38
45
|
readonly mode: RunMode;
|
|
46
|
+
readonly serviceTier: ServiceTierFlag;
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
/**
|
|
@@ -54,6 +62,7 @@ export interface PreparedRun {
|
|
|
54
62
|
readonly model: string;
|
|
55
63
|
readonly autoApproveAll: boolean;
|
|
56
64
|
readonly mode: RunMode;
|
|
65
|
+
readonly serviceTier: ServiceTierFlag;
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
/**
|
|
@@ -68,6 +77,7 @@ export async function prepareAgentExec(
|
|
|
68
77
|
): Promise<PreparedRun> {
|
|
69
78
|
const defaultAction = parseApprovalAction(flags.approveDefault);
|
|
70
79
|
validateMode(flags.mode);
|
|
80
|
+
validateServiceTier(flags.serviceTier);
|
|
71
81
|
|
|
72
82
|
const workspaceEntries = parseWorkspaceEntries(flags.workspace, flags.branch, flags.commit);
|
|
73
83
|
|
|
@@ -100,6 +110,7 @@ export async function prepareAgentExec(
|
|
|
100
110
|
model: flags.model,
|
|
101
111
|
autoApproveAll: flags.autoApprove,
|
|
102
112
|
mode: flags.mode,
|
|
113
|
+
serviceTier: flags.serviceTier,
|
|
103
114
|
};
|
|
104
115
|
}
|
|
105
116
|
|
|
@@ -137,3 +148,17 @@ export function validateMode(mode: string): asserts mode is RunMode {
|
|
|
137
148
|
throw new UsageError(`invalid --mode value "${mode}": must be "agent" or "plan"`);
|
|
138
149
|
}
|
|
139
150
|
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Validate the `--service-tier` flag. Empty means "platform default" (which
|
|
154
|
+
* resolves to standard — never the provider account default, #357). The
|
|
155
|
+
* server refuses fast on models without a registry fast variant; this check
|
|
156
|
+
* only catches spelling errors before a network round trip.
|
|
157
|
+
*/
|
|
158
|
+
export function validateServiceTier(tier: string): asserts tier is ServiceTierFlag {
|
|
159
|
+
if (tier !== "" && tier !== "standard" && tier !== "fast") {
|
|
160
|
+
throw new UsageError(
|
|
161
|
+
`invalid --service-tier value "${tier}": must be "standard" or "fast"`,
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
18
18
|
import type { Schedule } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/api_pb";
|
|
19
|
+
import { ScheduleRunOutcome } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/io_pb";
|
|
19
20
|
import type { Stigmer } from "@stigmer/sdk";
|
|
20
21
|
import { UsageError } from "../errors/index.js";
|
|
21
22
|
import { CommandResult } from "../output/index.js";
|
|
@@ -58,13 +59,16 @@ async function loadSchedule(stigmer: Stigmer, ref: string, org: string): Promise
|
|
|
58
59
|
|
|
59
60
|
/**
|
|
60
61
|
* Resolve `ref` (a `sch_…` id, `org/slug`, or bare slug against `org`) and
|
|
61
|
-
* fire it once, immediately (project DD-014).
|
|
62
|
+
* fire it once, immediately (project DD-017 D-5/D-6, amending DD-014).
|
|
62
63
|
*
|
|
63
|
-
* The fire is
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* the
|
|
64
|
+
* The fire is SYNCHRONOUS: the RPC runs the full execution create pipeline
|
|
65
|
+
* and the result names the run's real outcome — the created execution's
|
|
66
|
+
* id, or the refusing gate's copy verbatim. A refused run renders as an
|
|
67
|
+
* error result (non-zero exit) so a scripted test fire fails honestly,
|
|
68
|
+
* but the trigger itself succeeded: the fire is recorded in the
|
|
69
|
+
* schedule's run history either way. A disabled schedule is refused by
|
|
70
|
+
* the server with teaching copy; the CLI relays the server's message
|
|
71
|
+
* verbatim (never pattern-match refusal text).
|
|
68
72
|
*/
|
|
69
73
|
export async function triggerSchedule(stigmer: Stigmer, ref: string, org: string): Promise<CommandResult> {
|
|
70
74
|
const before = await loadSchedule(stigmer, ref, org);
|
|
@@ -74,18 +78,31 @@ export async function triggerSchedule(stigmer: Stigmer, ref: string, org: string
|
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
const triggered = await stigmer.schedule.trigger(id);
|
|
81
|
+
const schedule = triggered.schedule ?? before;
|
|
82
|
+
const slug = schedule.metadata?.slug ?? "";
|
|
83
|
+
const name = schedule.metadata?.name || slug;
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
if (triggered.outcome === ScheduleRunOutcome.STARTED) {
|
|
86
|
+
const result = CommandResult.success(`Schedule '${name}' fired — run started`);
|
|
87
|
+
const section = result.addSection();
|
|
88
|
+
section.field("Execution", triggered.executionId);
|
|
89
|
+
section.field("Watch it", `stigmer get agentexecution ${triggered.executionId}`);
|
|
90
|
+
if (schedule.status?.nextFireAt !== undefined) {
|
|
91
|
+
section.field("Next cron fire", timestampDate(schedule.status.nextFireAt).toISOString());
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
87
94
|
}
|
|
88
95
|
|
|
96
|
+
// The run was refused deterministically (a launch gate said no, or the
|
|
97
|
+
// target agent is gone). The fire happened and is recorded in run
|
|
98
|
+
// history; the refusing gate's copy relays verbatim.
|
|
99
|
+
const what = triggered.outcome === ScheduleRunOutcome.TARGET_MISSING
|
|
100
|
+
? "the target agent was not found"
|
|
101
|
+
: "a launch gate refused the run";
|
|
102
|
+
const result = CommandResult.error(`Schedule '${name}' fired, but ${what}`);
|
|
103
|
+
const section = result.addSection();
|
|
104
|
+
section.field("Reason", triggered.refusalReason);
|
|
105
|
+
result.hint("The fire is recorded in the schedule's run history; fix the cause and trigger again.");
|
|
89
106
|
return result;
|
|
90
107
|
}
|
|
91
108
|
|