@stigmer/sdk 3.35.0 → 3.37.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 +6 -0
- package/iam-principal.d.ts.map +1 -1
- package/iam-principal.js +19 -0
- 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 +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +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/src/iam-principal.ts +24 -0
- package/src/index.ts +1 -0
- 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,250 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { create, toJson } from "@bufbuild/protobuf";
|
|
3
|
-
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
4
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
5
|
-
import {
|
|
6
|
-
OrganizationSchema,
|
|
7
|
-
type Organization,
|
|
8
|
-
} from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/api_pb";
|
|
9
|
-
import { OrganizationSpecSchema } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/spec_pb";
|
|
10
|
-
import { ManagementMode } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/enum_pb";
|
|
11
|
-
import {
|
|
12
|
-
IdentityAccountSchema,
|
|
13
|
-
type IdentityAccount,
|
|
14
|
-
} from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
15
|
-
import { IdentityAccountSpecSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/spec_pb";
|
|
16
|
-
import { IdentityAccountProvisioningMode } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/enum_pb";
|
|
17
|
-
import {
|
|
18
|
-
buildOrganizationProto,
|
|
19
|
-
toOrganizationUpdateInput,
|
|
20
|
-
} from "../gen/organization";
|
|
21
|
-
import {
|
|
22
|
-
buildIdentityAccountProto,
|
|
23
|
-
toIdentityAccountUpdateInput,
|
|
24
|
-
} from "../gen/identityaccount";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Update RPCs are full-spec replacements, so a complete mapper must
|
|
28
|
-
* round-trip EVERY mutable field of a loaded resource through the generated
|
|
29
|
-
* builder without loss. These tests pin that contract: fully-populated
|
|
30
|
-
* resource → mapper → builder → spec (as JSON, defaults omitted) deep-equals
|
|
31
|
-
* the original. If a mapper drops a field, the wipe-bug class is back.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
function fullOrganization(): Organization {
|
|
35
|
-
return create(OrganizationSchema, {
|
|
36
|
-
apiVersion: "tenancy.stigmer.ai/v1",
|
|
37
|
-
kind: "Organization",
|
|
38
|
-
metadata: {
|
|
39
|
-
id: "acme",
|
|
40
|
-
name: "Acme Corp",
|
|
41
|
-
slug: "acme",
|
|
42
|
-
org: "acme",
|
|
43
|
-
labels: { tier: "gold" },
|
|
44
|
-
visibility: ApiResourceVisibility.visibility_private,
|
|
45
|
-
},
|
|
46
|
-
spec: {
|
|
47
|
-
description: "We make everything.",
|
|
48
|
-
logoUrl: "https://acme.example/logo.png",
|
|
49
|
-
managementMode: ManagementMode.self_managed,
|
|
50
|
-
identityProviderRef: {
|
|
51
|
-
org: "acme",
|
|
52
|
-
slug: "acme-okta",
|
|
53
|
-
kind: ApiResourceKind.identity_provider,
|
|
54
|
-
},
|
|
55
|
-
externalOrgId: "ext-org-1",
|
|
56
|
-
isPersonal: true,
|
|
57
|
-
preferences: { standingContext: "We deploy to us-east-1." },
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function fullIdentityAccount(): IdentityAccount {
|
|
63
|
-
return create(IdentityAccountSchema, {
|
|
64
|
-
apiVersion: "iam.stigmer.ai/v1",
|
|
65
|
-
kind: "IdentityAccount",
|
|
66
|
-
metadata: {
|
|
67
|
-
id: "ia-123",
|
|
68
|
-
name: "Ada Lovelace",
|
|
69
|
-
slug: "ada-lovelace",
|
|
70
|
-
org: "acme",
|
|
71
|
-
labels: { team: "platform" },
|
|
72
|
-
visibility: ApiResourceVisibility.visibility_private,
|
|
73
|
-
},
|
|
74
|
-
spec: {
|
|
75
|
-
idpId: "auth0|abc123",
|
|
76
|
-
email: "ada@acme.example",
|
|
77
|
-
firstName: "Ada",
|
|
78
|
-
lastName: "Lovelace",
|
|
79
|
-
pictureUrl: "https://acme.example/ada.png",
|
|
80
|
-
isMachineAccount: true,
|
|
81
|
-
provisioningMode: IdentityAccountProvisioningMode.federated,
|
|
82
|
-
identityProviderRef: { org: "acme", slug: "acme-okta" },
|
|
83
|
-
preferences: {
|
|
84
|
-
standingContext: "Keep answers terse.",
|
|
85
|
-
defaultHarness: "cursor",
|
|
86
|
-
defaultNativeModel: "claude-sonnet-4.6",
|
|
87
|
-
defaultCursorModel: "composer-2.5",
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
describe("toOrganizationUpdateInput", () => {
|
|
94
|
-
it("round-trips a fully-populated organization spec through the builder", () => {
|
|
95
|
-
const org = fullOrganization();
|
|
96
|
-
|
|
97
|
-
const built = buildOrganizationProto(toOrganizationUpdateInput(org));
|
|
98
|
-
|
|
99
|
-
expect(toJson(OrganizationSpecSchema, built.spec!)).toEqual(
|
|
100
|
-
toJson(OrganizationSpecSchema, org.spec!),
|
|
101
|
-
);
|
|
102
|
-
expect(built.metadata?.name).toBe("Acme Corp");
|
|
103
|
-
expect(built.metadata?.slug).toBe("acme");
|
|
104
|
-
expect(built.metadata?.org).toBe("acme");
|
|
105
|
-
expect(built.metadata?.labels).toEqual({ tier: "gold" });
|
|
106
|
-
expect(built.metadata?.visibility).toBe(
|
|
107
|
-
ApiResourceVisibility.visibility_private,
|
|
108
|
-
);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it("preserves preferences when a caller overrides only profile fields (the wipe-bug class)", () => {
|
|
112
|
-
const org = fullOrganization();
|
|
113
|
-
|
|
114
|
-
const built = buildOrganizationProto({
|
|
115
|
-
...toOrganizationUpdateInput(org),
|
|
116
|
-
description: "New description",
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
expect(built.spec?.preferences?.standingContext).toBe(
|
|
120
|
-
"We deploy to us-east-1.",
|
|
121
|
-
);
|
|
122
|
-
expect(built.spec?.description).toBe("New description");
|
|
123
|
-
expect(built.spec?.logoUrl).toBe("https://acme.example/logo.png");
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it("maps an empty spec without inventing values", () => {
|
|
127
|
-
const org = create(OrganizationSchema, {
|
|
128
|
-
metadata: { name: "Bare", slug: "bare", org: "bare" },
|
|
129
|
-
spec: {},
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
const built = buildOrganizationProto(toOrganizationUpdateInput(org));
|
|
133
|
-
|
|
134
|
-
expect(toJson(OrganizationSpecSchema, built.spec!)).toEqual({});
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it("falls back to the slug when metadata.org is empty", () => {
|
|
138
|
-
const org = create(OrganizationSchema, {
|
|
139
|
-
metadata: { name: "Bare", slug: "bare" },
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
expect(toOrganizationUpdateInput(org).org).toBe("bare");
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
it("carries metadata.id for exact update addressing", () => {
|
|
146
|
-
const built = buildOrganizationProto(
|
|
147
|
-
toOrganizationUpdateInput(fullOrganization()),
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
expect(built.metadata?.id).toBe("acme");
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
describe("toIdentityAccountUpdateInput", () => {
|
|
155
|
-
it("round-trips a fully-populated identity account spec through the builder", () => {
|
|
156
|
-
const account = fullIdentityAccount();
|
|
157
|
-
|
|
158
|
-
const built = buildIdentityAccountProto(
|
|
159
|
-
toIdentityAccountUpdateInput(account),
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
expect(toJson(IdentityAccountSpecSchema, built.spec!)).toEqual(
|
|
163
|
-
toJson(IdentityAccountSpecSchema, account.spec!),
|
|
164
|
-
);
|
|
165
|
-
expect(built.metadata?.name).toBe("Ada Lovelace");
|
|
166
|
-
expect(built.metadata?.labels).toEqual({ team: "platform" });
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
it("carries org and slug — the update pipeline's fallback address", () => {
|
|
170
|
-
const input = toIdentityAccountUpdateInput(fullIdentityAccount());
|
|
171
|
-
|
|
172
|
-
expect(input.org).toBe("acme");
|
|
173
|
-
expect(input.slug).toBe("ada-lovelace");
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
it("carries metadata.id — the ONLY address that works for a real (org-less) account", () => {
|
|
177
|
-
// Identity accounts are platform-scoped: metadata.org is never set in
|
|
178
|
-
// production, so the pipeline's org+slug fallback structurally cannot
|
|
179
|
-
// match one. Without the id, this update is NOT_FOUND by construction.
|
|
180
|
-
const account = create(IdentityAccountSchema, {
|
|
181
|
-
metadata: {
|
|
182
|
-
id: "ida_01JEXAMPLE",
|
|
183
|
-
name: "ada@acme.example",
|
|
184
|
-
slug: "ada-acme-example",
|
|
185
|
-
},
|
|
186
|
-
spec: { idpId: "auth0|abc123" },
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
const built = buildIdentityAccountProto(
|
|
190
|
-
toIdentityAccountUpdateInput(account),
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
expect(built.metadata?.id).toBe("ida_01JEXAMPLE");
|
|
194
|
-
expect(built.metadata?.slug).toBe("ada-acme-example");
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
it("preserves the rest of the spec when a caller overrides only preferences", () => {
|
|
198
|
-
const account = fullIdentityAccount();
|
|
199
|
-
const mapped = toIdentityAccountUpdateInput(account);
|
|
200
|
-
|
|
201
|
-
const built = buildIdentityAccountProto({
|
|
202
|
-
...mapped,
|
|
203
|
-
preferences: { ...mapped.preferences, standingContext: "Prefer bullet points." },
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
expect(built.spec?.preferences?.standingContext).toBe(
|
|
207
|
-
"Prefer bullet points.",
|
|
208
|
-
);
|
|
209
|
-
expect(built.spec?.email).toBe("ada@acme.example");
|
|
210
|
-
expect(built.spec?.idpId).toBe("auth0|abc123");
|
|
211
|
-
expect(built.spec?.provisioningMode).toBe(
|
|
212
|
-
IdentityAccountProvisioningMode.federated,
|
|
213
|
-
);
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
it("preserves structured defaults when only standing context is edited (nested wipe-bug class)", () => {
|
|
217
|
-
const account = fullIdentityAccount();
|
|
218
|
-
const mapped = toIdentityAccountUpdateInput(account);
|
|
219
|
-
|
|
220
|
-
// The correct editor pattern for a nested message: spread the mapper's
|
|
221
|
-
// COMPLETE preferences and override only the edited field. A bare
|
|
222
|
-
// `preferences: { standingContext }` literal would wipe the structured
|
|
223
|
-
// defaults — the session-4 wipe bug recurring one level down.
|
|
224
|
-
const built = buildIdentityAccountProto({
|
|
225
|
-
...mapped,
|
|
226
|
-
preferences: { ...mapped.preferences, standingContext: "Terser still." },
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
expect(built.spec?.preferences?.standingContext).toBe("Terser still.");
|
|
230
|
-
expect(built.spec?.preferences?.defaultHarness).toBe("cursor");
|
|
231
|
-
expect(built.spec?.preferences?.defaultNativeModel).toBe("claude-sonnet-4.6");
|
|
232
|
-
expect(built.spec?.preferences?.defaultCursorModel).toBe("composer-2.5");
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
it("clears standing context to wire-absent when the text is emptied", () => {
|
|
236
|
-
const account = fullIdentityAccount();
|
|
237
|
-
const mapped = toIdentityAccountUpdateInput(account);
|
|
238
|
-
|
|
239
|
-
const built = buildIdentityAccountProto({
|
|
240
|
-
...mapped,
|
|
241
|
-
preferences: { ...mapped.preferences, standingContext: "" },
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
// Proto3 empty string is the field default — wire-identical to absent,
|
|
245
|
-
// which the server compose steps treat as "no preference declared".
|
|
246
|
-
expect(built.spec?.preferences?.standingContext ?? "").toBe("");
|
|
247
|
-
// Clearing one field never disturbs its siblings.
|
|
248
|
-
expect(built.spec?.preferences?.defaultHarness).toBe("cursor");
|
|
249
|
-
});
|
|
250
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
ApprovalPolicySource,
|
|
4
|
-
describeApprovalPolicySource,
|
|
5
|
-
isInformativePolicySource,
|
|
6
|
-
} from "../approval-provenance";
|
|
7
|
-
|
|
8
|
-
describe("describeApprovalPolicySource", () => {
|
|
9
|
-
it("maps each known source to a stable human phrase", () => {
|
|
10
|
-
expect(describeApprovalPolicySource(ApprovalPolicySource.CLASSIFIER_DEFAULT)).toBe(
|
|
11
|
-
"required by the tool's default policy",
|
|
12
|
-
);
|
|
13
|
-
expect(describeApprovalPolicySource(ApprovalPolicySource.BUILTIN_CATEGORY)).toBe(
|
|
14
|
-
"required by built-in tool policy",
|
|
15
|
-
);
|
|
16
|
-
expect(describeApprovalPolicySource(ApprovalPolicySource.AGENT_OVERRIDE)).toBe(
|
|
17
|
-
"required by agent override",
|
|
18
|
-
);
|
|
19
|
-
expect(
|
|
20
|
-
describeApprovalPolicySource(ApprovalPolicySource.ANNOTATION_DESTRUCTIVE_TIGHTEN),
|
|
21
|
-
).toBe("required: marked destructive by the server");
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it("returns null for UNSPECIFIED (legacy / ungated)", () => {
|
|
25
|
-
expect(describeApprovalPolicySource(ApprovalPolicySource.UNSPECIFIED)).toBeNull();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe("isInformativePolicySource", () => {
|
|
30
|
-
it("suppresses the everyday default gating reasons", () => {
|
|
31
|
-
// These add nothing beyond "this tool needs approval" — noise at the gate.
|
|
32
|
-
expect(isInformativePolicySource(ApprovalPolicySource.CLASSIFIER_DEFAULT)).toBe(false);
|
|
33
|
-
expect(isInformativePolicySource(ApprovalPolicySource.BUILTIN_CATEGORY)).toBe(false);
|
|
34
|
-
expect(isInformativePolicySource(ApprovalPolicySource.UNSPECIFIED)).toBe(false);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it("surfaces reasons that change the user's understanding of the gate", () => {
|
|
38
|
-
expect(isInformativePolicySource(ApprovalPolicySource.PINNED_OVERRIDE)).toBe(true);
|
|
39
|
-
expect(isInformativePolicySource(ApprovalPolicySource.AGENT_OVERRIDE)).toBe(true);
|
|
40
|
-
expect(
|
|
41
|
-
isInformativePolicySource(ApprovalPolicySource.ANNOTATION_DESTRUCTIVE_TIGHTEN),
|
|
42
|
-
).toBe(true);
|
|
43
|
-
expect(isInformativePolicySource(ApprovalPolicySource.AUTO_APPROVE_ALL)).toBe(true);
|
|
44
|
-
expect(isInformativePolicySource(ApprovalPolicySource.APPROVAL_LEASE)).toBe(true);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("only surfaces a reason that also has a phrase to show", () => {
|
|
48
|
-
// The card renders `isInformative(source) && describe(source) != null`; the
|
|
49
|
-
// two must never disagree for a surfaced source.
|
|
50
|
-
for (const source of [
|
|
51
|
-
ApprovalPolicySource.PINNED_OVERRIDE,
|
|
52
|
-
ApprovalPolicySource.AGENT_OVERRIDE,
|
|
53
|
-
ApprovalPolicySource.ANNOTATION_DESTRUCTIVE_TIGHTEN,
|
|
54
|
-
ApprovalPolicySource.AUTO_APPROVE_ALL,
|
|
55
|
-
ApprovalPolicySource.APPROVAL_LEASE,
|
|
56
|
-
]) {
|
|
57
|
-
expect(describeApprovalPolicySource(source)).not.toBeNull();
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// Cross-edition parity lock for the file-review projection.
|
|
2
|
-
//
|
|
3
|
-
// The Go (`FileChangeSetProjector` / project.go) and Java (`FileChangeSetProjector`)
|
|
4
|
-
// projectors replay the shared corpus at apis/testdata/hitl/file-review/*.json.
|
|
5
|
-
// This test replays the SAME corpus against the TypeScript fold, so a drift
|
|
6
|
-
// between the SDK and either backend fails here rather than shipping.
|
|
7
|
-
//
|
|
8
|
-
// The corpus `expected` is the server (actionable) projection, which is empty
|
|
9
|
-
// for a terminal execution. The SDK's display fold intentionally has no terminal
|
|
10
|
-
// gate, so to reproduce the server contract exactly this test applies the phase
|
|
11
|
-
// gate the accessor's callers apply: isTerminalPhase(phase) ? [] : fold(stream).
|
|
12
|
-
// That both proves parity for non-terminal vectors AND pins the terminal-empty
|
|
13
|
-
// vector — the one place the SDK deliberately differs is covered by the accessor
|
|
14
|
-
// test in file-review-fold.test.ts, not here.
|
|
15
|
-
|
|
16
|
-
import { readFileSync, readdirSync } from "node:fs";
|
|
17
|
-
import { fileURLToPath } from "node:url";
|
|
18
|
-
import { dirname, resolve } from "node:path";
|
|
19
|
-
import { describe, it, expect } from "vitest";
|
|
20
|
-
import { create, fromJson, type JsonValue } from "@bufbuild/protobuf";
|
|
21
|
-
import {
|
|
22
|
-
FileReviewEventSchema,
|
|
23
|
-
FileReviewEventStreamSchema,
|
|
24
|
-
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/filereview_pb";
|
|
25
|
-
import {
|
|
26
|
-
ExecutionPhase,
|
|
27
|
-
FileChangeSetStatus,
|
|
28
|
-
} from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
29
|
-
import { foldFileReviewEventStream } from "../file-review-fold";
|
|
30
|
-
import { isTerminalPhase } from "../execution-phases";
|
|
31
|
-
|
|
32
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
33
|
-
// sdk/typescript/src/execution/__tests__ -> repo root is five levels up.
|
|
34
|
-
const corpusDir = resolve(here, "../../../../../apis/testdata/hitl/file-review");
|
|
35
|
-
|
|
36
|
-
/** The `expected` summary shape each vector pins (see the corpus README). */
|
|
37
|
-
interface ExpectedSet {
|
|
38
|
-
id: string;
|
|
39
|
-
status: string; // full proto enum name, e.g. FILE_CHANGE_SET_STATUS_DECIDED
|
|
40
|
-
change_ids?: string[];
|
|
41
|
-
decision_count?: number;
|
|
42
|
-
aggregate_digest?: string;
|
|
43
|
-
has_approved_snapshot?: boolean;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
interface Vector {
|
|
47
|
-
name: string;
|
|
48
|
-
description?: string;
|
|
49
|
-
execution_id: string;
|
|
50
|
-
phase: string;
|
|
51
|
-
events: JsonValue[];
|
|
52
|
-
expected: ExpectedSet[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function statusFromName(name: string): FileChangeSetStatus {
|
|
56
|
-
const key = name.replace(
|
|
57
|
-
/^FILE_CHANGE_SET_STATUS_/,
|
|
58
|
-
"",
|
|
59
|
-
) as keyof typeof FileChangeSetStatus;
|
|
60
|
-
const value = FileChangeSetStatus[key];
|
|
61
|
-
if (typeof value !== "number") {
|
|
62
|
-
throw new Error(`unknown FileChangeSetStatus in corpus: ${name}`);
|
|
63
|
-
}
|
|
64
|
-
return value;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function phaseFromName(name: string): ExecutionPhase {
|
|
68
|
-
const value = ExecutionPhase[name as keyof typeof ExecutionPhase];
|
|
69
|
-
if (typeof value !== "number") {
|
|
70
|
-
throw new Error(`unknown ExecutionPhase in corpus: ${name}`);
|
|
71
|
-
}
|
|
72
|
-
return value;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const vectorFiles = readdirSync(corpusDir).filter(
|
|
76
|
-
(f) => f.endsWith(".json") && f !== "schema.json",
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
describe("file-review fold — cross-edition corpus parity", () => {
|
|
80
|
-
it("finds the corpus vectors", () => {
|
|
81
|
-
expect(vectorFiles.length).toBeGreaterThan(0);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
for (const file of vectorFiles) {
|
|
85
|
-
const vector = JSON.parse(
|
|
86
|
-
readFileSync(resolve(corpusDir, file), "utf8"),
|
|
87
|
-
) as Vector;
|
|
88
|
-
|
|
89
|
-
it(`${file}: ${vector.name}`, () => {
|
|
90
|
-
// Decode each event with the generated schema so a malformed fixture fails
|
|
91
|
-
// loudly (matching the backend corpus drivers), then build the stream.
|
|
92
|
-
const events = vector.events.map((ev) =>
|
|
93
|
-
fromJson(FileReviewEventSchema, ev),
|
|
94
|
-
);
|
|
95
|
-
const stream = create(FileReviewEventStreamSchema, {
|
|
96
|
-
executionId: vector.execution_id,
|
|
97
|
-
events,
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
const phase = phaseFromName(vector.phase);
|
|
101
|
-
// Reproduce the server's actionable projection: phase-gated fold.
|
|
102
|
-
const projected = isTerminalPhase(phase)
|
|
103
|
-
? []
|
|
104
|
-
: foldFileReviewEventStream(stream);
|
|
105
|
-
|
|
106
|
-
const actual = projected.map((set) => ({
|
|
107
|
-
id: set.id,
|
|
108
|
-
status: set.status,
|
|
109
|
-
change_ids: set.changes.map((c) => c.id),
|
|
110
|
-
decision_count: set.decisions.length,
|
|
111
|
-
aggregate_digest: set.aggregateDigest,
|
|
112
|
-
has_approved_snapshot: set.approvedSnapshot !== undefined,
|
|
113
|
-
}));
|
|
114
|
-
|
|
115
|
-
const expected = vector.expected.map((e) => ({
|
|
116
|
-
id: e.id,
|
|
117
|
-
status: statusFromName(e.status),
|
|
118
|
-
change_ids: e.change_ids ?? [],
|
|
119
|
-
decision_count: e.decision_count ?? 0,
|
|
120
|
-
aggregate_digest: e.aggregate_digest ?? "",
|
|
121
|
-
has_approved_snapshot: e.has_approved_snapshot ?? false,
|
|
122
|
-
}));
|
|
123
|
-
|
|
124
|
-
expect(actual).toEqual(expected);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
});
|