@stigmer/server 3.23.0 → 3.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authorization/authorizer.d.ts +4 -8
- package/dist/authorization/authorizer.d.ts.map +1 -1
- package/dist/authorization/authorizer.js +5 -9
- package/dist/authorization/authorizer.js.map +1 -1
- package/dist/authorization/derived-tuples.d.ts.map +1 -1
- package/dist/authorization/derived-tuples.js +10 -25
- package/dist/authorization/derived-tuples.js.map +1 -1
- package/dist/authorization/evaluator.d.ts +7 -8
- package/dist/authorization/evaluator.d.ts.map +1 -1
- package/dist/authorization/evaluator.js +4 -20
- package/dist/authorization/evaluator.js.map +1 -1
- package/dist/authorization/list-read-scope.d.ts.map +1 -1
- package/dist/authorization/list-read-scope.js +5 -9
- package/dist/authorization/list-read-scope.js.map +1 -1
- package/dist/authorization/model/agent.d.ts.map +1 -1
- package/dist/authorization/model/agent.js +4 -5
- package/dist/authorization/model/agent.js.map +1 -1
- package/dist/authorization/model/agent_instance.d.ts.map +1 -1
- package/dist/authorization/model/agent_instance.js +2 -2
- package/dist/authorization/model/agent_instance.js.map +1 -1
- package/dist/authorization/model/mcp_server.d.ts.map +1 -1
- package/dist/authorization/model/mcp_server.js +2 -2
- package/dist/authorization/model/mcp_server.js.map +1 -1
- package/dist/authorization/model/plugin.d.ts.map +1 -1
- package/dist/authorization/model/plugin.js +3 -4
- package/dist/authorization/model/plugin.js.map +1 -1
- package/dist/authorization/model/rewrite.d.ts +8 -10
- package/dist/authorization/model/rewrite.d.ts.map +1 -1
- package/dist/authorization/model/rewrite.js +0 -3
- package/dist/authorization/model/rewrite.js.map +1 -1
- package/dist/authorization/model/skill.d.ts.map +1 -1
- package/dist/authorization/model/skill.js +2 -2
- package/dist/authorization/model/skill.js.map +1 -1
- package/dist/authorization/model/workflow.d.ts.map +1 -1
- package/dist/authorization/model/workflow.js +2 -2
- package/dist/authorization/model/workflow.js.map +1 -1
- package/dist/authorization/model/workflow_instance.d.ts.map +1 -1
- package/dist/authorization/model/workflow_instance.js +2 -2
- package/dist/authorization/model/workflow_instance.js.map +1 -1
- package/dist/authorization/organization-directory.d.ts.map +1 -1
- package/dist/authorization/organization-directory.js +2 -3
- package/dist/authorization/organization-directory.js.map +1 -1
- package/dist/authorization/store-test-kit.d.ts +0 -6
- package/dist/authorization/store-test-kit.d.ts.map +1 -1
- package/dist/authorization/store-test-kit.js +16 -62
- package/dist/authorization/store-test-kit.js.map +1 -1
- package/dist/authorization/tuples.d.ts +13 -32
- package/dist/authorization/tuples.d.ts.map +1 -1
- package/dist/authorization/tuples.js +3 -11
- package/dist/authorization/tuples.js.map +1 -1
- package/dist/domain/agent/controller.d.ts.map +1 -1
- package/dist/domain/agent/controller.js +4 -4
- package/dist/domain/agent/controller.js.map +1 -1
- package/dist/domain/agentchannel/controller.d.ts.map +1 -1
- package/dist/domain/agentchannel/controller.js +3 -1
- package/dist/domain/agentchannel/controller.js.map +1 -1
- package/dist/domain/agentexecution/controller.d.ts.map +1 -1
- package/dist/domain/agentexecution/controller.js +3 -1
- package/dist/domain/agentexecution/controller.js.map +1 -1
- package/dist/domain/agentinstance/controller.d.ts.map +1 -1
- package/dist/domain/agentinstance/controller.js +3 -4
- package/dist/domain/agentinstance/controller.js.map +1 -1
- package/dist/domain/agentshare/constants.d.ts +6 -11
- package/dist/domain/agentshare/constants.d.ts.map +1 -1
- package/dist/domain/agentshare/constants.js +8 -16
- package/dist/domain/agentshare/constants.js.map +1 -1
- package/dist/domain/agentshare/controller.d.ts.map +1 -1
- package/dist/domain/agentshare/controller.js +3 -1
- package/dist/domain/agentshare/controller.js.map +1 -1
- package/dist/domain/agentshare/steps.d.ts +18 -25
- package/dist/domain/agentshare/steps.d.ts.map +1 -1
- package/dist/domain/agentshare/steps.js +41 -142
- package/dist/domain/agentshare/steps.js.map +1 -1
- package/dist/domain/environment/controller.d.ts.map +1 -1
- package/dist/domain/environment/controller.js +2 -3
- package/dist/domain/environment/controller.js.map +1 -1
- package/dist/domain/executioncontext/controller.d.ts.map +1 -1
- package/dist/domain/executioncontext/controller.js +2 -1
- package/dist/domain/executioncontext/controller.js.map +1 -1
- package/dist/domain/mcpserver/controller.d.ts.map +1 -1
- package/dist/domain/mcpserver/controller.js +3 -4
- package/dist/domain/mcpserver/controller.js.map +1 -1
- package/dist/domain/plugin/controller.d.ts.map +1 -1
- package/dist/domain/plugin/controller.js +1 -3
- package/dist/domain/plugin/controller.js.map +1 -1
- package/dist/domain/plugin/push.d.ts +7 -5
- package/dist/domain/plugin/push.d.ts.map +1 -1
- package/dist/domain/plugin/push.js +8 -14
- package/dist/domain/plugin/push.js.map +1 -1
- package/dist/domain/schedule/controller.d.ts.map +1 -1
- package/dist/domain/schedule/controller.js +3 -1
- package/dist/domain/schedule/controller.js.map +1 -1
- package/dist/domain/session/controller.d.ts.map +1 -1
- package/dist/domain/session/controller.js +3 -2
- package/dist/domain/session/controller.js.map +1 -1
- package/dist/domain/skill/controller.d.ts.map +1 -1
- package/dist/domain/skill/controller.js +0 -2
- package/dist/domain/skill/controller.js.map +1 -1
- package/dist/domain/workflow/agent-call-references.d.ts +81 -0
- package/dist/domain/workflow/agent-call-references.d.ts.map +1 -0
- package/dist/domain/workflow/agent-call-references.js +117 -0
- package/dist/domain/workflow/agent-call-references.js.map +1 -0
- package/dist/domain/workflow/controller.d.ts.map +1 -1
- package/dist/domain/workflow/controller.js +14 -6
- package/dist/domain/workflow/controller.js.map +1 -1
- package/dist/domain/workflow/registry/data/task-kind-registry.json +3 -3
- package/dist/domain/workflow/validation/task-config-constraints.d.ts +10 -1
- package/dist/domain/workflow/validation/task-config-constraints.d.ts.map +1 -1
- package/dist/domain/workflow/validation/task-config-constraints.js +3 -2
- package/dist/domain/workflow/validation/task-config-constraints.js.map +1 -1
- package/dist/domain/workflowexecution/controller.d.ts.map +1 -1
- package/dist/domain/workflowexecution/controller.js +4 -2
- package/dist/domain/workflowexecution/controller.js.map +1 -1
- package/dist/domain/workflowinstance/controller.d.ts.map +1 -1
- package/dist/domain/workflowinstance/controller.js +3 -4
- package/dist/domain/workflowinstance/controller.js.map +1 -1
- package/dist/extensions/authorization-queries.d.ts +6 -5
- package/dist/extensions/authorization-queries.d.ts.map +1 -1
- package/dist/extensions/list-read-scope.d.ts +1 -1
- package/dist/extensions/resource-authorization.d.ts +3 -2
- package/dist/extensions/resource-authorization.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pipeline/apiresource-labels.d.ts +10 -9
- package/dist/pipeline/apiresource-labels.d.ts.map +1 -1
- package/dist/pipeline/apiresource-labels.js +10 -9
- package/dist/pipeline/apiresource-labels.js.map +1 -1
- package/dist/pipeline/apiresource-meta.d.ts +12 -3
- package/dist/pipeline/apiresource-meta.d.ts.map +1 -1
- package/dist/pipeline/apiresource-meta.js +21 -10
- package/dist/pipeline/apiresource-meta.js.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.d.ts +9 -3
- package/dist/pipeline/steps/authorization-tuples.d.ts.map +1 -1
- package/dist/pipeline/steps/authorization-tuples.js +9 -11
- package/dist/pipeline/steps/authorization-tuples.js.map +1 -1
- package/dist/pipeline/steps/references.d.ts +204 -20
- package/dist/pipeline/steps/references.d.ts.map +1 -1
- package/dist/pipeline/steps/references.js +356 -43
- package/dist/pipeline/steps/references.js.map +1 -1
- package/dist/query/search/controller.js +0 -1
- package/dist/query/search/controller.js.map +1 -1
- package/dist/query/search/criteria.d.ts +1 -5
- package/dist/query/search/criteria.d.ts.map +1 -1
- package/dist/query/search/criteria.js +3 -13
- package/dist/query/search/criteria.js.map +1 -1
- package/dist/query/search/handler.d.ts +5 -4
- package/dist/query/search/handler.d.ts.map +1 -1
- package/dist/query/search/handler.js +7 -6
- package/dist/query/search/handler.js.map +1 -1
- package/dist/query/search/query-store.d.ts.map +1 -1
- package/dist/query/search/query-store.js +0 -2
- package/dist/query/search/query-store.js.map +1 -1
- package/dist/store/interface.d.ts +3 -6
- package/dist/store/interface.d.ts.map +1 -1
- package/dist/store/interface.js.map +1 -1
- package/dist/store/postgres/migrations.d.ts +3 -1
- package/dist/store/postgres/migrations.d.ts.map +1 -1
- package/dist/store/postgres/migrations.js +35 -1
- package/dist/store/postgres/migrations.js.map +1 -1
- package/dist/store/postgres/store.d.ts.map +1 -1
- package/dist/store/postgres/store.js +4 -9
- package/dist/store/postgres/store.js.map +1 -1
- package/dist/store/public-visibility-retired.d.ts +67 -0
- package/dist/store/public-visibility-retired.d.ts.map +1 -0
- package/dist/store/public-visibility-retired.js +55 -0
- package/dist/store/public-visibility-retired.js.map +1 -0
- package/dist/store/sqlite/migrations.d.ts +3 -1
- package/dist/store/sqlite/migrations.d.ts.map +1 -1
- package/dist/store/sqlite/migrations.js +36 -1
- package/dist/store/sqlite/migrations.js.map +1 -1
- package/dist/store/sqlite/store.d.ts.map +1 -1
- package/dist/store/sqlite/store.js +4 -8
- package/dist/store/sqlite/store.js.map +1 -1
- package/package.json +6 -6
- package/src/authorization/README.md +24 -26
- package/src/authorization/__tests__/authorizer.test.ts +10 -9
- package/src/authorization/__tests__/derived-tuples.test.ts +4 -11
- package/src/authorization/__tests__/evaluator.test.ts +14 -73
- package/src/authorization/__tests__/facts.test.ts +2 -2
- package/src/authorization/__tests__/fixtures/fga/agent-instance-creation.fga.yaml +19 -27
- package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +6 -98
- package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +4 -61
- package/src/authorization/__tests__/fixtures/fga/mcp-server-authoring.fga.yaml +1 -15
- package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +1 -21
- package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +1 -25
- package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +1 -3
- package/src/authorization/__tests__/list-read-scope.test.ts +18 -17
- package/src/authorization/__tests__/store-tests.test.ts +2 -6
- package/src/authorization/__tests__/tuples.test.ts +12 -11
- package/src/authorization/authorizer.ts +4 -9
- package/src/authorization/derived-tuples.ts +14 -31
- package/src/authorization/evaluator.ts +8 -44
- package/src/authorization/list-read-scope.ts +5 -11
- package/src/authorization/model/agent.ts +2 -5
- package/src/authorization/model/agent_instance.ts +0 -2
- package/src/authorization/model/mcp_server.ts +0 -2
- package/src/authorization/model/plugin.ts +1 -4
- package/src/authorization/model/rewrite.ts +8 -13
- package/src/authorization/model/skill.ts +0 -2
- package/src/authorization/model/workflow.ts +0 -2
- package/src/authorization/model/workflow_instance.ts +0 -2
- package/src/authorization/organization-directory.ts +1 -3
- package/src/authorization/store-test-kit.ts +16 -75
- package/src/authorization/tuples.ts +16 -39
- package/src/domain/agent/__tests__/agent.test.ts +11 -4
- package/src/domain/agent/controller.ts +7 -7
- package/src/domain/agentchannel/__tests__/agentchannel.test.ts +223 -48
- package/src/domain/agentchannel/controller.ts +6 -1
- package/src/domain/agentexecution/controller.ts +6 -1
- package/src/domain/agentinstance/controller.ts +6 -12
- package/src/domain/agentshare/__tests__/agentshare.test.ts +196 -172
- package/src/domain/agentshare/__tests__/create-authorization.test.ts +16 -31
- package/src/domain/agentshare/constants.ts +14 -26
- package/src/domain/agentshare/controller.ts +6 -1
- package/src/domain/agentshare/steps.ts +41 -194
- package/src/domain/environment/controller.ts +5 -8
- package/src/domain/executioncontext/controller.ts +5 -1
- package/src/domain/mcpserver/__tests__/mcpserver.test.ts +115 -28
- package/src/domain/mcpserver/__tests__/oauth-handshake.test.ts +53 -18
- package/src/domain/mcpserver/controller.ts +6 -12
- package/src/domain/plugin/controller.ts +1 -8
- package/src/domain/plugin/push.ts +8 -16
- package/src/domain/schedule/controller.ts +6 -1
- package/src/domain/session/controller.ts +12 -4
- package/src/domain/skill/controller.ts +0 -7
- package/src/domain/workflow/__tests__/agent-call-references.test.ts +373 -0
- package/src/domain/workflow/agent-call-references.ts +204 -0
- package/src/domain/workflow/controller.ts +28 -10
- package/src/domain/workflow/registry/data/task-kind-registry.json +3 -3
- package/src/domain/workflow/validation/task-config-constraints.ts +7 -3
- package/src/domain/workflowexecution/controller.ts +7 -2
- package/src/domain/workflowinstance/controller.ts +6 -12
- package/src/extensions/__tests__/built-in-authorization-composed.test.ts +32 -19
- package/src/extensions/__tests__/extension-composition.test.ts +4 -4
- package/src/extensions/__tests__/list-read-scope-composed.test.ts +9 -6
- package/src/extensions/authorization-queries.ts +6 -5
- package/src/extensions/list-read-scope.ts +1 -1
- package/src/extensions/resource-authorization.ts +3 -5
- package/src/index.ts +0 -1
- package/src/pipeline/__tests__/supports-visibility.test.ts +112 -0
- package/src/pipeline/apiresource-labels.ts +10 -9
- package/src/pipeline/apiresource-meta.ts +21 -10
- package/src/pipeline/steps/__tests__/authorization-tuples.test.ts +18 -31
- package/src/pipeline/steps/__tests__/references.test.ts +737 -0
- package/src/pipeline/steps/authorization-tuples.ts +9 -11
- package/src/pipeline/steps/references.ts +622 -70
- package/src/query/search/__tests__/criteria.test.ts +0 -4
- package/src/query/search/__tests__/query-store.test.ts +11 -40
- package/src/query/search/controller.ts +0 -1
- package/src/query/search/criteria.ts +0 -14
- package/src/query/search/handler.ts +6 -7
- package/src/query/search/query-store.ts +0 -2
- package/src/store/__tests__/public-visibility-retired.test.ts +127 -0
- package/src/store/__tests__/store-contract.ts +6 -51
- package/src/store/interface.ts +3 -6
- package/src/store/postgres/__tests__/migrations.test.ts +187 -6
- package/src/store/postgres/__tests__/store-contract.test.ts +0 -2
- package/src/store/postgres/migrations.ts +48 -1
- package/src/store/postgres/store.ts +4 -11
- package/src/store/public-visibility-retired.ts +119 -0
- package/src/store/sqlite/__tests__/migrations.test.ts +191 -5
- package/src/store/sqlite/migrations.ts +45 -1
- package/src/store/sqlite/store.ts +4 -10
- package/dist/pipeline/steps/visibility-gates.d.ts +0 -27
- package/dist/pipeline/steps/visibility-gates.d.ts.map +0 -1
- package/dist/pipeline/steps/visibility-gates.js +0 -139
- package/dist/pipeline/steps/visibility-gates.js.map +0 -1
- package/src/authorization/__tests__/fixtures/fga/cross-org-share-creation.fga.yaml +0 -98
- package/src/authorization/__tests__/fixtures/fga/public-visibility-setter.fga.yaml +0 -52
- package/src/pipeline/steps/__tests__/visibility-gates.test.ts +0 -187
- package/src/pipeline/steps/visibility-gates.ts +0 -174
|
@@ -39,7 +39,10 @@ import { ChannelMessageQueryController } from "@stigmer/protos/ai/stigmer/agenti
|
|
|
39
39
|
import { ChannelConversationCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentchannel/v1/conversation_command_pb";
|
|
40
40
|
import { ChannelConversationQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentchannel/v1/conversation_query_pb";
|
|
41
41
|
import { AgentChannelInstallState } from "@stigmer/protos/ai/stigmer/agentic/agentchannel/v1/status_pb";
|
|
42
|
+
import { ChannelAppSchema } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/api_pb";
|
|
43
|
+
import { EnvironmentSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/api_pb";
|
|
42
44
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
45
|
+
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
43
46
|
|
|
44
47
|
import { loadConfig } from "../../../boot/config.js";
|
|
45
48
|
import { composeServer } from "../../../boot/compose.js";
|
|
@@ -59,7 +62,11 @@ import {
|
|
|
59
62
|
sameOrgInvariantMessage,
|
|
60
63
|
} from "../constants.js";
|
|
61
64
|
|
|
62
|
-
const silentLogger = createLogger({
|
|
65
|
+
const silentLogger = createLogger({
|
|
66
|
+
level: "error",
|
|
67
|
+
pretty: false,
|
|
68
|
+
write: () => {},
|
|
69
|
+
});
|
|
63
70
|
|
|
64
71
|
const API_VERSION = "agentic.stigmer.ai/v1";
|
|
65
72
|
const ORG = "channel-test-org";
|
|
@@ -77,7 +84,10 @@ let dir: string;
|
|
|
77
84
|
beforeAll(async () => {
|
|
78
85
|
dir = mkdtempSync(path.join(tmpdir(), "agentchannel-domain-test-"));
|
|
79
86
|
vi.stubEnv("STIGMER_ENCRYPTION_KEY", Buffer.alloc(32, 7).toString("base64"));
|
|
80
|
-
vi.stubEnv(
|
|
87
|
+
vi.stubEnv(
|
|
88
|
+
"STIGMER_RUNNER_TOKEN_KEY",
|
|
89
|
+
Buffer.alloc(32, 8).toString("base64"),
|
|
90
|
+
);
|
|
81
91
|
server = await composeServer({
|
|
82
92
|
config: loadConfig({
|
|
83
93
|
STIGMER_MODEL_REGISTRY_REFRESH: "off",
|
|
@@ -101,10 +111,75 @@ beforeAll(async () => {
|
|
|
101
111
|
agents = createClient(AgentCommandController, transport);
|
|
102
112
|
messageCommand = createClient(ChannelMessageCommandController, transport);
|
|
103
113
|
messageQuery = createClient(ChannelMessageQueryController, transport);
|
|
104
|
-
conversationCommand = createClient(
|
|
105
|
-
|
|
114
|
+
conversationCommand = createClient(
|
|
115
|
+
ChannelConversationCommandController,
|
|
116
|
+
transport,
|
|
117
|
+
);
|
|
118
|
+
conversationQuery = createClient(
|
|
119
|
+
ChannelConversationQueryController,
|
|
120
|
+
transport,
|
|
121
|
+
);
|
|
122
|
+
await seedReferencedRows();
|
|
106
123
|
});
|
|
107
124
|
|
|
125
|
+
/**
|
|
126
|
+
* The environments and channel apps the specs below reference, seeded as
|
|
127
|
+
* rows so the write-time reference rule finds them: a reference to a row
|
|
128
|
+
* that does not exist is refused at create, and these tests are about the
|
|
129
|
+
* binding's shape, not about a missing target.
|
|
130
|
+
*/
|
|
131
|
+
async function seedReferencedRows(): Promise<void> {
|
|
132
|
+
for (const slug of [
|
|
133
|
+
"github-credentials",
|
|
134
|
+
"search-credentials",
|
|
135
|
+
"rotated-credentials",
|
|
136
|
+
]) {
|
|
137
|
+
await server.store.saveResource(
|
|
138
|
+
ApiResourceKind.environment,
|
|
139
|
+
`env_${slug}`,
|
|
140
|
+
EnvironmentSchema,
|
|
141
|
+
create(EnvironmentSchema, {
|
|
142
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
143
|
+
kind: "Environment",
|
|
144
|
+
metadata: {
|
|
145
|
+
id: `env_${slug}`,
|
|
146
|
+
name: slug,
|
|
147
|
+
slug,
|
|
148
|
+
org: ORG,
|
|
149
|
+
visibility: ApiResourceVisibility.visibility_org,
|
|
150
|
+
},
|
|
151
|
+
}),
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
for (const slug of [
|
|
155
|
+
"acme-meta-app",
|
|
156
|
+
"acme-support-app",
|
|
157
|
+
"different-app",
|
|
158
|
+
"first-app",
|
|
159
|
+
"first-meta-app",
|
|
160
|
+
"granted-app",
|
|
161
|
+
"second-app",
|
|
162
|
+
"second-meta-app",
|
|
163
|
+
]) {
|
|
164
|
+
await server.store.saveResource(
|
|
165
|
+
ApiResourceKind.channel_app,
|
|
166
|
+
`chapp_${slug}`,
|
|
167
|
+
ChannelAppSchema,
|
|
168
|
+
create(ChannelAppSchema, {
|
|
169
|
+
apiVersion: "agentic.stigmer.ai/v1",
|
|
170
|
+
kind: "ChannelApp",
|
|
171
|
+
metadata: {
|
|
172
|
+
id: `chapp_${slug}`,
|
|
173
|
+
name: slug,
|
|
174
|
+
slug,
|
|
175
|
+
org: ORG,
|
|
176
|
+
visibility: ApiResourceVisibility.visibility_org,
|
|
177
|
+
},
|
|
178
|
+
}),
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
108
183
|
afterAll(async () => {
|
|
109
184
|
await server.shutdown();
|
|
110
185
|
rmSync(dir, { recursive: true, force: true });
|
|
@@ -117,7 +192,10 @@ function uniqueName(base: string): string {
|
|
|
117
192
|
return `${base} ${counter}`;
|
|
118
193
|
}
|
|
119
194
|
|
|
120
|
-
async function createTestAgent(
|
|
195
|
+
async function createTestAgent(
|
|
196
|
+
name: string,
|
|
197
|
+
org: string = ORG,
|
|
198
|
+
): Promise<Agent> {
|
|
121
199
|
return agents.create({
|
|
122
200
|
apiVersion: API_VERSION,
|
|
123
201
|
kind: "Agent",
|
|
@@ -185,7 +263,9 @@ describe("model-pin existence (oss#774)", () => {
|
|
|
185
263
|
it("create refuses a pin unknown to every harness, with a did-you-mean", async () => {
|
|
186
264
|
const agent = await createTestAgent(uniqueName("pin-agent"));
|
|
187
265
|
const ch = channelFor(agent, uniqueName("typod-pin"), true);
|
|
188
|
-
(ch.spec as Record<string, unknown>).runConfig = {
|
|
266
|
+
(ch.spec as Record<string, unknown>).runConfig = {
|
|
267
|
+
modelName: "composr-2.5",
|
|
268
|
+
};
|
|
189
269
|
|
|
190
270
|
const err = await grpcError(() => channels.create(ch));
|
|
191
271
|
expect(err.code).toBe(Code.InvalidArgument);
|
|
@@ -196,18 +276,24 @@ describe("model-pin existence (oss#774)", () => {
|
|
|
196
276
|
it("create accepts a pin valid under some harness", async () => {
|
|
197
277
|
const agent = await createTestAgent(uniqueName("pin-agent"));
|
|
198
278
|
const ch = channelFor(agent, uniqueName("valid-pin"), true);
|
|
199
|
-
(ch.spec as Record<string, unknown>).runConfig = {
|
|
279
|
+
(ch.spec as Record<string, unknown>).runConfig = {
|
|
280
|
+
modelName: "composer-2.5",
|
|
281
|
+
};
|
|
200
282
|
await channels.create(ch);
|
|
201
283
|
});
|
|
202
284
|
|
|
203
285
|
it("update refuses the same typo", async () => {
|
|
204
286
|
const agent = await createTestAgent(uniqueName("pin-agent"));
|
|
205
|
-
const created = await channels.create(
|
|
287
|
+
const created = await channels.create(
|
|
288
|
+
channelFor(agent, uniqueName("update-pin-target"), true),
|
|
289
|
+
);
|
|
206
290
|
|
|
207
291
|
const update = channelFor(agent, created.metadata!.name, true);
|
|
208
292
|
(update.metadata as Record<string, string>).id = created.metadata!.id;
|
|
209
293
|
(update.metadata as Record<string, string>).slug = created.metadata!.slug;
|
|
210
|
-
(update.spec as Record<string, unknown>).runConfig = {
|
|
294
|
+
(update.spec as Record<string, unknown>).runConfig = {
|
|
295
|
+
modelName: "composr-2.5",
|
|
296
|
+
};
|
|
211
297
|
|
|
212
298
|
const err = await grpcError(() => channels.update(update));
|
|
213
299
|
expect(err.code).toBe(Code.InvalidArgument);
|
|
@@ -222,11 +308,15 @@ describe("model-pin existence (oss#774)", () => {
|
|
|
222
308
|
describe("agentchannel create", () => {
|
|
223
309
|
it("creates with ach_ prefix, normalized ref, pending_install", async () => {
|
|
224
310
|
const agent = await createTestAgent(uniqueName("Create Basics Agent"));
|
|
225
|
-
const channel = await channels.create(
|
|
311
|
+
const channel = await channels.create(
|
|
312
|
+
channelFor(agent, uniqueName("Slack Workspace"), true),
|
|
313
|
+
);
|
|
226
314
|
|
|
227
315
|
expect(channel.metadata?.id).toMatch(/^ach_/);
|
|
228
316
|
expect(channel.spec?.agentRef?.org).toBe(agent.metadata!.org);
|
|
229
|
-
expect(channel.status?.installState).toBe(
|
|
317
|
+
expect(channel.status?.installState).toBe(
|
|
318
|
+
AgentChannelInstallState.pending_install,
|
|
319
|
+
);
|
|
230
320
|
});
|
|
231
321
|
|
|
232
322
|
it("no slug default from the agent — name derives the slug (P7)", async () => {
|
|
@@ -234,13 +324,17 @@ describe("agentchannel create", () => {
|
|
|
234
324
|
const name = uniqueName("Team Slack");
|
|
235
325
|
const channel = await channels.create(channelFor(agent, name, true));
|
|
236
326
|
|
|
237
|
-
expect(channel.metadata?.slug).toBe(
|
|
327
|
+
expect(channel.metadata?.slug).toBe(
|
|
328
|
+
name.toLowerCase().replace(/\s+/g, "-"),
|
|
329
|
+
);
|
|
238
330
|
expect(channel.metadata?.slug).not.toBe(agent.metadata!.slug);
|
|
239
331
|
});
|
|
240
332
|
|
|
241
333
|
it("nameless and slugless channel is INVALID_ARGUMENT, never agent-slug fallback", async () => {
|
|
242
334
|
const agent = await createTestAgent(uniqueName("No Name Agent"));
|
|
243
|
-
const err = await grpcError(() =>
|
|
335
|
+
const err = await grpcError(() =>
|
|
336
|
+
channels.create(channelFor(agent, "", true)),
|
|
337
|
+
);
|
|
244
338
|
expect(err.code).toBe(Code.InvalidArgument);
|
|
245
339
|
});
|
|
246
340
|
|
|
@@ -250,7 +344,9 @@ describe("agentchannel create", () => {
|
|
|
250
344
|
...channelFor(agent, uniqueName("Forged Status Slack"), true),
|
|
251
345
|
status: { installState: AgentChannelInstallState.installed },
|
|
252
346
|
});
|
|
253
|
-
expect(created.status?.installState).toBe(
|
|
347
|
+
expect(created.status?.installState).toBe(
|
|
348
|
+
AgentChannelInstallState.pending_install,
|
|
349
|
+
);
|
|
254
350
|
});
|
|
255
351
|
|
|
256
352
|
it("missing org is INVALID_ARGUMENT with the shared copy", async () => {
|
|
@@ -297,10 +393,16 @@ describe("agentchannel create", () => {
|
|
|
297
393
|
});
|
|
298
394
|
|
|
299
395
|
it("cross-org agent_ref is FAILED_PRECONDITION with the shared copy", async () => {
|
|
300
|
-
const agent = await createTestAgent(
|
|
396
|
+
const agent = await createTestAgent(
|
|
397
|
+
uniqueName("Foreign Agent"),
|
|
398
|
+
"channel-other-org",
|
|
399
|
+
);
|
|
301
400
|
const ch = channelFor(agent, uniqueName("Cross Org Channel"), true);
|
|
302
401
|
ch.metadata.org = ORG;
|
|
303
|
-
ch.spec.agentRef = {
|
|
402
|
+
ch.spec.agentRef = {
|
|
403
|
+
...ch.spec.agentRef,
|
|
404
|
+
org: "channel-other-org",
|
|
405
|
+
} as never;
|
|
304
406
|
|
|
305
407
|
const err = await grpcError(() => channels.create(ch));
|
|
306
408
|
expect(err.code).toBe(Code.FailedPrecondition);
|
|
@@ -335,7 +437,9 @@ describe("agentchannel create", () => {
|
|
|
335
437
|
const name = uniqueName("Duplicate Slack");
|
|
336
438
|
await channels.create(channelFor(agent, name, true));
|
|
337
439
|
|
|
338
|
-
const err = await grpcError(() =>
|
|
440
|
+
const err = await grpcError(() =>
|
|
441
|
+
channels.create(channelFor(agent, name, true)),
|
|
442
|
+
);
|
|
339
443
|
expect(err.code).toBe(Code.AlreadyExists);
|
|
340
444
|
});
|
|
341
445
|
|
|
@@ -357,8 +461,12 @@ describe("agentchannel create", () => {
|
|
|
357
461
|
|
|
358
462
|
it("two channels for one agent coexist under distinct slugs", async () => {
|
|
359
463
|
const agent = await createTestAgent(uniqueName("Multi Channel Agent"));
|
|
360
|
-
const first = await channels.create(
|
|
361
|
-
|
|
464
|
+
const first = await channels.create(
|
|
465
|
+
channelFor(agent, uniqueName("Sales Slack"), true),
|
|
466
|
+
);
|
|
467
|
+
const second = await channels.create(
|
|
468
|
+
channelFor(agent, uniqueName("Support Slack"), true),
|
|
469
|
+
);
|
|
362
470
|
expect(first.metadata?.slug).not.toBe(second.metadata?.slug);
|
|
363
471
|
});
|
|
364
472
|
});
|
|
@@ -370,24 +478,32 @@ describe("agentchannel create", () => {
|
|
|
370
478
|
describe("agentchannel update", () => {
|
|
371
479
|
it("disable is a config-preserving pause; status survives a status-less manifest", async () => {
|
|
372
480
|
const agent = await createTestAgent(uniqueName("Pause Agent"));
|
|
373
|
-
const created = await channels.create(
|
|
481
|
+
const created = await channels.create(
|
|
482
|
+
channelFor(agent, uniqueName("Pausable Slack"), true),
|
|
483
|
+
);
|
|
374
484
|
|
|
375
485
|
created.spec!.enabled = false;
|
|
376
486
|
created.status = undefined; // a manifest apply sends no status
|
|
377
487
|
const updated = await channels.update(created);
|
|
378
488
|
expect(updated.spec?.enabled).toBe(false);
|
|
379
|
-
expect(updated.status?.installState).toBe(
|
|
489
|
+
expect(updated.status?.installState).toBe(
|
|
490
|
+
AgentChannelInstallState.pending_install,
|
|
491
|
+
);
|
|
380
492
|
});
|
|
381
493
|
|
|
382
494
|
it("agent_ref is immutable with the shared copy", async () => {
|
|
383
495
|
const agentA = await createTestAgent(uniqueName("Immutable Ref Agent A"));
|
|
384
496
|
const agentB = await createTestAgent(uniqueName("Immutable Ref Agent B"));
|
|
385
|
-
const created = await channels.create(
|
|
497
|
+
const created = await channels.create(
|
|
498
|
+
channelFor(agentA, uniqueName("Repoint Slack"), true),
|
|
499
|
+
);
|
|
386
500
|
|
|
387
501
|
const repointed = channelFor(agentB, "ignored", true);
|
|
388
502
|
(repointed.metadata as Record<string, string>).id = created.metadata!.id;
|
|
389
|
-
(repointed.metadata as Record<string, string>).slug =
|
|
390
|
-
|
|
503
|
+
(repointed.metadata as Record<string, string>).slug =
|
|
504
|
+
created.metadata!.slug;
|
|
505
|
+
(repointed.metadata as Record<string, string>).name =
|
|
506
|
+
created.metadata!.name;
|
|
391
507
|
repointed.spec.agentRef = {
|
|
392
508
|
kind: ApiResourceKind.agent,
|
|
393
509
|
org: agentB.metadata!.org,
|
|
@@ -427,7 +543,9 @@ describe("agentchannel update", () => {
|
|
|
427
543
|
|
|
428
544
|
it("provider arm is immutable — a real slack→whatsapp flip refuses with the shared copy", async () => {
|
|
429
545
|
const agent = await createTestAgent(uniqueName("Provider Flip Agent"));
|
|
430
|
-
const created = await channels.create(
|
|
546
|
+
const created = await channels.create(
|
|
547
|
+
channelFor(agent, uniqueName("Prov Slack"), true),
|
|
548
|
+
);
|
|
431
549
|
|
|
432
550
|
const flipped = whatsAppChannelFor(agent, created.metadata!.name);
|
|
433
551
|
(flipped.metadata as Record<string, string>).id = created.metadata!.id;
|
|
@@ -451,17 +569,24 @@ describe("agentchannel update", () => {
|
|
|
451
569
|
describe("apply semantics", () => {
|
|
452
570
|
it("apply creates (pending_install), re-apply updates in place preserving status", async () => {
|
|
453
571
|
const org = "channel-apply-org";
|
|
454
|
-
const agent = await createTestAgent(
|
|
572
|
+
const agent = await createTestAgent(
|
|
573
|
+
uniqueName("Apply Semantics Agent"),
|
|
574
|
+
org,
|
|
575
|
+
);
|
|
455
576
|
const name = uniqueName("Apply Slack");
|
|
456
577
|
|
|
457
578
|
const created = await channels.apply(channelFor(agent, name, true));
|
|
458
579
|
expect(created.metadata?.id).not.toBe("");
|
|
459
|
-
expect(created.status?.installState).toBe(
|
|
580
|
+
expect(created.status?.installState).toBe(
|
|
581
|
+
AgentChannelInstallState.pending_install,
|
|
582
|
+
);
|
|
460
583
|
|
|
461
584
|
const updated = await channels.apply(channelFor(agent, name, false));
|
|
462
585
|
expect(updated.metadata?.id).toBe(created.metadata!.id);
|
|
463
586
|
expect(updated.spec?.enabled).toBe(false);
|
|
464
|
-
expect(updated.status?.installState).toBe(
|
|
587
|
+
expect(updated.status?.installState).toBe(
|
|
588
|
+
AgentChannelInstallState.pending_install,
|
|
589
|
+
);
|
|
465
590
|
|
|
466
591
|
const list = await query.list({ org });
|
|
467
592
|
expect(list.totalCount).toBe(1);
|
|
@@ -480,7 +605,11 @@ describe("environment_refs (channel-bound credentials)", () => {
|
|
|
480
605
|
const withRefs = channelFor(agent, name, true);
|
|
481
606
|
(withRefs.spec as Record<string, unknown>).environmentRefs = [
|
|
482
607
|
{ kind: ApiResourceKind.environment, slug: "github-credentials" },
|
|
483
|
-
{
|
|
608
|
+
{
|
|
609
|
+
kind: ApiResourceKind.environment,
|
|
610
|
+
org: ORG,
|
|
611
|
+
slug: "search-credentials",
|
|
612
|
+
},
|
|
484
613
|
];
|
|
485
614
|
const created = await channels.create(withRefs);
|
|
486
615
|
expect(created.spec?.environmentRefs).toHaveLength(2);
|
|
@@ -494,7 +623,11 @@ describe("environment_refs (channel-bound credentials)", () => {
|
|
|
494
623
|
// Apply replaces the refs wholesale — credentials are mutable.
|
|
495
624
|
const rebound = channelFor(agent, name, true);
|
|
496
625
|
(rebound.spec as Record<string, unknown>).environmentRefs = [
|
|
497
|
-
{
|
|
626
|
+
{
|
|
627
|
+
kind: ApiResourceKind.environment,
|
|
628
|
+
org: ORG,
|
|
629
|
+
slug: "rotated-credentials",
|
|
630
|
+
},
|
|
498
631
|
];
|
|
499
632
|
const updated = await channels.apply(rebound);
|
|
500
633
|
expect(updated.spec?.environmentRefs).toHaveLength(1);
|
|
@@ -713,23 +846,31 @@ describe("whatsapp app_ref (BYO-only, DD-WA-2)", () => {
|
|
|
713
846
|
describe("delete and queries", () => {
|
|
714
847
|
it("delete returns the deleted channel; get after delete is NOT_FOUND", async () => {
|
|
715
848
|
const agent = await createTestAgent(uniqueName("Delete Agent"));
|
|
716
|
-
const created = await channels.create(
|
|
849
|
+
const created = await channels.create(
|
|
850
|
+
channelFor(agent, uniqueName("Doomed Slack"), true),
|
|
851
|
+
);
|
|
717
852
|
|
|
718
853
|
const deleted = await channels.delete({ value: created.metadata!.id });
|
|
719
854
|
expect(deleted.metadata?.id).toBe(created.metadata!.id);
|
|
720
855
|
|
|
721
|
-
const err = await grpcError(() =>
|
|
856
|
+
const err = await grpcError(() =>
|
|
857
|
+
query.get({ value: created.metadata!.id }),
|
|
858
|
+
);
|
|
722
859
|
expect(err.code).toBe(Code.NotFound);
|
|
723
860
|
});
|
|
724
861
|
|
|
725
862
|
it("nonexistent channel delete is NOT_FOUND", async () => {
|
|
726
|
-
const err = await grpcError(() =>
|
|
863
|
+
const err = await grpcError(() =>
|
|
864
|
+
channels.delete({ value: "ach_does_not_exist" }),
|
|
865
|
+
);
|
|
727
866
|
expect(err.code).toBe(Code.NotFound);
|
|
728
867
|
});
|
|
729
868
|
|
|
730
869
|
it("get by id and by reference round-trip", async () => {
|
|
731
870
|
const agent = await createTestAgent(uniqueName("Query Agent"));
|
|
732
|
-
const created = await channels.create(
|
|
871
|
+
const created = await channels.create(
|
|
872
|
+
channelFor(agent, uniqueName("Query Slack"), true),
|
|
873
|
+
);
|
|
733
874
|
|
|
734
875
|
const fetched = await query.get({ value: created.metadata!.id });
|
|
735
876
|
expect(fetched.metadata?.slug).toBe(created.metadata!.slug);
|
|
@@ -763,8 +904,12 @@ describe("delete and queries", () => {
|
|
|
763
904
|
|
|
764
905
|
it("getByAgent finds every channel regardless of slug; org scope filters", async () => {
|
|
765
906
|
const agent = await createTestAgent(uniqueName("Get By Agent Agent"));
|
|
766
|
-
const first = await channels.create(
|
|
767
|
-
|
|
907
|
+
const first = await channels.create(
|
|
908
|
+
channelFor(agent, uniqueName("Primary Slack"), true),
|
|
909
|
+
);
|
|
910
|
+
const second = await channels.create(
|
|
911
|
+
channelFor(agent, uniqueName("Secondary Slack"), false),
|
|
912
|
+
);
|
|
768
913
|
|
|
769
914
|
const list = await query.getByAgent({ agentId: agent.metadata!.id });
|
|
770
915
|
expect(list.totalCount).toBe(2);
|
|
@@ -772,7 +917,10 @@ describe("delete and queries", () => {
|
|
|
772
917
|
expect(slugs).toContain(first.metadata!.slug);
|
|
773
918
|
expect(slugs).toContain(second.metadata!.slug);
|
|
774
919
|
|
|
775
|
-
const matching = await query.getByAgent({
|
|
920
|
+
const matching = await query.getByAgent({
|
|
921
|
+
agentId: agent.metadata!.id,
|
|
922
|
+
org: ORG,
|
|
923
|
+
});
|
|
776
924
|
expect(matching.totalCount).toBe(2);
|
|
777
925
|
|
|
778
926
|
const foreign = await query.getByAgent({
|
|
@@ -795,13 +943,17 @@ describe("delete and queries", () => {
|
|
|
795
943
|
describe("install posture (§0-b)", () => {
|
|
796
944
|
it("the full contract: NOT_FOUND with the cloud copy, refusal on existing, nothing persisted", async () => {
|
|
797
945
|
const agent = await createTestAgent(uniqueName("Install Posture Agent"));
|
|
798
|
-
const created = await channels.create(
|
|
946
|
+
const created = await channels.create(
|
|
947
|
+
channelFor(agent, uniqueName("Installable Slack"), true),
|
|
948
|
+
);
|
|
799
949
|
|
|
800
950
|
const missErr = await grpcError(() =>
|
|
801
951
|
channels.initiateInstall({ resourceId: "ach_does_not_exist" }),
|
|
802
952
|
);
|
|
803
953
|
expect(missErr.code).toBe(Code.NotFound);
|
|
804
|
-
expect(missErr.rawMessage).toBe(
|
|
954
|
+
expect(missErr.rawMessage).toBe(
|
|
955
|
+
"AgentChannel not found: ach_does_not_exist",
|
|
956
|
+
);
|
|
805
957
|
|
|
806
958
|
const refuseErr = await grpcError(() =>
|
|
807
959
|
channels.initiateInstall({ resourceId: created.metadata!.id }),
|
|
@@ -838,7 +990,9 @@ describe("install posture (§0-b)", () => {
|
|
|
838
990
|
|
|
839
991
|
// The refused install persists nothing.
|
|
840
992
|
const fetched = await query.get({ value: created.metadata!.id });
|
|
841
|
-
expect(fetched.status?.installState).toBe(
|
|
993
|
+
expect(fetched.status?.installState).toBe(
|
|
994
|
+
AgentChannelInstallState.pending_install,
|
|
995
|
+
);
|
|
842
996
|
});
|
|
843
997
|
});
|
|
844
998
|
|
|
@@ -875,11 +1029,16 @@ describe("channel messaging posture (cloud-only runtime)", () => {
|
|
|
875
1029
|
});
|
|
876
1030
|
|
|
877
1031
|
it("sendMessage contract violations are INVALID_ARGUMENT before the refusal", async () => {
|
|
878
|
-
const cases: Array<
|
|
1032
|
+
const cases: Array<
|
|
1033
|
+
[string, Parameters<typeof messageCommand.sendMessage>[0]]
|
|
1034
|
+
> = [
|
|
879
1035
|
["empty recipient", { payload: textPayload("hello") }],
|
|
880
1036
|
["missing payload", { recipient: "15551234567" }],
|
|
881
1037
|
["unset payload arm", { recipient: "15551234567", payload: {} }],
|
|
882
|
-
[
|
|
1038
|
+
[
|
|
1039
|
+
"empty text body",
|
|
1040
|
+
{ recipient: "15551234567", payload: textPayload("") },
|
|
1041
|
+
],
|
|
883
1042
|
[
|
|
884
1043
|
"oversized text body",
|
|
885
1044
|
{ recipient: "15551234567", payload: textPayload("x".repeat(4097)) },
|
|
@@ -900,7 +1059,10 @@ describe("channel messaging posture (cloud-only runtime)", () => {
|
|
|
900
1059
|
|
|
901
1060
|
it("listTemplates refuses with FAILED_PRECONDITION and the documented copy", async () => {
|
|
902
1061
|
const err = await grpcError(() =>
|
|
903
|
-
messageQuery.listTemplates({
|
|
1062
|
+
messageQuery.listTemplates({
|
|
1063
|
+
channel: "some-channel",
|
|
1064
|
+
approvedOnly: true,
|
|
1065
|
+
}),
|
|
904
1066
|
);
|
|
905
1067
|
expect(err.code).toBe(Code.FailedPrecondition);
|
|
906
1068
|
expect(err.rawMessage).toBe(PROACTIVE_MESSAGING_UNAVAILABLE_MESSAGE);
|
|
@@ -917,7 +1079,10 @@ describe("channel messaging posture (cloud-only runtime)", () => {
|
|
|
917
1079
|
// ---------------------------------------------------------------------------
|
|
918
1080
|
|
|
919
1081
|
describe("channel conversation posture (cloud-only runtime)", () => {
|
|
920
|
-
const controlInput = {
|
|
1082
|
+
const controlInput = {
|
|
1083
|
+
agentChannelId: "ach-123",
|
|
1084
|
+
conversationKey: "15551234567",
|
|
1085
|
+
};
|
|
921
1086
|
|
|
922
1087
|
it("discovery reads answer truthful emptiness", async () => {
|
|
923
1088
|
const list = await conversationQuery.listConversations({ org: "acme" });
|
|
@@ -959,12 +1124,17 @@ describe("channel conversation posture (cloud-only runtime)", () => {
|
|
|
959
1124
|
conversationCommand.reply({
|
|
960
1125
|
agentChannelId: "ach-123",
|
|
961
1126
|
conversationKey: "15551234567",
|
|
962
|
-
payload: {
|
|
1127
|
+
payload: {
|
|
1128
|
+
kind: { case: "text" as const, value: { body: "on my way" } },
|
|
1129
|
+
},
|
|
963
1130
|
}),
|
|
964
1131
|
],
|
|
965
1132
|
["takeOver", () => conversationCommand.takeOver(controlInput)],
|
|
966
1133
|
["handBack", () => conversationCommand.handBack(controlInput)],
|
|
967
|
-
[
|
|
1134
|
+
[
|
|
1135
|
+
"clearAttention",
|
|
1136
|
+
() => conversationCommand.clearAttention(controlInput),
|
|
1137
|
+
],
|
|
968
1138
|
[
|
|
969
1139
|
"escalate",
|
|
970
1140
|
() =>
|
|
@@ -976,13 +1146,18 @@ describe("channel conversation posture (cloud-only runtime)", () => {
|
|
|
976
1146
|
for (const [name, call] of commands) {
|
|
977
1147
|
const err = await grpcError(call);
|
|
978
1148
|
expect(err.code, name).toBe(Code.FailedPrecondition);
|
|
979
|
-
expect(err.rawMessage, name).toBe(
|
|
1149
|
+
expect(err.rawMessage, name).toBe(
|
|
1150
|
+
CONVERSATION_PARTICIPATION_UNAVAILABLE_MESSAGE,
|
|
1151
|
+
);
|
|
980
1152
|
}
|
|
981
1153
|
});
|
|
982
1154
|
|
|
983
1155
|
it("contract violations are INVALID_ARGUMENT before the refusal", async () => {
|
|
984
1156
|
const cases: Array<[string, () => Promise<unknown>]> = [
|
|
985
|
-
[
|
|
1157
|
+
[
|
|
1158
|
+
"listConversations without org",
|
|
1159
|
+
() => conversationQuery.listConversations({}),
|
|
1160
|
+
],
|
|
986
1161
|
[
|
|
987
1162
|
"getTimeline without conversation key",
|
|
988
1163
|
() => conversationQuery.getTimeline({ agentChannelId: "ach-123" }),
|
|
@@ -96,7 +96,10 @@ import {
|
|
|
96
96
|
TARGET_RESOURCE_KEY,
|
|
97
97
|
newLoadTargetStep,
|
|
98
98
|
} from "../../pipeline/steps/load-target.js";
|
|
99
|
-
import {
|
|
99
|
+
import {
|
|
100
|
+
newNormalizeReferencesStep,
|
|
101
|
+
newValidateReferencesStep,
|
|
102
|
+
} from "../../pipeline/steps/references.js";
|
|
100
103
|
import {
|
|
101
104
|
newCleanupIamPoliciesStep,
|
|
102
105
|
newCreateAuthorizationTuplesStep,
|
|
@@ -210,6 +213,7 @@ async function createChannel(
|
|
|
210
213
|
.addStep(newGuardReservedLabelsStep(deps.authorizer))
|
|
211
214
|
.addStep(newInitInstallStateStep())
|
|
212
215
|
.addStep(newNormalizeReferencesStep())
|
|
216
|
+
.addStep(newValidateReferencesStep(deps.store))
|
|
213
217
|
.addStep(newPersistStep(deps.store))
|
|
214
218
|
.addStep(
|
|
215
219
|
newCreateAuthorizationTuplesStep(
|
|
@@ -258,6 +262,7 @@ async function update(
|
|
|
258
262
|
.addStep(newBuildUpdateStateStep())
|
|
259
263
|
.addStep(newGuardReservedLabelsStep(deps.authorizer))
|
|
260
264
|
.addStep(newNormalizeReferencesStep())
|
|
265
|
+
.addStep(newValidateReferencesStep(deps.store))
|
|
261
266
|
.addStep(newPersistStep(deps.store))
|
|
262
267
|
.build()
|
|
263
268
|
.execute(reqCtx);
|
|
@@ -66,7 +66,10 @@ import {
|
|
|
66
66
|
TARGET_RESOURCE_KEY,
|
|
67
67
|
newLoadTargetStep,
|
|
68
68
|
} from "../../pipeline/steps/load-target.js";
|
|
69
|
-
import {
|
|
69
|
+
import {
|
|
70
|
+
newNormalizeReferencesStep,
|
|
71
|
+
newValidateReferencesStep,
|
|
72
|
+
} from "../../pipeline/steps/references.js";
|
|
70
73
|
import {
|
|
71
74
|
newCleanupIamPoliciesStep,
|
|
72
75
|
newCreateAuthorizationTuplesStep,
|
|
@@ -328,6 +331,7 @@ async function createExecution(
|
|
|
328
331
|
.addStep(newRecordRunnerLineageLabelsStep(deps.runnerCredentialProvider))
|
|
329
332
|
.addStep(newGuardReservedLabelsStep(deps.authorizer))
|
|
330
333
|
.addStep(newNormalizeReferencesStep())
|
|
334
|
+
.addStep(newValidateReferencesStep(deps.store))
|
|
331
335
|
.addStep(newEnsureEngineAvailableStep(deps.engineState));
|
|
332
336
|
// The ratified pre-side-effect gate slot (blueprint 03 §3a; O4): after
|
|
333
337
|
// every pure validation/resolution step, before the first side-effecting
|
|
@@ -433,6 +437,7 @@ async function update(
|
|
|
433
437
|
.addStep(newLoadExistingStep(deps.store))
|
|
434
438
|
.addStep(newBuildUpdateStateStep())
|
|
435
439
|
.addStep(newNormalizeReferencesStep())
|
|
440
|
+
.addStep(newValidateReferencesStep(deps.store))
|
|
436
441
|
.addStep(newPersistStep(deps.store))
|
|
437
442
|
.addStep(
|
|
438
443
|
newIndexSearchStep(
|
|
@@ -52,10 +52,6 @@ import {
|
|
|
52
52
|
newAuthorizeResolvedTargetStep,
|
|
53
53
|
} from "../../pipeline/steps/authorize-resolved-target.js";
|
|
54
54
|
import { newGuardReservedLabelsStep } from "../../pipeline/steps/guard-reserved-labels.js";
|
|
55
|
-
import {
|
|
56
|
-
newAuthorizeVisibilityTransitionStep,
|
|
57
|
-
newGuardPublicVisibilityStep,
|
|
58
|
-
} from "../../pipeline/steps/visibility-gates.js";
|
|
59
55
|
import {
|
|
60
56
|
newBuildNewStateStep,
|
|
61
57
|
setAuditFieldsForUpdate,
|
|
@@ -85,7 +81,10 @@ import {
|
|
|
85
81
|
TARGET_RESOURCE_KEY,
|
|
86
82
|
newLoadTargetStep,
|
|
87
83
|
} from "../../pipeline/steps/load-target.js";
|
|
88
|
-
import {
|
|
84
|
+
import {
|
|
85
|
+
newNormalizeReferencesStep,
|
|
86
|
+
newValidateReferencesStep,
|
|
87
|
+
} from "../../pipeline/steps/references.js";
|
|
89
88
|
import {
|
|
90
89
|
newCleanupIamPoliciesStep,
|
|
91
90
|
newCreateAuthorizationTuplesStep,
|
|
@@ -196,9 +195,9 @@ async function createInstance(
|
|
|
196
195
|
)
|
|
197
196
|
.addStep(newCheckDuplicateStep(deps.store))
|
|
198
197
|
.addStep(newBuildNewStateStep())
|
|
199
|
-
.addStep(newGuardPublicVisibilityStep(deps.authorizer))
|
|
200
198
|
.addStep(newGuardReservedLabelsStep(deps.authorizer))
|
|
201
199
|
.addStep(newNormalizeReferencesStep())
|
|
200
|
+
.addStep(newValidateReferencesStep(deps.store))
|
|
202
201
|
.addStep(newPersistStep(deps.store))
|
|
203
202
|
.addStep(
|
|
204
203
|
newCreateAuthorizationTuplesStep(
|
|
@@ -243,6 +242,7 @@ async function update(
|
|
|
243
242
|
.addStep(newBuildUpdateStateStep())
|
|
244
243
|
.addStep(newGuardReservedLabelsStep(deps.authorizer))
|
|
245
244
|
.addStep(newNormalizeReferencesStep())
|
|
245
|
+
.addStep(newValidateReferencesStep(deps.store))
|
|
246
246
|
.addStep(newPersistStep(deps.store))
|
|
247
247
|
.addStep(
|
|
248
248
|
newIndexSearchStep(deps.store, agentInstanceSearchExtractor, deps.logger),
|
|
@@ -383,12 +383,6 @@ async function updateVisibility(
|
|
|
383
383
|
)
|
|
384
384
|
.addStep(newRejectDefaultInstanceVisibilityUpdateStep(deps.store))
|
|
385
385
|
.addStep(newValidateVisibilityUpdateStep())
|
|
386
|
-
.addStep(
|
|
387
|
-
newAuthorizeVisibilityTransitionStep(
|
|
388
|
-
UPDATE_VISIBILITY_INSTANCE_KEY,
|
|
389
|
-
deps.authorizer,
|
|
390
|
-
),
|
|
391
|
-
)
|
|
392
386
|
.addStep(newSetInstanceVisibilityStep())
|
|
393
387
|
.addStep(newPersistInstanceForVisibilityUpdateStep(deps.store))
|
|
394
388
|
.addStep(
|