@stigmer/mcp-server 3.11.0 → 3.12.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/README.md +4 -22
- package/cli/mcp-server-stigmer.js +11 -11
- package/config.d.ts +1 -5
- package/config.d.ts.map +1 -1
- package/config.js +2 -2
- package/config.js.map +1 -1
- package/domains/resourceuri.d.ts.map +1 -1
- package/domains/resourceuri.js +0 -1
- package/domains/resourceuri.js.map +1 -1
- package/domains/search/tools.d.ts.map +1 -1
- package/domains/search/tools.js +4 -5
- package/domains/search/tools.js.map +1 -1
- package/gen/agent.d.ts +1 -57
- package/gen/agent.d.ts.map +1 -1
- package/gen/agent.js +5 -28
- package/gen/agent.js.map +1 -1
- package/gen/environment.d.ts +1 -1
- package/gen/environment.d.ts.map +1 -1
- package/gen/environment.js +3 -3
- package/gen/environment.js.map +1 -1
- package/gen/mcpserver.d.ts +1 -1
- package/gen/mcpserver.d.ts.map +1 -1
- package/gen/mcpserver.js +7 -7
- package/gen/mcpserver.js.map +1 -1
- package/gen/workflow.d.ts +3 -3
- package/gen/workflow.d.ts.map +1 -1
- package/gen/workflow.js +34 -34
- package/gen/workflow.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/server.d.ts +6 -18
- package/server.d.ts.map +1 -1
- package/server.js +6 -36
- package/server.js.map +1 -1
- package/src/config.ts +3 -7
- package/src/domains/apply.integration.test.ts +3 -40
- package/src/domains/deletes.integration.test.ts +1 -25
- package/src/domains/reads.integration.test.ts +1 -18
- package/src/domains/resources.integration.test.ts +0 -18
- package/src/domains/resourceuri.test.ts +0 -2
- package/src/domains/resourceuri.ts +0 -1
- package/src/domains/search/search.integration.test.ts +3 -5
- package/src/domains/search/tools.ts +4 -5
- package/src/gen/agent.ts +5 -32
- package/src/gen/environment.ts +3 -3
- package/src/gen/mcpserver.ts +7 -7
- package/src/gen/workflow.ts +34 -34
- package/src/http.integration.test.ts +2 -3
- package/src/index.ts +0 -2
- package/src/server.ts +6 -36
- package/domains/datastores/apply.d.ts +0 -4
- package/domains/datastores/apply.d.ts.map +0 -1
- package/domains/datastores/apply.js +0 -28
- package/domains/datastores/apply.js.map +0 -1
- package/domains/datastores/delete.d.ts +0 -3
- package/domains/datastores/delete.d.ts.map +0 -1
- package/domains/datastores/delete.js +0 -38
- package/domains/datastores/delete.js.map +0 -1
- package/domains/datastores/fetch.d.ts +0 -3
- package/domains/datastores/fetch.d.ts.map +0 -1
- package/domains/datastores/fetch.js +0 -23
- package/domains/datastores/fetch.js.map +0 -1
- package/domains/datastores/resources.d.ts +0 -5
- package/domains/datastores/resources.d.ts.map +0 -1
- package/domains/datastores/resources.js +0 -16
- package/domains/datastores/resources.js.map +0 -1
- package/domains/datastores/tools.d.ts +0 -5
- package/domains/datastores/tools.d.ts.map +0 -1
- package/domains/datastores/tools.js +0 -46
- package/domains/datastores/tools.js.map +0 -1
- package/domains/records/calls.d.ts +0 -48
- package/domains/records/calls.d.ts.map +0 -1
- package/domains/records/calls.js +0 -118
- package/domains/records/calls.js.map +0 -1
- package/domains/records/errors.d.ts +0 -24
- package/domains/records/errors.d.ts.map +0 -1
- package/domains/records/errors.js +0 -79
- package/domains/records/errors.js.map +0 -1
- package/domains/records/tools.d.ts +0 -7
- package/domains/records/tools.d.ts.map +0 -1
- package/domains/records/tools.js +0 -139
- package/domains/records/tools.js.map +0 -1
- package/gen/datastore.d.ts +0 -861
- package/gen/datastore.d.ts.map +0 -1
- package/gen/datastore.js +0 -267
- package/gen/datastore.js.map +0 -1
- package/src/domains/datastores/apply.ts +0 -33
- package/src/domains/datastores/delete.ts +0 -47
- package/src/domains/datastores/fetch.ts +0 -32
- package/src/domains/datastores/resources.ts +0 -21
- package/src/domains/datastores/tools.ts +0 -76
- package/src/domains/records/calls.ts +0 -209
- package/src/domains/records/errors.ts +0 -98
- package/src/domains/records/records.integration.test.ts +0 -313
- package/src/domains/records/tools.ts +0 -210
- package/src/gen/datastore.ts +0 -264
package/src/gen/agent.ts
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
import { generateSlug, visibilityFromString } from "./apply-runtime.js";
|
|
7
7
|
import { create } from "@bufbuild/protobuf";
|
|
8
8
|
import { AgentSchema, type Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
9
|
-
import { AgentSpecSchema, ToolApprovalOverrideSchema, McpServerUsageSchema, McpAccessSchema, SubAgentSchema
|
|
9
|
+
import { AgentSpecSchema, ToolApprovalOverrideSchema, McpServerUsageSchema, McpAccessSchema, SubAgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
10
10
|
import { EnvVarDeclarationSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
11
11
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
12
12
|
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
13
13
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
|
|
16
|
-
/** AgentSpec defines the configurable properties of an agent.
|
|
16
|
+
/** AgentSpec defines the configurable properties of an agent. */
|
|
17
17
|
export const AgentInputShape = {
|
|
18
18
|
name: z.string().describe("Human-readable name of the resource."),
|
|
19
19
|
slug: z.string().optional().describe("URL-friendly identifier (lowercase alphanumeric with hyphens). Auto-generated from name if omitted."),
|
|
@@ -28,7 +28,6 @@ export const AgentInputShape = {
|
|
|
28
28
|
skill_refs: z.array(z.lazy(() => SkillRefInputSchema)).optional().describe("Skill resources providing additional knowledge to the agent."),
|
|
29
29
|
sub_agents: z.array(z.lazy(() => SubAgentInputSchema)).optional().describe("Sub-agents that can be delegated to. Sub-agents can access a subset of the parent's MCP servers and tools."),
|
|
30
30
|
env: z.record(z.lazy(() => EnvVarDeclarationInputSchema)).optional().describe("Environment variable declarations for this agent. Keys are variable names; values describe their metadata and optionality."),
|
|
31
|
-
datastore_usages: z.array(z.lazy(() => DatastoreUsageInputSchema)).optional().describe("Datastores this agent can use. Each entry must reference a Datastore resource by slug."),
|
|
32
31
|
} as const;
|
|
33
32
|
|
|
34
33
|
export const AgentInputSchema = z.object(AgentInputShape);
|
|
@@ -49,7 +48,7 @@ type ToolApprovalOverrideInput = z.infer<typeof ToolApprovalOverrideInputSchema>
|
|
|
49
48
|
|
|
50
49
|
const McpServerUsageInputSchema = z.object({
|
|
51
50
|
mcp_server_ref: z.lazy(() => McpServerRefInputSchema).describe("Reference to the McpServer resource."),
|
|
52
|
-
enabled_tools: z.array(z.string()).optional().describe("Tools to enable from this MCP server for this agent. Empty list uses the McpServer's default_enabled_tools. Sub-agents can only restrict this set further, not expand it.
|
|
51
|
+
enabled_tools: z.array(z.string()).optional().describe("Tools to enable from this MCP server for this agent. Empty list uses the McpServer's default_enabled_tools. Sub-agents can only restrict this set further, not expand it."),
|
|
53
52
|
tool_approval_overrides: z.array(z.lazy(() => ToolApprovalOverrideInputSchema)).optional().describe("Override approval requirements for specific tools. Takes precedence over McpServerSpec.pinned_tool_approvals and McpServerStatus.tool_approvals. Scoped to THIS usage's server: an override applies only to tools of the McpServer referenced by mcp_server_ref — a same-named tool on another server is unaffected."),
|
|
54
53
|
});
|
|
55
54
|
type McpServerUsageInput = z.infer<typeof McpServerUsageInputSchema>;
|
|
@@ -78,23 +77,12 @@ const SubAgentInputSchema = z.object({
|
|
|
78
77
|
type SubAgentInput = z.infer<typeof SubAgentInputSchema>;
|
|
79
78
|
|
|
80
79
|
const EnvVarDeclarationInputSchema = z.object({
|
|
81
|
-
is_secret: z.boolean().optional().describe("Whether the resolved value should be treated as a secret.
|
|
80
|
+
is_secret: z.boolean().optional().describe("Whether the resolved value should be treated as a secret."),
|
|
82
81
|
description: z.string().optional().describe("Human-readable description shown in the UI credential form. Should explain what the variable is used for and where to obtain it."),
|
|
83
|
-
optional: z.boolean().optional().describe("Whether this variable is optional.
|
|
82
|
+
optional: z.boolean().optional().describe("Whether this variable is optional."),
|
|
84
83
|
});
|
|
85
84
|
type EnvVarDeclarationInput = z.infer<typeof EnvVarDeclarationInputSchema>;
|
|
86
85
|
|
|
87
|
-
const DatastoreRefInputSchema = z.object({
|
|
88
|
-
org: z.string().optional().describe("Organization that owns the referenced resource. When non-empty: must be a valid org slug (lowercase alphanumeric with hyphens, starts with a letter, 1-63 characters). Example: 'stigmer', 'acme-corp'. When empty: the reference is relative — the server resolves it to the parent resource's organization at write time. All stored and returned references always have org populated (absolute form). Use empty org for same-org references (the common case). Use explicit org for cross-org references (e.g., marketplace resources)."),
|
|
89
|
-
slug: z.string().describe("Resource slug (user-friendly identifier, unique within org). Format: lowercase alphanumeric with hyphens, must start with a letter and end with a letter or digit (e.g., 'web-search', 'code-reviewer'). Length: 2-63 characters."),
|
|
90
|
-
});
|
|
91
|
-
type DatastoreRefInput = z.infer<typeof DatastoreRefInputSchema>;
|
|
92
|
-
|
|
93
|
-
const DatastoreUsageInputSchema = z.object({
|
|
94
|
-
datastore_ref: z.lazy(() => DatastoreRefInputSchema).describe("Reference to the Datastore resource."),
|
|
95
|
-
});
|
|
96
|
-
type DatastoreUsageInput = z.infer<typeof DatastoreUsageInputSchema>;
|
|
97
|
-
|
|
98
86
|
|
|
99
87
|
/** Build the fully-formed Agent proto from the flat MCP apply input. */
|
|
100
88
|
export function agentInputToProto(input: AgentInput): Agent {
|
|
@@ -109,7 +97,6 @@ export function agentInputToProto(input: AgentInput): Agent {
|
|
|
109
97
|
if (input.env !== undefined) {
|
|
110
98
|
for (const [k, v] of Object.entries(input.env)) spec.env[k] = envVarDeclarationInputToProto(v);
|
|
111
99
|
}
|
|
112
|
-
if (input.datastore_usages !== undefined) spec.datastoreUsages = input.datastore_usages.map(datastoreUsageInputToProto);
|
|
113
100
|
return Object.assign(create(AgentSchema), {
|
|
114
101
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
115
102
|
kind: "Agent",
|
|
@@ -184,17 +171,3 @@ function envVarDeclarationInputToProto(input: EnvVarDeclarationInput) {
|
|
|
184
171
|
return result;
|
|
185
172
|
}
|
|
186
173
|
|
|
187
|
-
function datastoreRefInputToProto(input: DatastoreRefInput) {
|
|
188
|
-
return create(ApiResourceReferenceSchema, {
|
|
189
|
-
org: input.org,
|
|
190
|
-
slug: input.slug,
|
|
191
|
-
kind: ApiResourceKind.datastore,
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function datastoreUsageInputToProto(input: DatastoreUsageInput) {
|
|
196
|
-
const result = create(DatastoreUsageSchema);
|
|
197
|
-
if (input.datastore_ref !== undefined) result.datastoreRef = datastoreRefInputToProto(input.datastore_ref);
|
|
198
|
-
return result;
|
|
199
|
-
}
|
|
200
|
-
|
package/src/gen/environment.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { EnvironmentSpecSchema, EnvironmentValueSchema } from "@stigmer/protos/a
|
|
|
10
10
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
|
-
/** EnvironmentSpec defines the configurable properties of an environment.
|
|
13
|
+
/** EnvironmentSpec defines the configurable properties of an environment. */
|
|
14
14
|
export const EnvironmentInputShape = {
|
|
15
15
|
name: z.string().describe("Human-readable name of the resource."),
|
|
16
16
|
slug: z.string().optional().describe("URL-friendly identifier (lowercase alphanumeric with hyphens). Auto-generated from name if omitted."),
|
|
@@ -26,8 +26,8 @@ export const EnvironmentInputSchema = z.object(EnvironmentInputShape);
|
|
|
26
26
|
export type EnvironmentInput = z.infer<typeof EnvironmentInputSchema>;
|
|
27
27
|
|
|
28
28
|
const EnvironmentValueInputSchema = z.object({
|
|
29
|
-
value: z.string().optional().describe("The configuration or secret string.
|
|
30
|
-
is_secret: z.boolean().optional().describe("Whether this value should be treated as a secret.
|
|
29
|
+
value: z.string().optional().describe("The configuration or secret string."),
|
|
30
|
+
is_secret: z.boolean().optional().describe("Whether this value should be treated as a secret."),
|
|
31
31
|
description: z.string().optional().describe("Human-readable description of what this value is used for."),
|
|
32
32
|
});
|
|
33
33
|
type EnvironmentValueInput = z.infer<typeof EnvironmentValueInputSchema>;
|
package/src/gen/mcpserver.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/a
|
|
|
13
13
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
|
|
16
|
-
/** McpServerSpec defines the configurable properties of an MCP server.
|
|
16
|
+
/** McpServerSpec defines the configurable properties of an MCP server. */
|
|
17
17
|
export const McpServerInputShape = {
|
|
18
18
|
name: z.string().describe("Human-readable name of the resource."),
|
|
19
19
|
slug: z.string().optional().describe("URL-friendly identifier (lowercase alphanumeric with hyphens). Auto-generated from name if omitted."),
|
|
@@ -25,9 +25,9 @@ export const McpServerInputShape = {
|
|
|
25
25
|
icon_url: z.string().optional().describe("Icon URL for UI display in marketplace and agent configuration screens. Should be a publicly accessible URL to an image (SVG, PNG, or JPEG). Example: 'https://github.githubassets.com/favicons/favicon.svg'"),
|
|
26
26
|
stdio: z.lazy(() => StdioServerConfigInputSchema).optional().describe("stdio-based server (subprocess with stdin/stdout communication). Most common type - used for Node.js, Python, and other CLI-based MCP servers."),
|
|
27
27
|
http: z.lazy(() => HttpServerConfigInputSchema).optional().describe("HTTP-based server (HTTP + Server-Sent Events communication). Used for remote/managed MCP services accessible over the network."),
|
|
28
|
-
default_enabled_tools: z.array(z.string()).optional().describe("Default tools to enable from this MCP server. Empty list means all tools are enabled by default. Applies whenever an agent's McpServerUsage.enabled_tools is empty.
|
|
29
|
-
env: z.record(z.lazy(() => EnvVarDeclarationInputSchema)).optional().describe("Environment variable declarations for this MCP server. Keys are variable names; values describe their metadata and optionality.
|
|
30
|
-
pinned_tool_approvals: z.array(z.lazy(() => ToolApprovalPolicyInputSchema)).optional().describe("Manual tool approval overrides set by the MCP server owner.
|
|
28
|
+
default_enabled_tools: z.array(z.string()).optional().describe("Default tools to enable from this MCP server. Empty list means all tools are enabled by default. Applies whenever an agent's McpServerUsage.enabled_tools is empty."),
|
|
29
|
+
env: z.record(z.lazy(() => EnvVarDeclarationInputSchema)).optional().describe("Environment variable declarations for this MCP server. Keys are variable names; values describe their metadata and optionality."),
|
|
30
|
+
pinned_tool_approvals: z.array(z.lazy(() => ToolApprovalPolicyInputSchema)).optional().describe("Manual tool approval overrides set by the MCP server owner."),
|
|
31
31
|
repository_url: z.string().optional().describe("URL of the upstream source repository for this MCP server. Shown in the marketplace so users can inspect the implementation for trust and transparency. Example: 'https://github.com/modelcontextprotocol/servers'"),
|
|
32
32
|
github_stars: z.number().optional().describe("GitHub star count at the time of curation. Used as a popularity signal in marketplace display. 0 if unknown or non-GitHub repository."),
|
|
33
33
|
auth: z.lazy(() => McpServerAuthInputSchema).optional().describe("OAuth authentication configuration for automated credential acquisition. When set, the MCP server's Connect page offers an OAuth flow instead of (or in addition to) manual credential entry. The acquired access token is stored in a system-managed environment (identified by grant.environment_id) as the env var named by auth.target_env_var. That env var must also be declared in env so the execution pipeline knows about it."),
|
|
@@ -45,16 +45,16 @@ type StdioServerConfigInput = z.infer<typeof StdioServerConfigInputSchema>;
|
|
|
45
45
|
|
|
46
46
|
const HttpServerConfigInputSchema = z.object({
|
|
47
47
|
url: z.string().describe("Base URL of the MCP server endpoint. Must be a valid HTTP or HTTPS URL. Examples: - 'http://localhost:3000/mcp' - 'https://mcp.example.com/v1' - 'https://api.company.com/mcp/github'"),
|
|
48
|
-
headers: z.record(z.string()).optional().describe("HTTP headers to include with every request. Use for authentication, API versioning, or custom routing. Header values can reference environment variables using ${VAR_NAME} syntax. These placeholders are resolved at runtime from AgentInstance's environment. Examples: 'Authorization': 'Bearer ${API_TOKEN}' 'X-API-Version': '2024-01' 'X-Tenant-ID': '${TENANT_ID}'
|
|
48
|
+
headers: z.record(z.string()).optional().describe("HTTP headers to include with every request. Use for authentication, API versioning, or custom routing. Header values can reference environment variables using ${VAR_NAME} syntax. These placeholders are resolved at runtime from AgentInstance's environment. Examples: 'Authorization': 'Bearer ${API_TOKEN}' 'X-API-Version': '2024-01' 'X-Tenant-ID': '${TENANT_ID}'"),
|
|
49
49
|
query_params: z.record(z.string()).optional().describe("Query parameters to append to the URL. Values can reference environment variables using ${VAR_NAME} syntax. Examples: 'region': '${AWS_REGION}' 'version': 'v1'"),
|
|
50
50
|
timeout_seconds: z.number().optional().describe("Timeout for HTTP requests in seconds. Applies to both the initial connection and response streaming. Default: 30 seconds if not specified. Set higher values for MCP servers that perform long-running operations."),
|
|
51
51
|
});
|
|
52
52
|
type HttpServerConfigInput = z.infer<typeof HttpServerConfigInputSchema>;
|
|
53
53
|
|
|
54
54
|
const EnvVarDeclarationInputSchema = z.object({
|
|
55
|
-
is_secret: z.boolean().optional().describe("Whether the resolved value should be treated as a secret.
|
|
55
|
+
is_secret: z.boolean().optional().describe("Whether the resolved value should be treated as a secret."),
|
|
56
56
|
description: z.string().optional().describe("Human-readable description shown in the UI credential form. Should explain what the variable is used for and where to obtain it."),
|
|
57
|
-
optional: z.boolean().optional().describe("Whether this variable is optional.
|
|
57
|
+
optional: z.boolean().optional().describe("Whether this variable is optional."),
|
|
58
58
|
});
|
|
59
59
|
type EnvVarDeclarationInput = z.infer<typeof EnvVarDeclarationInputSchema>;
|
|
60
60
|
|
package/src/gen/workflow.ts
CHANGED
|
@@ -40,7 +40,7 @@ import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/a
|
|
|
40
40
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
41
41
|
import { z } from "zod";
|
|
42
42
|
|
|
43
|
-
/** WorkflowSpec defines the configurable properties of a workflow.
|
|
43
|
+
/** WorkflowSpec defines the configurable properties of a workflow. */
|
|
44
44
|
export const WorkflowInputShape = {
|
|
45
45
|
name: z.string().describe("Human-readable name of the resource."),
|
|
46
46
|
slug: z.string().optional().describe("URL-friendly identifier (lowercase alphanumeric with hyphens). Auto-generated from name if omitted."),
|
|
@@ -70,7 +70,7 @@ type WorkflowDocumentInput = z.infer<typeof WorkflowDocumentInputSchema>;
|
|
|
70
70
|
const RunConfigInputSchema = z.object({
|
|
71
71
|
model_name: z.string().optional().describe("The model each run uses. Example: 'claude-sonnet-4-6'."),
|
|
72
72
|
max_cost_usd: z.number().optional().describe("Maximum estimated cost in USD per run. The surface's platform execution profile caps this value; the lower bound wins."),
|
|
73
|
-
max_tool_rounds: z.number().optional().describe("Maximum model-to-tools reasoning cycles per run. The surface's platform execution profile caps this value; the lower bound wins.
|
|
73
|
+
max_tool_rounds: z.number().optional().describe("Maximum model-to-tools reasoning cycles per run. The surface's platform execution profile caps this value; the lower bound wins."),
|
|
74
74
|
service_tier: z.string().optional().describe("Service tier for each run's model calls: standard (the default) or fast, where fast bills at the model's fast-tier rates and requires a model that offers one. In workflow YAML the shorthand spellings 'standard'/'fast' are accepted alongside the canonical enum names. Mirrors ExecutionConfig.service_tier: UNSPECIFIED inherits the surface's platform default, which itself resolves to STANDARD — never the provider account default. FAST requires model_name (here or from the platform profile) to name a model with a registry fast pricing variant; validated fail-closed at create. Allowed values: SERVICE_TIER_STANDARD, SERVICE_TIER_FAST."),
|
|
75
75
|
});
|
|
76
76
|
type RunConfigInput = z.infer<typeof RunConfigInputSchema>;
|
|
@@ -87,8 +87,8 @@ const GitRepoSourceInputSchema = z.object({
|
|
|
87
87
|
url: z.string().describe("HTTPS clone URL for the repository."),
|
|
88
88
|
branch: z.string().optional().describe("Branch to clone. When empty, the repository's default branch is used."),
|
|
89
89
|
commit: z.string().optional().describe("Commit SHA to checkout after cloning. When set, the workspace is checked out at this exact commit. When both branch and commit are set, the branch is cloned first, then the commit is checked out."),
|
|
90
|
-
depth: z.number().optional().describe("Number of commits to include in the clone history. When not set, defaults to a shallow clone with depth 1. Set to 0 for a full clone with complete history.
|
|
91
|
-
write_back_mode: z.string().optional().describe("Controls whether the platform creates a branch and pull request from the agent's file changes.
|
|
90
|
+
depth: z.number().optional().describe("Number of commits to include in the clone history. When not set, defaults to a shallow clone with depth 1. Set to 0 for a full clone with complete history."),
|
|
91
|
+
write_back_mode: z.string().optional().describe("Controls whether the platform creates a branch and pull request from the agent's file changes. Allowed values: GIT_WRITE_BACK_BRANCH_AND_PR."),
|
|
92
92
|
});
|
|
93
93
|
type GitRepoSourceInput = z.infer<typeof GitRepoSourceInputSchema>;
|
|
94
94
|
|
|
@@ -116,19 +116,19 @@ const EnvironmentRefInputSchema = z.object({
|
|
|
116
116
|
type EnvironmentRefInput = z.infer<typeof EnvironmentRefInputSchema>;
|
|
117
117
|
|
|
118
118
|
const AgentCallTaskConfigInputSchema = z.object({
|
|
119
|
-
agent: z.string().describe("Agent reference in 'org/slug' or 'slug' format. - 'slug' only: uses the workflow's organization - 'org/slug': explicit organization reference Examples: 'code-reviewer', 'stigmer/code-reviewer', 'acme/data-analyst' Required field.
|
|
119
|
+
agent: z.string().describe("Agent reference in 'org/slug' or 'slug' format. - 'slug' only: uses the workflow's organization - 'org/slug': explicit organization reference Examples: 'code-reviewer', 'stigmer/code-reviewer', 'acme/data-analyst' Required field."),
|
|
120
120
|
message: z.string().describe("Instructions/prompt to send to the agent. Supports interpolation of workflow variables using JQ expressions. Example: 'Analyze this code: ${ $context.fetchCode.body }' Required field."),
|
|
121
121
|
env: z.record(z.string()).optional().describe("Runtime environment variables to pass to the agent. Values can be literal strings or JQ expressions that reference workflow context or secrets. Example: {'GITHUB_TOKEN': '${ .secrets.GH_TOKEN }'} Optional."),
|
|
122
|
-
run_config: z.lazy(() => RunConfigInputSchema).optional().describe("Per-call model choice and run bounds. Unset fields inherit the platform defaults.
|
|
122
|
+
run_config: z.lazy(() => RunConfigInputSchema).optional().describe("Per-call model choice and run bounds. Unset fields inherit the platform defaults."),
|
|
123
123
|
output: z.lazy(() => AgentCallOutputContractInputSchema).optional().describe("Structured output contract for this agent call. When set, the workflow runner extracts structured JSON from the agent's final response and validates it against the declared schema. The validated JSON is placed in the task output under the 'structured' key, enabling reliable downstream routing via switch_case expressions. When not set, the task output contains the agent's raw text response. @since T02 (Structured Agent Output Model)"),
|
|
124
124
|
harness: z.string().optional().describe("Execution harness for the agent invocation. Determines which execution engine processes the agent call: - HARNESS_UNSPECIFIED / HARNESS_NATIVE: Stigmer native engine (Python/LangGraph) - HARNESS_CURSOR: Cursor SDK engine (TypeScript/Cursor) The workflow-runner creates a Session with this harness before creating the AgentExecution. The harness is a session-level concern — it determines tool availability, state management, model access, and billing tier. When unspecified, defaults to HARNESS_NATIVE (the workflow surface's platform default). YAML Example: - code_review: call: agent with: agent: 'code-reviewer' harness: cursor message: 'Review this PR' Allowed values: HARNESS_NATIVE, HARNESS_CURSOR."),
|
|
125
|
-
workspace_entries: z.array(z.lazy(() => WorkspaceEntryInputSchema)).optional().describe("Workspace the child run's session operates on. Empty means no workspace.
|
|
126
|
-
environment_refs: z.array(z.lazy(() => EnvironmentRefInputSchema)).optional().describe("References to Environment resources whose values are provided to the child runs this task creates. This is how a tool-using agent becomes runnable from a workflow: bind an org-shared environment holding the needed credentials, and the child runs receive its values at runtime. The agent and its default instance stay untouched.
|
|
125
|
+
workspace_entries: z.array(z.lazy(() => WorkspaceEntryInputSchema)).optional().describe("Workspace the child run's session operates on. Empty means no workspace."),
|
|
126
|
+
environment_refs: z.array(z.lazy(() => EnvironmentRefInputSchema)).optional().describe("References to Environment resources whose values are provided to the child runs this task creates. This is how a tool-using agent becomes runnable from a workflow: bind an org-shared environment holding the needed credentials, and the child runs receive its values at runtime. The agent and its default instance stay untouched."),
|
|
127
127
|
});
|
|
128
128
|
type AgentCallTaskConfigInput = z.infer<typeof AgentCallTaskConfigInputSchema>;
|
|
129
129
|
|
|
130
130
|
const CallActivityTaskConfigInputSchema = z.object({
|
|
131
|
-
activity: z.string().describe("Activity name to execute.
|
|
131
|
+
activity: z.string().describe("Activity name to execute."),
|
|
132
132
|
input: z.record(z.unknown()).optional().describe("Activity input (optional). Can be any JSON structure. Supports expressions in string values."),
|
|
133
133
|
});
|
|
134
134
|
type CallActivityTaskConfigInput = z.infer<typeof CallActivityTaskConfigInputSchema>;
|
|
@@ -238,8 +238,8 @@ const HumanInputTaskConfigInputSchema = z.object({
|
|
|
238
238
|
timeout: z.number().optional().describe("Timeout in seconds before the on_timeout policy applies. Default: 0 (no timeout — the task waits indefinitely). Max: 2592000 (30 days). A timeout of 0 means the workflow will wait until a human responds. For production workflows, setting a timeout with an appropriate on_timeout policy is strongly recommended."),
|
|
239
239
|
on_timeout: z.string().optional().describe("Policy applied when the timeout expires without a response. Only meaningful when timeout > 0; ignored when timeout is 0. Default: HUMAN_INPUT_TIMEOUT_FAIL (task fails with timeout error). Allowed values: HUMAN_INPUT_TIMEOUT_FAIL, HUMAN_INPUT_TIMEOUT_APPROVE, HUMAN_INPUT_TIMEOUT_DENY, HUMAN_INPUT_TIMEOUT_ESCALATE."),
|
|
240
240
|
notification_channels: z.array(z.string()).optional().describe("Channel identifiers for sending approval request notifications. When the task starts, the runtime sends notifications through these channels to alert potential approvers. Format examples: - 'slack:#approvals' — Slack channel - 'email:ops@acme.com' — email address - 'teams:#incident-response' — Microsoft Teams channel The format and routing of notifications is a runtime concern (T13). The proto carries the identifiers; the runtime resolves them to actual notification providers configured in the workflow instance's environment."),
|
|
241
|
-
payload: z.unknown().optional().describe("Structured material for the reviewer to examine before deciding. Supports ${ } expression interpolation: the whole value can be a single expression string ('${ $context.draft_revision }') or an inline object/array whose nested strings carry embedded expressions. The runtime resolves expressions when the gate activates and attaches the resolved payload to the approval_requested event, so the approval record is permanently bound to exactly what the reviewer saw. Distinct from prompt (the instruction to the reviewer) and form_schema (the shape of the reviewer's response): payload is the thing under review — an article diff, a proposed record set, a generated plan.
|
|
242
|
-
ui_hint: z.string().optional().describe("Hint identifying which UI should present the payload. A plain discriminator string (e.g. 'article-diff', 'infra-proposal') that embedding applications match against their registered review renderers. When no renderer is registered for the hint — or the gate is viewed from a surface without custom renderers (CLI, plain console) — the payload is shown as structured data by the built-in approval card, so workflows stay portable across surfaces.
|
|
241
|
+
payload: z.unknown().optional().describe("Structured material for the reviewer to examine before deciding. Supports ${ } expression interpolation: the whole value can be a single expression string ('${ $context.draft_revision }') or an inline object/array whose nested strings carry embedded expressions. The runtime resolves expressions when the gate activates and attaches the resolved payload to the approval_requested event, so the approval record is permanently bound to exactly what the reviewer saw. Distinct from prompt (the instruction to the reviewer) and form_schema (the shape of the reviewer's response): payload is the thing under review — an article diff, a proposed record set, a generated plan."),
|
|
242
|
+
ui_hint: z.string().optional().describe("Hint identifying which UI should present the payload. A plain discriminator string (e.g. 'article-diff', 'infra-proposal') that embedding applications match against their registered review renderers. When no renderer is registered for the hint — or the gate is viewed from a surface without custom renderers (CLI, plain console) — the payload is shown as structured data by the built-in approval card, so workflows stay portable across surfaces."),
|
|
243
243
|
});
|
|
244
244
|
type HumanInputTaskConfigInput = z.infer<typeof HumanInputTaskConfigInputSchema>;
|
|
245
245
|
|
|
@@ -413,35 +413,35 @@ interface WorkflowTaskInput {
|
|
|
413
413
|
const WorkflowTaskInputSchema: z.ZodType<WorkflowTaskInput> = z.lazy(() => z.object({
|
|
414
414
|
name: z.string().optional().describe("Task name/identifier (must be unique within workflow). Must be a valid C-style identifier: starts with a letter or underscore, followed by letters, digits, or underscores."),
|
|
415
415
|
kind: z.string().describe("Task type. Set the matching config field (e.g. kind='http_call' -> populate http_call). Allowed values: set_vars, http_call, grpc_call, activity_call, switch_case, for_each, fork, try_catch, listen, wait, raise_error, run_workflow, agent_call, llm_call, transform, human_input, validate, emit_event, notification, eval."),
|
|
416
|
-
agent_call: z.lazy(() => AgentCallTaskConfigInputSchema).optional().describe("Required when kind='agent_call'. AgentCallTaskConfig defines the configuration for agent_call tasks that invoke AI agents.
|
|
417
|
-
activity_call: z.lazy(() => CallActivityTaskConfigInputSchema).optional().describe("Required when kind='activity_call'. CallActivityTaskConfig defines the configuration for activity_call tasks that execute activities.
|
|
418
|
-
emit_event: z.lazy(() => EmitEventTaskConfigInputSchema).optional().describe("Required when kind='emit_event'. EmitEventTaskConfig defines the configuration for emit_event tasks that publish CloudEvents to external consumers, other workflows, audit trails, and metrics systems.
|
|
419
|
-
eval: z.lazy(() => EvalTaskConfigInputSchema).optional().describe("Required when kind='eval'. EvalTaskConfig defines the configuration for eval tasks that use an LLM judge to assess the semantic quality of workflow data.
|
|
420
|
-
for_each: z.lazy(() => ForTaskConfigInputSchema).optional().describe("Required when kind='for_each'. ForTaskConfig defines the configuration for for_each tasks that iterate over collections.
|
|
421
|
-
fork: z.lazy(() => ForkTaskConfigInputSchema).optional().describe("Required when kind='fork'. ForkTaskConfig defines the configuration for fork tasks that execute branches in parallel.
|
|
422
|
-
grpc_call: z.lazy(() => GrpcCallTaskConfigInputSchema).optional().describe("Required when kind='grpc_call'. GrpcCallTaskConfig defines the configuration for grpc_call tasks that make gRPC requests.
|
|
423
|
-
http_call: z.lazy(() => HttpCallTaskConfigInputSchema).optional().describe("Required when kind='http_call'. HttpCallTaskConfig defines the configuration for http_call tasks that make HTTP requests.
|
|
424
|
-
human_input: z.lazy(() => HumanInputTaskConfigInputSchema).optional().describe("Required when kind='human_input'. HumanInputTaskConfig defines the configuration for human_input tasks that pause workflow execution to collect typed input or approval from a human reviewer, then resume based on the reviewer's response.
|
|
425
|
-
listen: z.lazy(() => ListenTaskConfigInputSchema).optional().describe("Required when kind='listen'. ListenTaskConfig defines the configuration for listen tasks that wait for external signals.
|
|
426
|
-
llm_call: z.lazy(() => LlmCallTaskConfigInputSchema).optional().describe("Required when kind='llm_call'. LlmCallTaskConfig defines the configuration for llm_call tasks that make direct LLM API calls without the overhead of a full agent invocation.
|
|
427
|
-
notification: z.lazy(() => NotificationTaskConfigInputSchema).optional().describe("Required when kind='notification'. NotificationTaskConfig defines the configuration for notification tasks that send messages to humans through channels like Slack, email, Discord, Microsoft Teams, or webhooks.
|
|
428
|
-
raise_error: z.lazy(() => RaiseTaskConfigInputSchema).optional().describe("Required when kind='raise_error'. RaiseTaskConfig defines the configuration for raise_error tasks that raise errors.
|
|
429
|
-
run_workflow: z.lazy(() => RunTaskConfigInputSchema).optional().describe("Required when kind='run_workflow'. RunTaskConfig defines the configuration for run_workflow tasks that execute sub-workflows.
|
|
430
|
-
set_vars: z.lazy(() => SetTaskConfigInputSchema).optional().describe("Required when kind='set_vars'. SetTaskConfig defines the configuration for set_vars tasks that assign variables in workflow state.
|
|
431
|
-
switch_case: z.lazy(() => SwitchTaskConfigInputSchema).optional().describe("Required when kind='switch_case'. SwitchTaskConfig defines the configuration for switch_case tasks that branch conditionally.
|
|
432
|
-
transform: z.lazy(() => TransformTaskConfigInputSchema).optional().describe("Required when kind='transform'. TransformTaskConfig defines the configuration for transform tasks that perform deterministic data transformation without LLM calls.
|
|
433
|
-
try_catch: z.lazy(() => TryTaskConfigInputSchema).optional().describe("Required when kind='try_catch'. TryTaskConfig defines the configuration for try_catch tasks that handle errors.
|
|
434
|
-
validate: z.lazy(() => ValidateTaskConfigInputSchema).optional().describe("Required when kind='validate'. ValidateTaskConfig defines the configuration for validate tasks that perform explicit schema and business-rule validation on workflow data.
|
|
435
|
-
wait: z.lazy(() => WaitTaskConfigInputSchema).optional().describe("Required when kind='wait'. WaitTaskConfig defines the configuration for wait tasks that pause workflow execution. Supports both relative durations and absolute timestamps.
|
|
416
|
+
agent_call: z.lazy(() => AgentCallTaskConfigInputSchema).optional().describe("Required when kind='agent_call'. AgentCallTaskConfig defines the configuration for agent_call tasks that invoke AI agents."),
|
|
417
|
+
activity_call: z.lazy(() => CallActivityTaskConfigInputSchema).optional().describe("Required when kind='activity_call'. CallActivityTaskConfig defines the configuration for activity_call tasks that execute activities."),
|
|
418
|
+
emit_event: z.lazy(() => EmitEventTaskConfigInputSchema).optional().describe("Required when kind='emit_event'. EmitEventTaskConfig defines the configuration for emit_event tasks that publish CloudEvents to external consumers, other workflows, audit trails, and metrics systems."),
|
|
419
|
+
eval: z.lazy(() => EvalTaskConfigInputSchema).optional().describe("Required when kind='eval'. EvalTaskConfig defines the configuration for eval tasks that use an LLM judge to assess the semantic quality of workflow data."),
|
|
420
|
+
for_each: z.lazy(() => ForTaskConfigInputSchema).optional().describe("Required when kind='for_each'. ForTaskConfig defines the configuration for for_each tasks that iterate over collections."),
|
|
421
|
+
fork: z.lazy(() => ForkTaskConfigInputSchema).optional().describe("Required when kind='fork'. ForkTaskConfig defines the configuration for fork tasks that execute branches in parallel."),
|
|
422
|
+
grpc_call: z.lazy(() => GrpcCallTaskConfigInputSchema).optional().describe("Required when kind='grpc_call'. GrpcCallTaskConfig defines the configuration for grpc_call tasks that make gRPC requests."),
|
|
423
|
+
http_call: z.lazy(() => HttpCallTaskConfigInputSchema).optional().describe("Required when kind='http_call'. HttpCallTaskConfig defines the configuration for http_call tasks that make HTTP requests."),
|
|
424
|
+
human_input: z.lazy(() => HumanInputTaskConfigInputSchema).optional().describe("Required when kind='human_input'. HumanInputTaskConfig defines the configuration for human_input tasks that pause workflow execution to collect typed input or approval from a human reviewer, then resume based on the reviewer's response."),
|
|
425
|
+
listen: z.lazy(() => ListenTaskConfigInputSchema).optional().describe("Required when kind='listen'. ListenTaskConfig defines the configuration for listen tasks that wait for external signals."),
|
|
426
|
+
llm_call: z.lazy(() => LlmCallTaskConfigInputSchema).optional().describe("Required when kind='llm_call'. LlmCallTaskConfig defines the configuration for llm_call tasks that make direct LLM API calls without the overhead of a full agent invocation."),
|
|
427
|
+
notification: z.lazy(() => NotificationTaskConfigInputSchema).optional().describe("Required when kind='notification'. NotificationTaskConfig defines the configuration for notification tasks that send messages to humans through channels like Slack, email, Discord, Microsoft Teams, or webhooks."),
|
|
428
|
+
raise_error: z.lazy(() => RaiseTaskConfigInputSchema).optional().describe("Required when kind='raise_error'. RaiseTaskConfig defines the configuration for raise_error tasks that raise errors."),
|
|
429
|
+
run_workflow: z.lazy(() => RunTaskConfigInputSchema).optional().describe("Required when kind='run_workflow'. RunTaskConfig defines the configuration for run_workflow tasks that execute sub-workflows."),
|
|
430
|
+
set_vars: z.lazy(() => SetTaskConfigInputSchema).optional().describe("Required when kind='set_vars'. SetTaskConfig defines the configuration for set_vars tasks that assign variables in workflow state."),
|
|
431
|
+
switch_case: z.lazy(() => SwitchTaskConfigInputSchema).optional().describe("Required when kind='switch_case'. SwitchTaskConfig defines the configuration for switch_case tasks that branch conditionally."),
|
|
432
|
+
transform: z.lazy(() => TransformTaskConfigInputSchema).optional().describe("Required when kind='transform'. TransformTaskConfig defines the configuration for transform tasks that perform deterministic data transformation without LLM calls."),
|
|
433
|
+
try_catch: z.lazy(() => TryTaskConfigInputSchema).optional().describe("Required when kind='try_catch'. TryTaskConfig defines the configuration for try_catch tasks that handle errors."),
|
|
434
|
+
validate: z.lazy(() => ValidateTaskConfigInputSchema).optional().describe("Required when kind='validate'. ValidateTaskConfig defines the configuration for validate tasks that perform explicit schema and business-rule validation on workflow data."),
|
|
435
|
+
wait: z.lazy(() => WaitTaskConfigInputSchema).optional().describe("Required when kind='wait'. WaitTaskConfig defines the configuration for wait tasks that pause workflow execution. Supports both relative durations and absolute timestamps."),
|
|
436
436
|
export: z.lazy(() => ExportInputSchema).optional().describe("Export configuration (how to save task output to context). Optional - if not set, output is not saved."),
|
|
437
437
|
flow: z.lazy(() => FlowControlInputSchema).optional().describe("Flow control (which task executes next). Optional - if not set, continues to next task in sequence."),
|
|
438
|
-
compensate: z.array(z.lazy(() => WorkflowTaskInputSchema)).optional().describe("Compensation tasks to execute if this task needs to be 'undone.'
|
|
438
|
+
compensate: z.array(z.lazy(() => WorkflowTaskInputSchema)).optional().describe("Compensation tasks to execute if this task needs to be 'undone.'"),
|
|
439
439
|
}));
|
|
440
440
|
|
|
441
441
|
const EnvVarDeclarationInputSchema = z.object({
|
|
442
|
-
is_secret: z.boolean().optional().describe("Whether the resolved value should be treated as a secret.
|
|
442
|
+
is_secret: z.boolean().optional().describe("Whether the resolved value should be treated as a secret."),
|
|
443
443
|
description: z.string().optional().describe("Human-readable description shown in the UI credential form. Should explain what the variable is used for and where to obtain it."),
|
|
444
|
-
optional: z.boolean().optional().describe("Whether this variable is optional.
|
|
444
|
+
optional: z.boolean().optional().describe("Whether this variable is optional."),
|
|
445
445
|
});
|
|
446
446
|
type EnvVarDeclarationInput = z.infer<typeof EnvVarDeclarationInputSchema>;
|
|
447
447
|
|
|
@@ -50,8 +50,8 @@ beforeAll(async () => {
|
|
|
50
50
|
};
|
|
51
51
|
controller = new AbortController();
|
|
52
52
|
// The REAL route dispatch, so these tests hold the production route
|
|
53
|
-
// table: full roster on "/",
|
|
54
|
-
// "/
|
|
53
|
+
// table: full roster on "/", channels on "/channels", conversation on
|
|
54
|
+
// "/conversation", 404 anywhere else.
|
|
55
55
|
serving = serveHttp(
|
|
56
56
|
routedServerFactory({ serverAddress: cfg.stigmerServerAddress, apiKey: "" }),
|
|
57
57
|
cfg,
|
|
@@ -172,7 +172,6 @@ function initialize(path: string): Promise<Response> {
|
|
|
172
172
|
describe("HTTP route dispatch (the closed route table)", () => {
|
|
173
173
|
it.each([
|
|
174
174
|
["/", "mcp-server-stigmer"],
|
|
175
|
-
["/records", "mcp-server-stigmer-records"],
|
|
176
175
|
["/channels", "mcp-server-stigmer-channels"],
|
|
177
176
|
["/conversation", "mcp-server-stigmer-conversation"],
|
|
178
177
|
])("serves the %s roster as %s", async (path, serverName) => {
|
package/src/index.ts
CHANGED
package/src/server.ts
CHANGED
|
@@ -25,14 +25,11 @@ import { registerAgentTools } from "./domains/agents/tools.js";
|
|
|
25
25
|
import { registerChannelTools } from "./domains/channels/tools.js";
|
|
26
26
|
import type { BackendTarget } from "./domains/client.js";
|
|
27
27
|
import { registerConversationTools } from "./domains/conversation/tools.js";
|
|
28
|
-
import { registerDatastoreResources } from "./domains/datastores/resources.js";
|
|
29
|
-
import { registerDatastoreTools } from "./domains/datastores/tools.js";
|
|
30
28
|
import { registerEnvironmentResources } from "./domains/environments/resources.js";
|
|
31
29
|
import { registerEnvironmentTools } from "./domains/environments/tools.js";
|
|
32
30
|
import { registerExecutionControlTools } from "./domains/executions/tools.js";
|
|
33
31
|
import { registerMcpServerResources } from "./domains/mcpservers/resources.js";
|
|
34
32
|
import { registerMcpServerTools } from "./domains/mcpservers/tools.js";
|
|
35
|
-
import { registerRecordTools } from "./domains/records/tools.js";
|
|
36
33
|
import { registerSearchTools } from "./domains/search/tools.js";
|
|
37
34
|
import { registerSkillResources } from "./domains/skills/resources.js";
|
|
38
35
|
import { registerSkillTools } from "./domains/skills/tools.js";
|
|
@@ -69,22 +66,6 @@ export function createServer(target: BackendTarget): McpServer {
|
|
|
69
66
|
return server;
|
|
70
67
|
}
|
|
71
68
|
|
|
72
|
-
/**
|
|
73
|
-
* Build a records-only MCP server: the five record tools with the
|
|
74
|
-
* agent-facing argument surface, and nothing else (T05 R1). This is
|
|
75
|
-
* the roster the runner-synthesized datastore attachment connects to —
|
|
76
|
-
* a structural guarantee that an agent session never sees the
|
|
77
|
-
* management tools (apply/delete/…) its empty approval maps would make
|
|
78
|
-
* approval-free. Served on the /records HTTP route and as the stdio
|
|
79
|
-
* roster when STIGMER_MCP_ROSTER=records.
|
|
80
|
-
*/
|
|
81
|
-
export function createRecordsServer(target: BackendTarget): McpServer {
|
|
82
|
-
const server = new McpServer({ name: "mcp-server-stigmer-records", version: SERVER_VERSION });
|
|
83
|
-
const tools = registerRecordTools(server, target, "agent");
|
|
84
|
-
log.info("tools registered (records roster)", { count: tools.length, tools });
|
|
85
|
-
return server;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
69
|
/**
|
|
89
70
|
* Build a channels-only MCP server: send_channel_message with the
|
|
90
71
|
* agent-facing argument surface, and nothing else (proactive-messaging
|
|
@@ -143,11 +124,6 @@ function registerTools(server: McpServer, target: BackendTarget): void {
|
|
|
143
124
|
...registerWorkflowExecutionTools(server, target),
|
|
144
125
|
...registerExecutionControlTools(server, target),
|
|
145
126
|
...registerEnvironmentTools(server, target),
|
|
146
|
-
...registerDatastoreTools(server, target),
|
|
147
|
-
// The record tools also serve external MCP clients — as direct
|
|
148
|
-
// principals with the org argument and honest annotations (the
|
|
149
|
-
// agent-facing variant lives on the records-only roster).
|
|
150
|
-
...registerRecordTools(server, target, "direct"),
|
|
151
127
|
];
|
|
152
128
|
log.info("tools registered", { count: tools.length, tools });
|
|
153
129
|
}
|
|
@@ -164,7 +140,6 @@ function registerResources(server: McpServer, target: BackendTarget): void {
|
|
|
164
140
|
...registerSkillResources(server, target),
|
|
165
141
|
...registerWorkflowResources(server, target),
|
|
166
142
|
...registerEnvironmentResources(server, target),
|
|
167
|
-
...registerDatastoreResources(server, target),
|
|
168
143
|
];
|
|
169
144
|
log.info("resources registered", { count: resources.length, resources });
|
|
170
145
|
}
|
|
@@ -211,9 +186,6 @@ export type RouteServerFactory = (path: string) => McpServer | undefined;
|
|
|
211
186
|
/** HTTP route serving the full roster: the bare origin every published config uses. */
|
|
212
187
|
export const FULL_ROUTE = "/";
|
|
213
188
|
|
|
214
|
-
/** HTTP route serving the records-only roster (T05 R1). */
|
|
215
|
-
export const RECORDS_ROUTE = "/records";
|
|
216
|
-
|
|
217
189
|
/** HTTP route serving the channels-only roster (DD-006 D8). */
|
|
218
190
|
export const CHANNELS_ROUTE = "/channels";
|
|
219
191
|
|
|
@@ -222,9 +194,9 @@ export const CONVERSATION_ROUTE = "/conversation";
|
|
|
222
194
|
|
|
223
195
|
/**
|
|
224
196
|
* The standard HTTP route dispatch: the full roster on {@link FULL_ROUTE},
|
|
225
|
-
* the
|
|
226
|
-
* roster on {@link
|
|
227
|
-
*
|
|
197
|
+
* the channels-only roster on {@link CHANNELS_ROUTE}, the
|
|
198
|
+
* conversation-only roster on {@link CONVERSATION_ROUTE} — and NOTHING
|
|
199
|
+
* anywhere else.
|
|
228
200
|
*
|
|
229
201
|
* The closed route table is load-bearing, not tidiness. This dispatch
|
|
230
202
|
* once fell through to the full roster for any unrecognized path, and a
|
|
@@ -239,7 +211,6 @@ export const CONVERSATION_ROUTE = "/conversation";
|
|
|
239
211
|
export function routedServerFactory(target: BackendTarget): RouteServerFactory {
|
|
240
212
|
return (path) => {
|
|
241
213
|
if (path === FULL_ROUTE) return createServer(target);
|
|
242
|
-
if (path === RECORDS_ROUTE) return createRecordsServer(target);
|
|
243
214
|
if (path === CHANNELS_ROUTE) return createChannelsServer(target);
|
|
244
215
|
if (path === CONVERSATION_ROUTE) return createConversationServer(target);
|
|
245
216
|
return undefined;
|
|
@@ -431,12 +402,11 @@ async function routeRequest(
|
|
|
431
402
|
}
|
|
432
403
|
|
|
433
404
|
/**
|
|
434
|
-
* The stdio server for the configured roster: the
|
|
435
|
-
*
|
|
436
|
-
*
|
|
405
|
+
* The stdio server for the configured roster: the channels-only roster
|
|
406
|
+
* when STIGMER_MCP_ROSTER names it (what the OSS runner-synthesized
|
|
407
|
+
* attachment spawns), the full roster otherwise.
|
|
437
408
|
*/
|
|
438
409
|
export function stdioServer(target: BackendTarget, cfg: Config): McpServer {
|
|
439
|
-
if (cfg.roster === "records") return createRecordsServer(target);
|
|
440
410
|
if (cfg.roster === "channels") return createChannelsServer(target);
|
|
441
411
|
return createServer(target);
|
|
442
412
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type DatastoreInput } from "../../gen/datastore.js";
|
|
2
|
-
/** Create or update a datastore, returning the persisted resource as protojson. */
|
|
3
|
-
export declare function applyDatastore(serverAddress: string, token: string, input: DatastoreInput): Promise<string>;
|
|
4
|
-
//# sourceMappingURL=apply.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/domains/datastores/apply.ts"],"names":[],"mappings":"AAWA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAKpF,mFAAmF;AACnF,wBAAsB,cAAc,CAClC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,MAAM,CAAC,CAWjB"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Datastore apply path: create-or-update via DatastoreCommandController.apply.
|
|
2
|
-
// The flat MCP input is projected into a fully-formed Datastore proto by the
|
|
3
|
-
// generated datastoreInputToProto bridge (codegen, src/gen/datastore.ts).
|
|
4
|
-
//
|
|
5
|
-
// The manifest is authoritative for structure, never for data: schema changes
|
|
6
|
-
// sync on apply (the server enforces its additive-plus change matrix), and
|
|
7
|
-
// records enter exclusively through the record tools.
|
|
8
|
-
import { DatastoreSchema } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/api_pb";
|
|
9
|
-
import { DatastoreCommandController } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/command_pb";
|
|
10
|
-
import { datastoreInputToProto } from "../../gen/datastore.js";
|
|
11
|
-
import { withClient } from "../client.js";
|
|
12
|
-
import { toProtoJson } from "../marshal.js";
|
|
13
|
-
import { rpcError } from "../rpcerr.js";
|
|
14
|
-
/** Create or update a datastore, returning the persisted resource as protojson. */
|
|
15
|
-
export async function applyDatastore(serverAddress, token, input) {
|
|
16
|
-
const datastore = datastoreInputToProto(input);
|
|
17
|
-
const desc = `datastore "${datastore.metadata?.slug ?? ""}" in org "${datastore.metadata?.org ?? ""}"`;
|
|
18
|
-
return withClient(DatastoreCommandController, serverAddress, token, async (client, callOptions) => {
|
|
19
|
-
try {
|
|
20
|
-
const result = await client.apply(datastore, callOptions);
|
|
21
|
-
return toProtoJson(DatastoreSchema, result);
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
throw rpcError(err, desc);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=apply.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../src/domains/datastores/apply.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,6EAA6E;AAC7E,0EAA0E;AAC1E,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,sDAAsD;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4DAA4D,CAAC;AAExG,OAAO,EAAE,qBAAqB,EAAuB,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,aAAqB,EACrB,KAAa,EACb,KAAqB;IAErB,MAAM,SAAS,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,cAAc,SAAS,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,aAAa,SAAS,CAAC,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC;IACvG,OAAO,UAAU,CAAC,0BAA0B,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE;QAChG,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;YAC1D,OAAO,WAAW,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/domains/datastores/delete.ts"],"names":[],"mappings":"AAiBA,uFAAuF;AACvF,wBAAsB,eAAe,CACnC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAuBjB"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Datastore delete path: resolve org/slug → id via the Query controller, then
|
|
2
|
-
// delete via the Command controller, both over a single shared transport. Like
|
|
3
|
-
// McpServer, the command controller takes ApiResourceDeleteInput{resource_id}.
|
|
4
|
-
//
|
|
5
|
-
// This is the only path that destroys collections — record tools can delete
|
|
6
|
-
// individual records but never structure.
|
|
7
|
-
import { createClient } from "@connectrpc/connect";
|
|
8
|
-
import { DatastoreSchema } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/api_pb";
|
|
9
|
-
import { DatastoreCommandController } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/command_pb";
|
|
10
|
-
import { DatastoreQueryController } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/query_pb";
|
|
11
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
12
|
-
import { withTransport } from "../client.js";
|
|
13
|
-
import { toProtoJson } from "../marshal.js";
|
|
14
|
-
import { rpcError } from "../rpcerr.js";
|
|
15
|
-
/** Delete a datastore by org and slug, returning the deleted resource as protojson. */
|
|
16
|
-
export async function deleteDatastore(serverAddress, token, org, slug) {
|
|
17
|
-
const desc = `datastore "${slug}" in org "${org}"`;
|
|
18
|
-
return withTransport(serverAddress, token, async (transport, callOptions) => {
|
|
19
|
-
const query = createClient(DatastoreQueryController, transport);
|
|
20
|
-
let id;
|
|
21
|
-
try {
|
|
22
|
-
const datastore = await query.getByReference({ org, kind: ApiResourceKind.datastore, slug }, callOptions);
|
|
23
|
-
id = datastore.metadata?.id ?? "";
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
throw rpcError(err, desc);
|
|
27
|
-
}
|
|
28
|
-
const command = createClient(DatastoreCommandController, transport);
|
|
29
|
-
try {
|
|
30
|
-
const deleted = await command.delete({ resourceId: id }, callOptions);
|
|
31
|
-
return toProtoJson(DatastoreSchema, deleted);
|
|
32
|
-
}
|
|
33
|
-
catch (err) {
|
|
34
|
-
throw rpcError(err, desc);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=delete.js.map
|