@stigmer/sdk 3.35.0 → 3.36.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/activity.d.ts.map +1 -1
- package/activity.js.map +1 -1
- package/artifact-routing.d.ts.map +1 -1
- package/artifact-routing.js.map +1 -1
- package/authorization-config.d.ts.map +1 -1
- package/authorization-config.js.map +1 -1
- package/billing.d.ts.map +1 -1
- package/billing.js.map +1 -1
- package/config.d.ts.map +1 -1
- package/config.js.map +1 -1
- package/cursor-accounts.d.ts.map +1 -1
- package/cursor-accounts.js.map +1 -1
- package/ensure-identity-account.d.ts.map +1 -1
- package/ensure-identity-account.js.map +1 -1
- package/errors.d.ts.map +1 -1
- package/errors.js.map +1 -1
- package/execution/approval-provenance.d.ts.map +1 -1
- package/execution/approval-provenance.js.map +1 -1
- package/execution/conversation-rules.d.ts.map +1 -1
- package/execution/conversation-rules.js.map +1 -1
- package/execution/execution-phases.d.ts.map +1 -1
- package/execution/execution-phases.js.map +1 -1
- package/execution/file-review-fold.d.ts.map +1 -1
- package/execution/file-review-fold.js.map +1 -1
- package/execution/to-display-file-change.d.ts.map +1 -1
- package/execution/to-display-file-change.js.map +1 -1
- package/execution/tool-view.d.ts.map +1 -1
- package/execution/tool-view.js.map +1 -1
- package/execution/transcript.d.ts.map +1 -1
- package/execution/transcript.js.map +1 -1
- package/gen/agent.d.ts.map +1 -1
- package/gen/agent.js.map +1 -1
- package/gen/agentchannel.d.ts.map +1 -1
- package/gen/agentchannel.js.map +1 -1
- package/gen/agentexecution.d.ts.map +1 -1
- package/gen/agentexecution.js.map +1 -1
- package/gen/agentinstance.d.ts.map +1 -1
- package/gen/agentinstance.js.map +1 -1
- package/gen/agentshare.d.ts.map +1 -1
- package/gen/agentshare.js.map +1 -1
- package/gen/apikey.d.ts.map +1 -1
- package/gen/apikey.js.map +1 -1
- package/gen/artifact.d.ts.map +1 -1
- package/gen/artifact.js.map +1 -1
- package/gen/authorization-config.d.ts.map +1 -1
- package/gen/authorization-config.js +2 -2
- package/gen/authorization-config.js.map +1 -1
- package/gen/bidi-stream.d.ts.map +1 -1
- package/gen/bidi-stream.js.map +1 -1
- package/gen/channelapp.d.ts.map +1 -1
- package/gen/channelapp.js.map +1 -1
- package/gen/client.d.ts.map +1 -1
- package/gen/client.js.map +1 -1
- package/gen/environment.d.ts.map +1 -1
- package/gen/environment.js.map +1 -1
- package/gen/errors.d.ts.map +1 -1
- package/gen/errors.js.map +1 -1
- package/gen/executioncontext.d.ts.map +1 -1
- package/gen/executioncontext.js.map +1 -1
- package/gen/iampolicy.d.ts.map +1 -1
- package/gen/iampolicy.js.map +1 -1
- package/gen/identityaccount.d.ts.map +1 -1
- package/gen/identityaccount.js.map +1 -1
- package/gen/identityprovider.d.ts.map +1 -1
- package/gen/identityprovider.js.map +1 -1
- package/gen/invitation.d.ts.map +1 -1
- package/gen/invitation.js.map +1 -1
- package/gen/license.d.ts.map +1 -1
- package/gen/license.js.map +1 -1
- package/gen/mcpserver.d.ts.map +1 -1
- package/gen/mcpserver.js.map +1 -1
- package/gen/memory.d.ts.map +1 -1
- package/gen/memory.js.map +1 -1
- package/gen/oauthapp.d.ts.map +1 -1
- package/gen/oauthapp.js.map +1 -1
- package/gen/organization.d.ts.map +1 -1
- package/gen/organization.js.map +1 -1
- package/gen/plan.d.ts.map +1 -1
- package/gen/plan.js.map +1 -1
- package/gen/platformclient.d.ts.map +1 -1
- package/gen/platformclient.js.map +1 -1
- package/gen/plugin.d.ts.map +1 -1
- package/gen/plugin.js.map +1 -1
- package/gen/proto-utils.d.ts.map +1 -1
- package/gen/proto-utils.js.map +1 -1
- package/gen/resource-availability.d.ts.map +1 -1
- package/gen/resource-availability.js.map +1 -1
- package/gen/schedule.d.ts.map +1 -1
- package/gen/schedule.js.map +1 -1
- package/gen/session.d.ts.map +1 -1
- package/gen/session.js.map +1 -1
- package/gen/skill.d.ts.map +1 -1
- package/gen/skill.js.map +1 -1
- package/gen/subscription.d.ts.map +1 -1
- package/gen/subscription.js.map +1 -1
- package/gen/team.d.ts.map +1 -1
- package/gen/team.js.map +1 -1
- package/gen/types.d.ts.map +1 -1
- package/gen/types.js.map +1 -1
- package/gen/workflow.d.ts.map +1 -1
- package/gen/workflow.js.map +1 -1
- package/gen/workflowexecution.d.ts.map +1 -1
- package/gen/workflowexecution.js.map +1 -1
- package/gen/workflowinstance.d.ts.map +1 -1
- package/gen/workflowinstance.js.map +1 -1
- package/github.d.ts.map +1 -1
- package/github.js.map +1 -1
- package/guest-auth.d.ts.map +1 -1
- package/guest-auth.js.map +1 -1
- package/iam-principal.d.ts.map +1 -1
- package/iam-principal.js.map +1 -1
- package/iam-role.d.ts.map +1 -1
- package/iam-role.js.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/internal/interceptors.d.ts.map +1 -1
- package/internal/interceptors.js.map +1 -1
- package/manifest/client.d.ts.map +1 -1
- package/manifest/client.js.map +1 -1
- package/manifest/document.d.ts.map +1 -1
- package/manifest/document.js.map +1 -1
- package/manifest/index.d.ts.map +1 -1
- package/manifest/index.js.map +1 -1
- package/manifest/parse.d.ts.map +1 -1
- package/manifest/parse.js.map +1 -1
- package/manifest/redaction.d.ts.map +1 -1
- package/manifest/redaction.js.map +1 -1
- package/manifest/registry.d.ts.map +1 -1
- package/manifest/registry.js.map +1 -1
- package/manifest/serialize.d.ts.map +1 -1
- package/manifest/serialize.js.map +1 -1
- package/mcpserver-connect.d.ts.map +1 -1
- package/mcpserver-connect.js.map +1 -1
- package/node.d.ts.map +1 -1
- package/node.js.map +1 -1
- package/package.json +2 -2
- package/platform-client-auth.d.ts.map +1 -1
- package/platform-client-auth.js.map +1 -1
- package/platform.d.ts.map +1 -1
- package/platform.js.map +1 -1
- package/plugin.d.ts.map +1 -1
- package/plugin.js.map +1 -1
- package/provider-standing.d.ts.map +1 -1
- package/provider-standing.js.map +1 -1
- package/resource-availability.d.ts.map +1 -1
- package/resource-availability.js.map +1 -1
- package/runner-adapter.d.ts.map +1 -1
- package/runner-adapter.js.map +1 -1
- package/search.d.ts.map +1 -1
- package/search.js.map +1 -1
- package/session.d.ts.map +1 -1
- package/session.js.map +1 -1
- package/sharing.d.ts.map +1 -1
- package/sharing.js.map +1 -1
- package/skill.d.ts.map +1 -1
- package/skill.js.map +1 -1
- package/src/gen/authorization-config.ts +2 -2
- package/stigmer.d.ts.map +1 -1
- package/stigmer.js.map +1 -1
- package/transport.d.ts.map +1 -1
- package/transport.js.map +1 -1
- package/__tests__/billing.test.d.ts +0 -2
- package/__tests__/billing.test.d.ts.map +0 -1
- package/__tests__/billing.test.js +0 -120
- package/__tests__/billing.test.js.map +0 -1
- package/__tests__/config.test.d.ts +0 -2
- package/__tests__/config.test.d.ts.map +0 -1
- package/__tests__/config.test.js +0 -35
- package/__tests__/config.test.js.map +0 -1
- package/__tests__/ensure-identity-account.test.d.ts +0 -2
- package/__tests__/ensure-identity-account.test.d.ts.map +0 -1
- package/__tests__/ensure-identity-account.test.js +0 -108
- package/__tests__/ensure-identity-account.test.js.map +0 -1
- package/__tests__/errors.test.d.ts +0 -2
- package/__tests__/errors.test.d.ts.map +0 -1
- package/__tests__/errors.test.js +0 -228
- package/__tests__/errors.test.js.map +0 -1
- package/__tests__/gen/errors.test.d.ts +0 -2
- package/__tests__/gen/errors.test.d.ts.map +0 -1
- package/__tests__/gen/errors.test.js +0 -97
- package/__tests__/gen/errors.test.js.map +0 -1
- package/__tests__/gen/invitation-client.test.d.ts +0 -2
- package/__tests__/gen/invitation-client.test.d.ts.map +0 -1
- package/__tests__/gen/invitation-client.test.js +0 -106
- package/__tests__/gen/invitation-client.test.js.map +0 -1
- package/__tests__/gen/proto-utils.test.d.ts +0 -2
- package/__tests__/gen/proto-utils.test.d.ts.map +0 -1
- package/__tests__/gen/proto-utils.test.js +0 -85
- package/__tests__/gen/proto-utils.test.js.map +0 -1
- package/__tests__/gen/session-client.test.d.ts +0 -2
- package/__tests__/gen/session-client.test.d.ts.map +0 -1
- package/__tests__/gen/session-client.test.js +0 -152
- package/__tests__/gen/session-client.test.js.map +0 -1
- package/__tests__/guest-auth.test.d.ts +0 -2
- package/__tests__/guest-auth.test.d.ts.map +0 -1
- package/__tests__/guest-auth.test.js +0 -223
- package/__tests__/guest-auth.test.js.map +0 -1
- package/__tests__/iam-principal.test.d.ts +0 -2
- package/__tests__/iam-principal.test.d.ts.map +0 -1
- package/__tests__/iam-principal.test.js +0 -65
- package/__tests__/iam-principal.test.js.map +0 -1
- package/__tests__/manifest.test.d.ts +0 -2
- package/__tests__/manifest.test.d.ts.map +0 -1
- package/__tests__/manifest.test.js +0 -306
- package/__tests__/manifest.test.js.map +0 -1
- package/__tests__/mcpserver-connect.test.d.ts +0 -2
- package/__tests__/mcpserver-connect.test.d.ts.map +0 -1
- package/__tests__/mcpserver-connect.test.js +0 -146
- package/__tests__/mcpserver-connect.test.js.map +0 -1
- package/__tests__/node.test.d.ts +0 -2
- package/__tests__/node.test.d.ts.map +0 -1
- package/__tests__/node.test.js +0 -67
- package/__tests__/node.test.js.map +0 -1
- package/__tests__/platform-client-auth.test.d.ts +0 -2
- package/__tests__/platform-client-auth.test.d.ts.map +0 -1
- package/__tests__/platform-client-auth.test.js +0 -59
- package/__tests__/platform-client-auth.test.js.map +0 -1
- package/__tests__/platform.test.d.ts +0 -2
- package/__tests__/platform.test.d.ts.map +0 -1
- package/__tests__/platform.test.js +0 -52
- package/__tests__/platform.test.js.map +0 -1
- package/__tests__/plugin.test.d.ts +0 -2
- package/__tests__/plugin.test.d.ts.map +0 -1
- package/__tests__/plugin.test.js +0 -74
- package/__tests__/plugin.test.js.map +0 -1
- package/__tests__/resource-availability.test.d.ts +0 -2
- package/__tests__/resource-availability.test.d.ts.map +0 -1
- package/__tests__/resource-availability.test.js +0 -80
- package/__tests__/resource-availability.test.js.map +0 -1
- package/__tests__/runner-adapter.test.d.ts +0 -2
- package/__tests__/runner-adapter.test.d.ts.map +0 -1
- package/__tests__/runner-adapter.test.js +0 -88
- package/__tests__/runner-adapter.test.js.map +0 -1
- package/__tests__/session.test.d.ts +0 -6
- package/__tests__/session.test.d.ts.map +0 -1
- package/__tests__/session.test.js +0 -50
- package/__tests__/session.test.js.map +0 -1
- package/__tests__/sharing.test.d.ts +0 -2
- package/__tests__/sharing.test.d.ts.map +0 -1
- package/__tests__/sharing.test.js +0 -106
- package/__tests__/sharing.test.js.map +0 -1
- package/__tests__/skill.test.d.ts +0 -2
- package/__tests__/skill.test.d.ts.map +0 -1
- package/__tests__/skill.test.js +0 -117
- package/__tests__/skill.test.js.map +0 -1
- package/__tests__/stigmer.test.d.ts +0 -2
- package/__tests__/stigmer.test.d.ts.map +0 -1
- package/__tests__/stigmer.test.js +0 -127
- package/__tests__/stigmer.test.js.map +0 -1
- package/__tests__/update-input-roundtrip.test.d.ts +0 -2
- package/__tests__/update-input-roundtrip.test.d.ts.map +0 -1
- package/__tests__/update-input-roundtrip.test.js +0 -775
- package/__tests__/update-input-roundtrip.test.js.map +0 -1
- package/__tests__/update-input.test.d.ts +0 -2
- package/__tests__/update-input.test.d.ts.map +0 -1
- package/__tests__/update-input.test.js +0 -188
- package/__tests__/update-input.test.js.map +0 -1
- package/execution/__tests__/approval-provenance.test.d.ts +0 -2
- package/execution/__tests__/approval-provenance.test.d.ts.map +0 -1
- package/execution/__tests__/approval-provenance.test.js +0 -42
- package/execution/__tests__/approval-provenance.test.js.map +0 -1
- package/execution/__tests__/file-review-fold.corpus.test.d.ts +0 -2
- package/execution/__tests__/file-review-fold.corpus.test.d.ts.map +0 -1
- package/execution/__tests__/file-review-fold.corpus.test.js +0 -82
- package/execution/__tests__/file-review-fold.corpus.test.js.map +0 -1
- package/execution/__tests__/file-review-fold.test.d.ts +0 -2
- package/execution/__tests__/file-review-fold.test.d.ts.map +0 -1
- package/execution/__tests__/file-review-fold.test.js +0 -184
- package/execution/__tests__/file-review-fold.test.js.map +0 -1
- package/execution/__tests__/to-display-file-change.test.d.ts +0 -2
- package/execution/__tests__/to-display-file-change.test.d.ts.map +0 -1
- package/execution/__tests__/to-display-file-change.test.js +0 -81
- package/execution/__tests__/to-display-file-change.test.js.map +0 -1
- package/execution/__tests__/tool-view.file-changes.test.d.ts +0 -2
- package/execution/__tests__/tool-view.file-changes.test.d.ts.map +0 -1
- package/execution/__tests__/tool-view.file-changes.test.js +0 -86
- package/execution/__tests__/tool-view.file-changes.test.js.map +0 -1
- package/execution/__tests__/tool-view.fixtures.test.d.ts +0 -2
- package/execution/__tests__/tool-view.fixtures.test.d.ts.map +0 -1
- package/execution/__tests__/tool-view.fixtures.test.js +0 -152
- package/execution/__tests__/tool-view.fixtures.test.js.map +0 -1
- package/execution/__tests__/tool-view.output-ref.test.d.ts +0 -2
- package/execution/__tests__/tool-view.output-ref.test.d.ts.map +0 -1
- package/execution/__tests__/tool-view.output-ref.test.js +0 -64
- package/execution/__tests__/tool-view.output-ref.test.js.map +0 -1
- package/execution/__tests__/tool-view.read.test.d.ts +0 -2
- package/execution/__tests__/tool-view.read.test.d.ts.map +0 -1
- package/execution/__tests__/tool-view.read.test.js +0 -56
- package/execution/__tests__/tool-view.read.test.js.map +0 -1
- package/execution/__tests__/tool-view.search.test.d.ts +0 -2
- package/execution/__tests__/tool-view.search.test.d.ts.map +0 -1
- package/execution/__tests__/tool-view.search.test.js +0 -200
- package/execution/__tests__/tool-view.search.test.js.map +0 -1
- package/execution/__tests__/tool-view.shell.test.d.ts +0 -2
- package/execution/__tests__/tool-view.shell.test.d.ts.map +0 -1
- package/execution/__tests__/tool-view.shell.test.js +0 -104
- package/execution/__tests__/tool-view.shell.test.js.map +0 -1
- package/execution/__tests__/transcript.test.d.ts +0 -2
- package/execution/__tests__/transcript.test.d.ts.map +0 -1
- package/execution/__tests__/transcript.test.js +0 -591
- package/execution/__tests__/transcript.test.js.map +0 -1
- package/node.test.d.ts +0 -2
- package/node.test.d.ts.map +0 -1
- package/node.test.js +0 -35
- package/node.test.js.map +0 -1
- package/src/__tests__/billing.test.ts +0 -146
- package/src/__tests__/config.test.ts +0 -52
- package/src/__tests__/ensure-identity-account.test.ts +0 -146
- package/src/__tests__/errors.test.ts +0 -349
- package/src/__tests__/gen/errors.test.ts +0 -138
- package/src/__tests__/gen/invitation-client.test.ts +0 -132
- package/src/__tests__/gen/proto-utils.test.ts +0 -99
- package/src/__tests__/gen/session-client.test.ts +0 -208
- package/src/__tests__/guest-auth.test.ts +0 -287
- package/src/__tests__/iam-principal.test.ts +0 -82
- package/src/__tests__/manifest.test.ts +0 -362
- package/src/__tests__/mcpserver-connect.test.ts +0 -181
- package/src/__tests__/node.test.ts +0 -74
- package/src/__tests__/platform-client-auth.test.ts +0 -76
- package/src/__tests__/platform.test.ts +0 -74
- package/src/__tests__/plugin.test.ts +0 -92
- package/src/__tests__/resource-availability.test.ts +0 -118
- package/src/__tests__/runner-adapter.test.ts +0 -122
- package/src/__tests__/session.test.ts +0 -66
- package/src/__tests__/sharing.test.ts +0 -159
- package/src/__tests__/skill.test.ts +0 -150
- package/src/__tests__/stigmer.test.ts +0 -170
- package/src/__tests__/update-input-roundtrip.test.ts +0 -1007
- package/src/__tests__/update-input.test.ts +0 -250
- package/src/execution/__tests__/approval-provenance.test.ts +0 -60
- package/src/execution/__tests__/file-review-fold.corpus.test.ts +0 -127
- package/src/execution/__tests__/file-review-fold.test.ts +0 -281
- package/src/execution/__tests__/to-display-file-change.test.ts +0 -106
- package/src/execution/__tests__/tool-view.file-changes.test.ts +0 -100
- package/src/execution/__tests__/tool-view.fixtures.test.ts +0 -225
- package/src/execution/__tests__/tool-view.output-ref.test.ts +0 -76
- package/src/execution/__tests__/tool-view.read.test.ts +0 -71
- package/src/execution/__tests__/tool-view.search.test.ts +0 -264
- package/src/execution/__tests__/tool-view.shell.test.ts +0 -127
- package/src/execution/__tests__/transcript.golden.md +0 -100
- package/src/execution/__tests__/transcript.test.ts +0 -697
- package/src/node.test.ts +0 -38
|
@@ -1,775 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { create, toJson, isFieldSet, } from "@bufbuild/protobuf";
|
|
3
|
-
import { timestampFromDate } from "@bufbuild/protobuf/wkt";
|
|
4
|
-
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
5
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
6
|
-
import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
7
|
-
import { AgentSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
8
|
-
import { AgentChannelSchema } from "@stigmer/protos/ai/stigmer/agentic/agentchannel/v1/api_pb";
|
|
9
|
-
import { AgentChannelSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agentchannel/v1/spec_pb";
|
|
10
|
-
import { AgentExecutionSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
11
|
-
import { AgentExecutionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
|
|
12
|
-
import { InteractionMode, ApprovalMode, ServiceTier, } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
13
|
-
import { AgentInstanceSchema } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/api_pb";
|
|
14
|
-
import { AgentInstanceSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/spec_pb";
|
|
15
|
-
import { AgentShareSchema } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/api_pb";
|
|
16
|
-
import { AgentShareSpecSchema, AgentShareAudience, } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/spec_pb";
|
|
17
|
-
import { ApiKeySchema } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/api_pb";
|
|
18
|
-
import { ApiKeySpecSchema } from "@stigmer/protos/ai/stigmer/iam/apikey/v1/spec_pb";
|
|
19
|
-
import { ChannelAppSchema } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/api_pb";
|
|
20
|
-
import { ChannelAppSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/spec_pb";
|
|
21
|
-
import { EnvironmentSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/api_pb";
|
|
22
|
-
import { EnvironmentSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
23
|
-
import { IdentityAccountSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
24
|
-
import { IdentityAccountSpecSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/spec_pb";
|
|
25
|
-
import { IdentityAccountProvisioningMode } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/enum_pb";
|
|
26
|
-
import { IdentityProviderSchema } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/api_pb";
|
|
27
|
-
import { IdentityProviderSpecSchema } from "@stigmer/protos/ai/stigmer/iam/identityprovider/v1/spec_pb";
|
|
28
|
-
import { IamRole } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
29
|
-
import { McpServerSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
30
|
-
import { McpServerSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/spec_pb";
|
|
31
|
-
import { OAuthAppSchema } from "@stigmer/protos/ai/stigmer/iam/oauthapp/v1/api_pb";
|
|
32
|
-
import { OAuthAppSpecSchema, VendorApprovalStatus, TokenEndpointAuthMethod, } from "@stigmer/protos/ai/stigmer/iam/oauthapp/v1/spec_pb";
|
|
33
|
-
import { OrganizationSchema } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/api_pb";
|
|
34
|
-
import { OrganizationSpecSchema } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/spec_pb";
|
|
35
|
-
import { ManagementMode } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/enum_pb";
|
|
36
|
-
import { PlatformClientSchema } from "@stigmer/protos/ai/stigmer/iam/platformclient/v1/api_pb";
|
|
37
|
-
import { PlatformClientSpecSchema } from "@stigmer/protos/ai/stigmer/iam/platformclient/v1/spec_pb";
|
|
38
|
-
import { ScheduleSchema } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/api_pb";
|
|
39
|
-
import { ScheduleSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/spec_pb";
|
|
40
|
-
import { SessionSchema } from "@stigmer/protos/ai/stigmer/agentic/session/v1/api_pb";
|
|
41
|
-
import { SessionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/session/v1/spec_pb";
|
|
42
|
-
import { Harness, CursorMode, ExecutionTarget, GitWriteBackMode, } from "@stigmer/protos/ai/stigmer/agentic/session/v1/enum_pb";
|
|
43
|
-
import { WorkflowSchema } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
|
|
44
|
-
import { WorkflowSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/spec_pb";
|
|
45
|
-
import { WorkflowTaskKind, BudgetExceededPolicy, } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/enum_pb";
|
|
46
|
-
import { WorkflowExecutionSchema } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/api_pb";
|
|
47
|
-
import { WorkflowExecutionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/spec_pb";
|
|
48
|
-
import { WorkflowInstanceSchema } from "@stigmer/protos/ai/stigmer/agentic/workflowinstance/v1/api_pb";
|
|
49
|
-
import { WorkflowInstanceSpecSchema, WorkflowExecutionVisibility, } from "@stigmer/protos/ai/stigmer/agentic/workflowinstance/v1/spec_pb";
|
|
50
|
-
import { buildAgentProto, toAgentUpdateInput } from "../gen/agent";
|
|
51
|
-
import { buildAgentChannelProto, toAgentChannelUpdateInput } from "../gen/agentchannel";
|
|
52
|
-
import { buildAgentExecutionProto, toAgentExecutionUpdateInput } from "../gen/agentexecution";
|
|
53
|
-
import { buildAgentInstanceProto, toAgentInstanceUpdateInput } from "../gen/agentinstance";
|
|
54
|
-
import { buildAgentShareProto, toAgentShareUpdateInput } from "../gen/agentshare";
|
|
55
|
-
import { buildApiKeyProto, toApiKeyUpdateInput } from "../gen/apikey";
|
|
56
|
-
import { buildChannelAppProto, toChannelAppUpdateInput } from "../gen/channelapp";
|
|
57
|
-
import { buildEnvironmentProto, toEnvironmentUpdateInput } from "../gen/environment";
|
|
58
|
-
import { buildIdentityAccountProto, toIdentityAccountUpdateInput } from "../gen/identityaccount";
|
|
59
|
-
import { buildIdentityProviderProto, toIdentityProviderUpdateInput } from "../gen/identityprovider";
|
|
60
|
-
import { buildMcpServerProto, toMcpServerUpdateInput } from "../gen/mcpserver";
|
|
61
|
-
import { buildOAuthAppProto, toOAuthAppUpdateInput } from "../gen/oauthapp";
|
|
62
|
-
import { buildOrganizationProto, toOrganizationUpdateInput } from "../gen/organization";
|
|
63
|
-
import { buildPlatformClientProto, toPlatformClientUpdateInput } from "../gen/platformclient";
|
|
64
|
-
import { buildScheduleProto, toScheduleUpdateInput } from "../gen/schedule";
|
|
65
|
-
import { buildSessionProto, toSessionUpdateInput } from "../gen/session";
|
|
66
|
-
import { buildWorkflowProto, toWorkflowUpdateInput } from "../gen/workflow";
|
|
67
|
-
import { buildWorkflowExecutionProto, toWorkflowExecutionUpdateInput } from "../gen/workflowexecution";
|
|
68
|
-
import { buildWorkflowInstanceProto, toWorkflowInstanceUpdateInput } from "../gen/workflowinstance";
|
|
69
|
-
/**
|
|
70
|
-
* Systematic wipe-bug guard for every generated toXxxUpdateInput mapper
|
|
71
|
-
* (update RPCs are full-spec replacements — see gen/proto-utils.ts and the
|
|
72
|
-
* mapper JSDoc). Three layers per resource, generalizing the pattern that
|
|
73
|
-
* caught oss#319:
|
|
74
|
-
*
|
|
75
|
-
* 1. SCHEMA TRIPWIRE — proto reflection asserts the fixture populates
|
|
76
|
-
* EVERY top-level spec field (one arm per oneof). When a proto gains a
|
|
77
|
-
* field, this fails first, forcing the fixture forward; the round-trip
|
|
78
|
-
* then proves the regenerated mapper carries it.
|
|
79
|
-
* 2. ROUND-TRIP — build(toUpdateInput(fixture)) must reproduce the spec
|
|
80
|
-
* exactly (compared as JSON, defaults omitted). Nested sub-fields are
|
|
81
|
-
* covered by population: every nested value in a fixture is
|
|
82
|
-
* non-default, so a dropped nested field breaks equality.
|
|
83
|
-
* 3. METADATA — name/slug/org/labels survive; visibility is carried
|
|
84
|
-
* (idempotent — the server preserves it regardless, oss#573).
|
|
85
|
-
*/
|
|
86
|
-
const META = {
|
|
87
|
-
id: "res-123",
|
|
88
|
-
name: "Fixture Resource",
|
|
89
|
-
slug: "fixture-resource",
|
|
90
|
-
org: "acme",
|
|
91
|
-
labels: { team: "platform" },
|
|
92
|
-
visibility: ApiResourceVisibility.visibility_private,
|
|
93
|
-
};
|
|
94
|
-
function assertFixtureCoversSpec(schema, spec) {
|
|
95
|
-
for (const field of schema.fields) {
|
|
96
|
-
if (field.oneof)
|
|
97
|
-
continue; // oneofs are asserted as a group below
|
|
98
|
-
expect(isFieldSet(spec, field), `fixture must populate ${schema.typeName}.${field.name} — a new proto ` +
|
|
99
|
-
`field lands here first; add it to the fixture, then the round-trip ` +
|
|
100
|
-
`test proves the regenerated mapper carries it`).toBe(true);
|
|
101
|
-
}
|
|
102
|
-
for (const oneof of schema.oneofs) {
|
|
103
|
-
const value = spec[oneof.localName];
|
|
104
|
-
expect(value?.case, `fixture must set one arm of ${schema.typeName}.${oneof.name}`).toBeDefined();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function assertSpecRoundTrip(specSchema, original, rebuilt) {
|
|
108
|
-
expect(toJson(specSchema, rebuilt.spec)).toEqual(toJson(specSchema, original.spec));
|
|
109
|
-
expect(rebuilt.metadata?.name).toBe(META.name);
|
|
110
|
-
expect(rebuilt.metadata?.slug).toBe(META.slug);
|
|
111
|
-
expect(rebuilt.metadata?.org).toBe(META.org);
|
|
112
|
-
expect(rebuilt.metadata?.labels).toEqual(META.labels);
|
|
113
|
-
expect(rebuilt.metadata?.visibility).toBe(META.visibility);
|
|
114
|
-
}
|
|
115
|
-
// ---------------------------------------------------------------------------
|
|
116
|
-
// Shared nested fixtures
|
|
117
|
-
// ---------------------------------------------------------------------------
|
|
118
|
-
const MCP_USAGE = {
|
|
119
|
-
mcpServerRef: {
|
|
120
|
-
org: "acme",
|
|
121
|
-
slug: "github-mcp",
|
|
122
|
-
version: "v3",
|
|
123
|
-
kind: ApiResourceKind.mcp_server,
|
|
124
|
-
},
|
|
125
|
-
enabledTools: ["create_issue"],
|
|
126
|
-
toolApprovalOverrides: [
|
|
127
|
-
{ toolName: "create_issue", requiresApproval: true, message: "Careful." },
|
|
128
|
-
],
|
|
129
|
-
};
|
|
130
|
-
const WORKSPACE_ENTRIES = [
|
|
131
|
-
{
|
|
132
|
-
name: "repo",
|
|
133
|
-
source: {
|
|
134
|
-
source: {
|
|
135
|
-
case: "gitRepo",
|
|
136
|
-
value: {
|
|
137
|
-
url: "https://github.com/acme/app.git",
|
|
138
|
-
branch: "main",
|
|
139
|
-
commit: "abc123",
|
|
140
|
-
depth: 1,
|
|
141
|
-
writeBackMode: GitWriteBackMode.GIT_WRITE_BACK_BRANCH_AND_PR,
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: "scratch",
|
|
148
|
-
source: { source: { case: "localPath", value: { path: "/tmp/scratch" } } },
|
|
149
|
-
},
|
|
150
|
-
];
|
|
151
|
-
const RUN_CONFIG = {
|
|
152
|
-
modelName: "claude-sonnet-4.6",
|
|
153
|
-
maxCostUsd: 4,
|
|
154
|
-
maxToolRounds: 30,
|
|
155
|
-
serviceTier: ServiceTier.FAST,
|
|
156
|
-
};
|
|
157
|
-
// ---------------------------------------------------------------------------
|
|
158
|
-
// Per-resource fixtures + suites
|
|
159
|
-
// ---------------------------------------------------------------------------
|
|
160
|
-
describe("toAgentUpdateInput", () => {
|
|
161
|
-
const fixture = () => create(AgentSchema, {
|
|
162
|
-
metadata: META,
|
|
163
|
-
spec: {
|
|
164
|
-
description: "Handles support tickets.",
|
|
165
|
-
iconUrl: "https://acme.example/agent.png",
|
|
166
|
-
instructions: "Be terse.",
|
|
167
|
-
mcpServerUsages: [MCP_USAGE],
|
|
168
|
-
skillRefs: [
|
|
169
|
-
{ org: "acme", slug: "triage", version: "v2", kind: ApiResourceKind.skill },
|
|
170
|
-
],
|
|
171
|
-
subAgents: [
|
|
172
|
-
{
|
|
173
|
-
name: "researcher",
|
|
174
|
-
description: "Digs into logs.",
|
|
175
|
-
instructions: "Cite sources.",
|
|
176
|
-
mcpAccess: [{ mcpServer: "github-mcp", enabledTools: ["search_code"] }],
|
|
177
|
-
skillRefs: [
|
|
178
|
-
{ org: "acme", slug: "log-analysis", version: "v1", kind: ApiResourceKind.skill },
|
|
179
|
-
],
|
|
180
|
-
modelOverride: "gpt-5.6-sol",
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
env: { API_KEY: { isSecret: true, description: "Vendor key", optional: true } },
|
|
184
|
-
},
|
|
185
|
-
});
|
|
186
|
-
it("fixture covers every AgentSpec field (schema tripwire)", () => {
|
|
187
|
-
assertFixtureCoversSpec(AgentSpecSchema, fixture().spec);
|
|
188
|
-
});
|
|
189
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
190
|
-
const original = fixture();
|
|
191
|
-
assertSpecRoundTrip(AgentSpecSchema, original, buildAgentProto(toAgentUpdateInput(original)));
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
describe("toAgentChannelUpdateInput", () => {
|
|
195
|
-
const fixture = () => create(AgentChannelSchema, {
|
|
196
|
-
metadata: META,
|
|
197
|
-
spec: {
|
|
198
|
-
agentRef: { org: "acme", slug: "support-bot", kind: ApiResourceKind.agent },
|
|
199
|
-
enabled: true,
|
|
200
|
-
providerConfig: { case: "slack", value: {} },
|
|
201
|
-
environmentRefs: [
|
|
202
|
-
{ org: "acme", slug: "prod", kind: ApiResourceKind.environment },
|
|
203
|
-
],
|
|
204
|
-
appRef: { org: "acme", slug: "acme-slack", kind: ApiResourceKind.channel_app },
|
|
205
|
-
proactiveMessagingEnabled: true,
|
|
206
|
-
runConfig: RUN_CONFIG,
|
|
207
|
-
},
|
|
208
|
-
});
|
|
209
|
-
it("fixture covers every AgentChannelSpec field (schema tripwire)", () => {
|
|
210
|
-
assertFixtureCoversSpec(AgentChannelSpecSchema, fixture().spec);
|
|
211
|
-
});
|
|
212
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
213
|
-
const original = fixture();
|
|
214
|
-
assertSpecRoundTrip(AgentChannelSpecSchema, original, buildAgentChannelProto(toAgentChannelUpdateInput(original)));
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
describe("toAgentExecutionUpdateInput", () => {
|
|
218
|
-
const fixture = () => create(AgentExecutionSchema, {
|
|
219
|
-
metadata: META,
|
|
220
|
-
spec: {
|
|
221
|
-
sessionId: "sess-1",
|
|
222
|
-
agentId: "agent-1",
|
|
223
|
-
sessionSpec: {
|
|
224
|
-
agentInstanceId: "inst-1",
|
|
225
|
-
subject: "Fix the flaky test",
|
|
226
|
-
harnessStateId: "hs-1",
|
|
227
|
-
harnessStateIdHistory: ["hs-0"],
|
|
228
|
-
metadata: { "stigmer.ai/context": "embedded" },
|
|
229
|
-
workspaceEntries: WORKSPACE_ENTRIES,
|
|
230
|
-
mcpServerUsages: [MCP_USAGE],
|
|
231
|
-
skillRefs: [
|
|
232
|
-
{ org: "acme", slug: "triage", version: "v2", kind: ApiResourceKind.skill },
|
|
233
|
-
],
|
|
234
|
-
harness: Harness.CURSOR,
|
|
235
|
-
cursorMode: CursorMode.CLOUD,
|
|
236
|
-
executionTarget: ExecutionTarget.CLOUD,
|
|
237
|
-
},
|
|
238
|
-
message: "Please fix it.",
|
|
239
|
-
executionConfig: {
|
|
240
|
-
modelName: "claude-sonnet-4.6",
|
|
241
|
-
contextManagement: {
|
|
242
|
-
disableSummarization: true,
|
|
243
|
-
customTriggerThreshold: 90,
|
|
244
|
-
customTargetTokens: 50000,
|
|
245
|
-
},
|
|
246
|
-
maxToolRounds: 40,
|
|
247
|
-
maxToolResultChars: 20000,
|
|
248
|
-
maxCostUsd: 8,
|
|
249
|
-
interactionMode: InteractionMode.PLAN,
|
|
250
|
-
structuredOutputSchema: { type: "object" },
|
|
251
|
-
buildFromPlan: true,
|
|
252
|
-
approvalMode: ApprovalMode.UNATTENDED,
|
|
253
|
-
serviceTier: ServiceTier.FAST,
|
|
254
|
-
},
|
|
255
|
-
runtimeEnv: { TOKEN: { value: "shh", isSecret: true } },
|
|
256
|
-
callbackToken: new Uint8Array([1, 2, 3]),
|
|
257
|
-
autoApproveAll: true,
|
|
258
|
-
parentWorkflowId: "wf-1",
|
|
259
|
-
attachments: [
|
|
260
|
-
{
|
|
261
|
-
filename: "spec.pdf",
|
|
262
|
-
storageKey: "att/spec.pdf",
|
|
263
|
-
mountPath: "/work/spec.pdf",
|
|
264
|
-
contentType: "application/pdf",
|
|
265
|
-
extract: true,
|
|
266
|
-
localPath: "/tmp/spec.pdf",
|
|
267
|
-
},
|
|
268
|
-
],
|
|
269
|
-
workspaceFileRefs: ["src/app.ts"],
|
|
270
|
-
activityTaskQueue: "runner-q",
|
|
271
|
-
supersedesExecutionId: "exec-0",
|
|
272
|
-
conversationCatchup: {
|
|
273
|
-
digest: "Prior turns summarized.",
|
|
274
|
-
windowEnd: timestampFromDate(new Date("2026-08-15T10:00:00Z")),
|
|
275
|
-
},
|
|
276
|
-
declaredPreferences: {
|
|
277
|
-
orgContext: "We deploy to us-east-1.",
|
|
278
|
-
userContext: "Keep answers terse.",
|
|
279
|
-
},
|
|
280
|
-
recalledMemories: {
|
|
281
|
-
enabled: true,
|
|
282
|
-
facts: [{ memoryId: "mem-1", content: "Prefers tabs." }],
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
});
|
|
286
|
-
it("fixture covers every AgentExecutionSpec field (schema tripwire)", () => {
|
|
287
|
-
assertFixtureCoversSpec(AgentExecutionSpecSchema, fixture().spec);
|
|
288
|
-
});
|
|
289
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
290
|
-
const original = fixture();
|
|
291
|
-
assertSpecRoundTrip(AgentExecutionSpecSchema, original, buildAgentExecutionProto(toAgentExecutionUpdateInput(original)));
|
|
292
|
-
});
|
|
293
|
-
});
|
|
294
|
-
describe("toAgentInstanceUpdateInput", () => {
|
|
295
|
-
const fixture = () => create(AgentInstanceSchema, {
|
|
296
|
-
metadata: META,
|
|
297
|
-
spec: {
|
|
298
|
-
agentId: "agent-1",
|
|
299
|
-
description: "Prod instance.",
|
|
300
|
-
environmentRefs: [
|
|
301
|
-
{ org: "acme", slug: "prod", kind: ApiResourceKind.environment },
|
|
302
|
-
],
|
|
303
|
-
},
|
|
304
|
-
});
|
|
305
|
-
it("fixture covers every AgentInstanceSpec field (schema tripwire)", () => {
|
|
306
|
-
assertFixtureCoversSpec(AgentInstanceSpecSchema, fixture().spec);
|
|
307
|
-
});
|
|
308
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
309
|
-
const original = fixture();
|
|
310
|
-
assertSpecRoundTrip(AgentInstanceSpecSchema, original, buildAgentInstanceProto(toAgentInstanceUpdateInput(original)));
|
|
311
|
-
});
|
|
312
|
-
});
|
|
313
|
-
describe("toAgentShareUpdateInput", () => {
|
|
314
|
-
const fixture = () => create(AgentShareSchema, {
|
|
315
|
-
metadata: META,
|
|
316
|
-
spec: {
|
|
317
|
-
agentRef: { org: "acme", slug: "support-bot", kind: ApiResourceKind.agent },
|
|
318
|
-
enabled: true,
|
|
319
|
-
audience: AgentShareAudience.org,
|
|
320
|
-
allowedOrigins: ["https://acme.example"],
|
|
321
|
-
messages: {
|
|
322
|
-
rateLimited: "Slow down.",
|
|
323
|
-
unavailable: "Back soon.",
|
|
324
|
-
conversationEnded: "Bye.",
|
|
325
|
-
},
|
|
326
|
-
environmentRefs: [
|
|
327
|
-
{ org: "acme", slug: "prod", kind: ApiResourceKind.environment },
|
|
328
|
-
],
|
|
329
|
-
runConfig: RUN_CONFIG,
|
|
330
|
-
},
|
|
331
|
-
});
|
|
332
|
-
it("fixture covers every AgentShareSpec field (schema tripwire)", () => {
|
|
333
|
-
assertFixtureCoversSpec(AgentShareSpecSchema, fixture().spec);
|
|
334
|
-
});
|
|
335
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
336
|
-
const original = fixture();
|
|
337
|
-
assertSpecRoundTrip(AgentShareSpecSchema, original, buildAgentShareProto(toAgentShareUpdateInput(original)));
|
|
338
|
-
});
|
|
339
|
-
});
|
|
340
|
-
describe("toApiKeyUpdateInput", () => {
|
|
341
|
-
const fixture = () => create(ApiKeySchema, {
|
|
342
|
-
metadata: META,
|
|
343
|
-
spec: {
|
|
344
|
-
keyHash: "sha256:abcd",
|
|
345
|
-
fingerprint: "fp-1234",
|
|
346
|
-
expiresAt: timestampFromDate(new Date("2027-01-01T00:00:00Z")),
|
|
347
|
-
neverExpires: true,
|
|
348
|
-
},
|
|
349
|
-
});
|
|
350
|
-
it("fixture covers every ApiKeySpec field (schema tripwire)", () => {
|
|
351
|
-
assertFixtureCoversSpec(ApiKeySpecSchema, fixture().spec);
|
|
352
|
-
});
|
|
353
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
354
|
-
const original = fixture();
|
|
355
|
-
assertSpecRoundTrip(ApiKeySpecSchema, original, buildApiKeyProto(toApiKeyUpdateInput(original)));
|
|
356
|
-
});
|
|
357
|
-
});
|
|
358
|
-
describe("toChannelAppUpdateInput", () => {
|
|
359
|
-
const slackFixture = () => create(ChannelAppSchema, {
|
|
360
|
-
metadata: META,
|
|
361
|
-
spec: {
|
|
362
|
-
providerConfig: {
|
|
363
|
-
case: "slack",
|
|
364
|
-
value: { clientId: "1234.5678", clientSecret: "shh", signingSecret: "sign" },
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
});
|
|
368
|
-
const whatsappFixture = () => create(ChannelAppSchema, {
|
|
369
|
-
metadata: META,
|
|
370
|
-
spec: {
|
|
371
|
-
providerConfig: {
|
|
372
|
-
case: "whatsapp",
|
|
373
|
-
value: { appId: "wa-1", appSecret: "shh", accessToken: "tok", verifyToken: "vrfy" },
|
|
374
|
-
},
|
|
375
|
-
},
|
|
376
|
-
});
|
|
377
|
-
it("fixture covers every ChannelAppSpec field (schema tripwire)", () => {
|
|
378
|
-
assertFixtureCoversSpec(ChannelAppSpecSchema, slackFixture().spec);
|
|
379
|
-
});
|
|
380
|
-
it("round-trips the slack arm through the builder", () => {
|
|
381
|
-
const original = slackFixture();
|
|
382
|
-
assertSpecRoundTrip(ChannelAppSpecSchema, original, buildChannelAppProto(toChannelAppUpdateInput(original)));
|
|
383
|
-
});
|
|
384
|
-
it("round-trips the whatsapp arm through the builder", () => {
|
|
385
|
-
const original = whatsappFixture();
|
|
386
|
-
assertSpecRoundTrip(ChannelAppSpecSchema, original, buildChannelAppProto(toChannelAppUpdateInput(original)));
|
|
387
|
-
});
|
|
388
|
-
});
|
|
389
|
-
describe("toEnvironmentUpdateInput", () => {
|
|
390
|
-
const fixture = () => create(EnvironmentSchema, {
|
|
391
|
-
metadata: META,
|
|
392
|
-
spec: {
|
|
393
|
-
description: "Prod secrets.",
|
|
394
|
-
data: {
|
|
395
|
-
API_KEY: { value: "shh", isSecret: true, description: "Vendor key" },
|
|
396
|
-
},
|
|
397
|
-
},
|
|
398
|
-
});
|
|
399
|
-
it("fixture covers every EnvironmentSpec field (schema tripwire)", () => {
|
|
400
|
-
assertFixtureCoversSpec(EnvironmentSpecSchema, fixture().spec);
|
|
401
|
-
});
|
|
402
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
403
|
-
const original = fixture();
|
|
404
|
-
assertSpecRoundTrip(EnvironmentSpecSchema, original, buildEnvironmentProto(toEnvironmentUpdateInput(original)));
|
|
405
|
-
});
|
|
406
|
-
});
|
|
407
|
-
describe("toIdentityAccountUpdateInput (tripwire)", () => {
|
|
408
|
-
const fixture = () => create(IdentityAccountSchema, {
|
|
409
|
-
metadata: META,
|
|
410
|
-
spec: {
|
|
411
|
-
idpId: "auth0|abc123",
|
|
412
|
-
email: "ada@acme.example",
|
|
413
|
-
firstName: "Ada",
|
|
414
|
-
lastName: "Lovelace",
|
|
415
|
-
pictureUrl: "https://acme.example/ada.png",
|
|
416
|
-
isMachineAccount: true,
|
|
417
|
-
provisioningMode: IdentityAccountProvisioningMode.federated,
|
|
418
|
-
identityProviderRef: {
|
|
419
|
-
org: "acme",
|
|
420
|
-
slug: "acme-okta",
|
|
421
|
-
kind: ApiResourceKind.identity_provider,
|
|
422
|
-
},
|
|
423
|
-
preferences: {
|
|
424
|
-
standingContext: "Keep answers terse.",
|
|
425
|
-
defaultHarness: "cursor",
|
|
426
|
-
defaultNativeModel: "claude-sonnet-4.6",
|
|
427
|
-
defaultCursorModel: "composer-2.5",
|
|
428
|
-
},
|
|
429
|
-
},
|
|
430
|
-
});
|
|
431
|
-
it("fixture covers every IdentityAccountSpec field (schema tripwire)", () => {
|
|
432
|
-
assertFixtureCoversSpec(IdentityAccountSpecSchema, fixture().spec);
|
|
433
|
-
});
|
|
434
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
435
|
-
const original = fixture();
|
|
436
|
-
assertSpecRoundTrip(IdentityAccountSpecSchema, original, buildIdentityAccountProto(toIdentityAccountUpdateInput(original)));
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
describe("toIdentityProviderUpdateInput", () => {
|
|
440
|
-
const fixture = () => create(IdentityProviderSchema, {
|
|
441
|
-
metadata: META,
|
|
442
|
-
spec: {
|
|
443
|
-
displayName: "Acme Okta",
|
|
444
|
-
jwksUri: "https://acme.okta.example/jwks",
|
|
445
|
-
allowedIssuers: ["https://acme.okta.example"],
|
|
446
|
-
expectedAudience: "stigmer",
|
|
447
|
-
rateLimitBudget: 120,
|
|
448
|
-
userinfoEndpoint: "https://acme.okta.example/userinfo",
|
|
449
|
-
isSsoProvider: true,
|
|
450
|
-
oidcClientId: "oidc-123",
|
|
451
|
-
autoProvisionAccounts: true,
|
|
452
|
-
autoGrantOnOrg: true,
|
|
453
|
-
autoGrantRole: IamRole.admin,
|
|
454
|
-
tenantOrgClaim: "org_slug",
|
|
455
|
-
},
|
|
456
|
-
});
|
|
457
|
-
it("fixture covers every IdentityProviderSpec field (schema tripwire)", () => {
|
|
458
|
-
assertFixtureCoversSpec(IdentityProviderSpecSchema, fixture().spec);
|
|
459
|
-
});
|
|
460
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
461
|
-
const original = fixture();
|
|
462
|
-
assertSpecRoundTrip(IdentityProviderSpecSchema, original, buildIdentityProviderProto(toIdentityProviderUpdateInput(original)));
|
|
463
|
-
});
|
|
464
|
-
it("preserves rate_limit_budget when only the display name changes (live wipe bug)", () => {
|
|
465
|
-
const original = fixture();
|
|
466
|
-
const rebuilt = buildIdentityProviderProto({
|
|
467
|
-
...toIdentityProviderUpdateInput(original),
|
|
468
|
-
displayName: "Acme Okta (renamed)",
|
|
469
|
-
});
|
|
470
|
-
expect(rebuilt.spec?.rateLimitBudget).toBe(120);
|
|
471
|
-
expect(rebuilt.spec?.displayName).toBe("Acme Okta (renamed)");
|
|
472
|
-
});
|
|
473
|
-
});
|
|
474
|
-
describe("toMcpServerUpdateInput", () => {
|
|
475
|
-
const fixture = () => create(McpServerSchema, {
|
|
476
|
-
metadata: META,
|
|
477
|
-
spec: {
|
|
478
|
-
description: "GitHub tools.",
|
|
479
|
-
iconUrl: "https://acme.example/mcp.png",
|
|
480
|
-
tags: ["devtools"],
|
|
481
|
-
serverType: {
|
|
482
|
-
case: "stdio",
|
|
483
|
-
value: { command: "npx", args: ["-y", "github-mcp"], workingDir: "/srv" },
|
|
484
|
-
},
|
|
485
|
-
defaultEnabledTools: ["search_code"],
|
|
486
|
-
env: { GH_TOKEN: { isSecret: true, description: "PAT", optional: true } },
|
|
487
|
-
pinnedToolApprovals: [
|
|
488
|
-
{ toolName: "create_issue", message: "Writes data.", fromDestructiveHint: true },
|
|
489
|
-
],
|
|
490
|
-
repositoryUrl: "https://github.com/acme/github-mcp",
|
|
491
|
-
githubStars: 4200,
|
|
492
|
-
auth: {
|
|
493
|
-
oauthAppRef: { org: "acme", slug: "gh-oauth", kind: ApiResourceKind.oauth_app },
|
|
494
|
-
targetEnvVar: "GH_TOKEN",
|
|
495
|
-
tokenLifetimeHint: "8h",
|
|
496
|
-
scopeHints: ["repo"],
|
|
497
|
-
discoveryUrl: "https://github.com/.well-known/oauth",
|
|
498
|
-
oauthOnly: true,
|
|
499
|
-
},
|
|
500
|
-
},
|
|
501
|
-
});
|
|
502
|
-
it("fixture covers every McpServerSpec field (schema tripwire)", () => {
|
|
503
|
-
assertFixtureCoversSpec(McpServerSpecSchema, fixture().spec);
|
|
504
|
-
});
|
|
505
|
-
it("round-trips the stdio arm through the builder", () => {
|
|
506
|
-
const original = fixture();
|
|
507
|
-
assertSpecRoundTrip(McpServerSpecSchema, original, buildMcpServerProto(toMcpServerUpdateInput(original)));
|
|
508
|
-
});
|
|
509
|
-
it("round-trips the http arm through the builder", () => {
|
|
510
|
-
const original = create(McpServerSchema, {
|
|
511
|
-
metadata: META,
|
|
512
|
-
spec: {
|
|
513
|
-
serverType: {
|
|
514
|
-
case: "http",
|
|
515
|
-
value: {
|
|
516
|
-
url: "https://mcp.acme.example",
|
|
517
|
-
headers: { Authorization: "Bearer x" },
|
|
518
|
-
queryParams: { v: "1" },
|
|
519
|
-
timeoutSeconds: 30,
|
|
520
|
-
},
|
|
521
|
-
},
|
|
522
|
-
},
|
|
523
|
-
});
|
|
524
|
-
assertSpecRoundTrip(McpServerSpecSchema, original, buildMcpServerProto(toMcpServerUpdateInput(original)));
|
|
525
|
-
});
|
|
526
|
-
});
|
|
527
|
-
describe("toOAuthAppUpdateInput", () => {
|
|
528
|
-
const fixture = () => create(OAuthAppSchema, {
|
|
529
|
-
metadata: META,
|
|
530
|
-
spec: {
|
|
531
|
-
provider: "github",
|
|
532
|
-
clientId: "gh-client-1",
|
|
533
|
-
clientSecret: "***REDACTED***",
|
|
534
|
-
authorizationUrl: "https://github.com/login/oauth/authorize",
|
|
535
|
-
tokenUrl: "https://github.com/login/oauth/access_token",
|
|
536
|
-
scopes: ["repo", "read:user"],
|
|
537
|
-
userinfoUrl: "https://api.github.com/user",
|
|
538
|
-
scopeParameterName: "scope",
|
|
539
|
-
vendorApprovalStatus: VendorApprovalStatus.APPROVED,
|
|
540
|
-
vendorApprovalDocsUrl: "https://acme.example/vendor-docs",
|
|
541
|
-
tokenEndpointAuthMethod: TokenEndpointAuthMethod.CLIENT_SECRET_POST,
|
|
542
|
-
},
|
|
543
|
-
});
|
|
544
|
-
it("fixture covers every OAuthAppSpec field (schema tripwire)", () => {
|
|
545
|
-
assertFixtureCoversSpec(OAuthAppSpecSchema, fixture().spec);
|
|
546
|
-
});
|
|
547
|
-
it("round-trips the full spec (incl. the redaction marker) through the builder", () => {
|
|
548
|
-
// Sending the redaction marker back means "keep the stored secret" —
|
|
549
|
-
// the server's EncryptClientSecretForUpdateStep preserves on redacted.
|
|
550
|
-
const original = fixture();
|
|
551
|
-
assertSpecRoundTrip(OAuthAppSpecSchema, original, buildOAuthAppProto(toOAuthAppUpdateInput(original)));
|
|
552
|
-
});
|
|
553
|
-
});
|
|
554
|
-
describe("toOrganizationUpdateInput (tripwire)", () => {
|
|
555
|
-
const fixture = () => create(OrganizationSchema, {
|
|
556
|
-
metadata: META,
|
|
557
|
-
spec: {
|
|
558
|
-
description: "We make everything.",
|
|
559
|
-
logoUrl: "https://acme.example/logo.png",
|
|
560
|
-
managementMode: ManagementMode.self_managed,
|
|
561
|
-
identityProviderRef: {
|
|
562
|
-
org: "acme",
|
|
563
|
-
slug: "acme-okta",
|
|
564
|
-
kind: ApiResourceKind.identity_provider,
|
|
565
|
-
},
|
|
566
|
-
externalOrgId: "ext-org-1",
|
|
567
|
-
isPersonal: true,
|
|
568
|
-
preferences: { standingContext: "We deploy to us-east-1." },
|
|
569
|
-
},
|
|
570
|
-
});
|
|
571
|
-
it("fixture covers every OrganizationSpec field (schema tripwire)", () => {
|
|
572
|
-
assertFixtureCoversSpec(OrganizationSpecSchema, fixture().spec);
|
|
573
|
-
});
|
|
574
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
575
|
-
const original = fixture();
|
|
576
|
-
assertSpecRoundTrip(OrganizationSpecSchema, original, buildOrganizationProto(toOrganizationUpdateInput(original)));
|
|
577
|
-
});
|
|
578
|
-
});
|
|
579
|
-
describe("toPlatformClientUpdateInput", () => {
|
|
580
|
-
const fixture = () => create(PlatformClientSchema, {
|
|
581
|
-
metadata: META,
|
|
582
|
-
spec: {
|
|
583
|
-
clientId: "pc-1",
|
|
584
|
-
clientSecretHash: "sha256:hash",
|
|
585
|
-
secretFingerprint: "fp-1",
|
|
586
|
-
expiresAt: timestampFromDate(new Date("2027-06-01T00:00:00Z")),
|
|
587
|
-
neverExpires: true,
|
|
588
|
-
autoProvisionAccounts: true,
|
|
589
|
-
autoGrantOnOrg: true,
|
|
590
|
-
autoGrantRole: IamRole.owner,
|
|
591
|
-
allowedOrigins: ["https://embed.acme.example"],
|
|
592
|
-
environmentRefs: [
|
|
593
|
-
{ org: "acme", slug: "prod", kind: ApiResourceKind.environment },
|
|
594
|
-
],
|
|
595
|
-
},
|
|
596
|
-
});
|
|
597
|
-
it("fixture covers every PlatformClientSpec field (schema tripwire)", () => {
|
|
598
|
-
assertFixtureCoversSpec(PlatformClientSpecSchema, fixture().spec);
|
|
599
|
-
});
|
|
600
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
601
|
-
const original = fixture();
|
|
602
|
-
assertSpecRoundTrip(PlatformClientSpecSchema, original, buildPlatformClientProto(toPlatformClientUpdateInput(original)));
|
|
603
|
-
});
|
|
604
|
-
it("preserves environment_refs when only origins change (live wipe bug)", () => {
|
|
605
|
-
const original = fixture();
|
|
606
|
-
const rebuilt = buildPlatformClientProto({
|
|
607
|
-
...toPlatformClientUpdateInput(original),
|
|
608
|
-
allowedOrigins: ["https://other.acme.example"],
|
|
609
|
-
});
|
|
610
|
-
expect(rebuilt.spec?.environmentRefs.map((r) => r.slug)).toEqual(["prod"]);
|
|
611
|
-
expect(rebuilt.spec?.allowedOrigins).toEqual(["https://other.acme.example"]);
|
|
612
|
-
});
|
|
613
|
-
});
|
|
614
|
-
describe("toScheduleUpdateInput", () => {
|
|
615
|
-
const fixture = () => create(ScheduleSchema, {
|
|
616
|
-
metadata: META,
|
|
617
|
-
spec: {
|
|
618
|
-
cron: "0 9 * * 1",
|
|
619
|
-
timeZone: "America/New_York",
|
|
620
|
-
enabled: true,
|
|
621
|
-
target: {
|
|
622
|
-
case: "agent",
|
|
623
|
-
value: {
|
|
624
|
-
agentRef: { org: "acme", slug: "support-bot", kind: ApiResourceKind.agent },
|
|
625
|
-
message: "Weekly triage.",
|
|
626
|
-
harness: Harness.NATIVE,
|
|
627
|
-
workspaceEntries: WORKSPACE_ENTRIES,
|
|
628
|
-
environmentRefs: [
|
|
629
|
-
{ org: "acme", slug: "prod", kind: ApiResourceKind.environment },
|
|
630
|
-
],
|
|
631
|
-
runConfig: RUN_CONFIG,
|
|
632
|
-
},
|
|
633
|
-
},
|
|
634
|
-
},
|
|
635
|
-
});
|
|
636
|
-
it("fixture covers every ScheduleSpec field (schema tripwire)", () => {
|
|
637
|
-
assertFixtureCoversSpec(ScheduleSpecSchema, fixture().spec);
|
|
638
|
-
});
|
|
639
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
640
|
-
const original = fixture();
|
|
641
|
-
assertSpecRoundTrip(ScheduleSpecSchema, original, buildScheduleProto(toScheduleUpdateInput(original)));
|
|
642
|
-
});
|
|
643
|
-
});
|
|
644
|
-
describe("toSessionUpdateInput", () => {
|
|
645
|
-
const fixture = () => create(SessionSchema, {
|
|
646
|
-
metadata: META,
|
|
647
|
-
spec: {
|
|
648
|
-
agentInstanceId: "inst-1",
|
|
649
|
-
subject: "Fix the flaky test",
|
|
650
|
-
harnessStateId: "hs-1",
|
|
651
|
-
harnessStateIdHistory: ["hs-0"],
|
|
652
|
-
metadata: { "stigmer.ai/context": "embedded" },
|
|
653
|
-
workspaceEntries: WORKSPACE_ENTRIES,
|
|
654
|
-
mcpServerUsages: [MCP_USAGE],
|
|
655
|
-
skillRefs: [
|
|
656
|
-
{ org: "acme", slug: "triage", version: "v2", kind: ApiResourceKind.skill },
|
|
657
|
-
],
|
|
658
|
-
harness: Harness.CURSOR,
|
|
659
|
-
cursorMode: CursorMode.CLOUD,
|
|
660
|
-
executionTarget: ExecutionTarget.CLOUD,
|
|
661
|
-
},
|
|
662
|
-
});
|
|
663
|
-
it("fixture covers every SessionSpec field (schema tripwire)", () => {
|
|
664
|
-
assertFixtureCoversSpec(SessionSpecSchema, fixture().spec);
|
|
665
|
-
});
|
|
666
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
667
|
-
const original = fixture();
|
|
668
|
-
assertSpecRoundTrip(SessionSpecSchema, original, buildSessionProto(toSessionUpdateInput(original)));
|
|
669
|
-
});
|
|
670
|
-
it("preserves harness state history when only the subject changes (hand-written mapper gap)", () => {
|
|
671
|
-
const original = fixture();
|
|
672
|
-
const rebuilt = buildSessionProto({
|
|
673
|
-
...toSessionUpdateInput(original),
|
|
674
|
-
subject: "New subject",
|
|
675
|
-
});
|
|
676
|
-
expect(rebuilt.spec?.harnessStateIdHistory).toEqual(["hs-0"]);
|
|
677
|
-
expect(rebuilt.spec?.subject).toBe("New subject");
|
|
678
|
-
});
|
|
679
|
-
});
|
|
680
|
-
describe("toWorkflowUpdateInput", () => {
|
|
681
|
-
const fixture = () => create(WorkflowSchema, {
|
|
682
|
-
metadata: META,
|
|
683
|
-
spec: {
|
|
684
|
-
description: "Nightly triage.",
|
|
685
|
-
document: {
|
|
686
|
-
dsl: "1.0",
|
|
687
|
-
namespace: "acme",
|
|
688
|
-
name: "nightly-triage",
|
|
689
|
-
version: "0.2.0",
|
|
690
|
-
description: "Runs every night.",
|
|
691
|
-
},
|
|
692
|
-
tasks: [
|
|
693
|
-
{
|
|
694
|
-
name: "call-api",
|
|
695
|
-
kind: WorkflowTaskKind.http_call,
|
|
696
|
-
taskConfig: { url: "https://api.acme.example/tickets" },
|
|
697
|
-
export: { as: "tickets" },
|
|
698
|
-
flow: { then: "triage" },
|
|
699
|
-
compensate: [
|
|
700
|
-
{
|
|
701
|
-
name: "undo",
|
|
702
|
-
kind: WorkflowTaskKind.set_vars,
|
|
703
|
-
taskConfig: { variables: { rolledBack: true } },
|
|
704
|
-
},
|
|
705
|
-
],
|
|
706
|
-
},
|
|
707
|
-
],
|
|
708
|
-
env: { API_KEY: { isSecret: true, description: "Vendor key", optional: true } },
|
|
709
|
-
budget: {
|
|
710
|
-
maxCostMicros: 5000000n,
|
|
711
|
-
maxTotalTokens: 2000000n,
|
|
712
|
-
maxDurationSeconds: 1800,
|
|
713
|
-
onExceeded: BudgetExceededPolicy.budget_exceeded_human_review,
|
|
714
|
-
},
|
|
715
|
-
},
|
|
716
|
-
});
|
|
717
|
-
it("fixture covers every WorkflowSpec field (schema tripwire)", () => {
|
|
718
|
-
assertFixtureCoversSpec(WorkflowSpecSchema, fixture().spec);
|
|
719
|
-
});
|
|
720
|
-
it("round-trips the full spec (recursive tasks, bigint budget) through the builder", () => {
|
|
721
|
-
const original = fixture();
|
|
722
|
-
assertSpecRoundTrip(WorkflowSpecSchema, original, buildWorkflowProto(toWorkflowUpdateInput(original)));
|
|
723
|
-
});
|
|
724
|
-
});
|
|
725
|
-
describe("toWorkflowExecutionUpdateInput", () => {
|
|
726
|
-
const fixture = () => create(WorkflowExecutionSchema, {
|
|
727
|
-
metadata: META,
|
|
728
|
-
spec: {
|
|
729
|
-
workflowInstanceId: "wfi-1",
|
|
730
|
-
workflowId: "wf-1",
|
|
731
|
-
triggerMessage: "Manual run.",
|
|
732
|
-
triggerMetadata: { source: "console" },
|
|
733
|
-
runtimeEnv: { TOKEN: { value: "shh", isSecret: true } },
|
|
734
|
-
callbackToken: new Uint8Array([9, 8, 7]),
|
|
735
|
-
executionTarget: ExecutionTarget.CLOUD,
|
|
736
|
-
},
|
|
737
|
-
});
|
|
738
|
-
it("fixture covers every WorkflowExecutionSpec field (schema tripwire)", () => {
|
|
739
|
-
assertFixtureCoversSpec(WorkflowExecutionSpecSchema, fixture().spec);
|
|
740
|
-
});
|
|
741
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
742
|
-
const original = fixture();
|
|
743
|
-
assertSpecRoundTrip(WorkflowExecutionSpecSchema, original, buildWorkflowExecutionProto(toWorkflowExecutionUpdateInput(original)));
|
|
744
|
-
});
|
|
745
|
-
});
|
|
746
|
-
describe("toWorkflowInstanceUpdateInput", () => {
|
|
747
|
-
const fixture = () => create(WorkflowInstanceSchema, {
|
|
748
|
-
metadata: META,
|
|
749
|
-
spec: {
|
|
750
|
-
workflowId: "wf-1",
|
|
751
|
-
description: "Prod instance.",
|
|
752
|
-
environmentRefs: [
|
|
753
|
-
{ org: "acme", slug: "prod", kind: ApiResourceKind.environment },
|
|
754
|
-
],
|
|
755
|
-
executionVisibility: WorkflowExecutionVisibility.organization,
|
|
756
|
-
},
|
|
757
|
-
});
|
|
758
|
-
it("fixture covers every WorkflowInstanceSpec field (schema tripwire)", () => {
|
|
759
|
-
assertFixtureCoversSpec(WorkflowInstanceSpecSchema, fixture().spec);
|
|
760
|
-
});
|
|
761
|
-
it("round-trips the full spec and metadata through the builder", () => {
|
|
762
|
-
const original = fixture();
|
|
763
|
-
assertSpecRoundTrip(WorkflowInstanceSpecSchema, original, buildWorkflowInstanceProto(toWorkflowInstanceUpdateInput(original)));
|
|
764
|
-
});
|
|
765
|
-
it("preserves execution_visibility when only environments change (live wipe bug)", () => {
|
|
766
|
-
const original = fixture();
|
|
767
|
-
const rebuilt = buildWorkflowInstanceProto({
|
|
768
|
-
...toWorkflowInstanceUpdateInput(original),
|
|
769
|
-
environmentRefs: [{ org: "acme", slug: "staging", kind: ApiResourceKind.environment }],
|
|
770
|
-
});
|
|
771
|
-
expect(rebuilt.spec?.executionVisibility).toBe(WorkflowExecutionVisibility.organization);
|
|
772
|
-
expect(rebuilt.spec?.environmentRefs.map((r) => r.slug)).toEqual(["staging"]);
|
|
773
|
-
});
|
|
774
|
-
});
|
|
775
|
-
//# sourceMappingURL=update-input-roundtrip.test.js.map
|