@stigmer/server 3.39.1-dev.20260928194002 → 3.40.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/artifactstorage/artifact-storage.d.ts +10 -2
- package/dist/artifactstorage/artifact-storage.d.ts.map +1 -1
- package/dist/artifactstorage/artifact-storage.js +6 -3
- package/dist/artifactstorage/artifact-storage.js.map +1 -1
- package/dist/boot/artifact-lane.d.ts +55 -0
- package/dist/boot/artifact-lane.d.ts.map +1 -0
- package/dist/boot/artifact-lane.js +74 -0
- package/dist/boot/artifact-lane.js.map +1 -0
- package/dist/boot/compose.d.ts.map +1 -1
- package/dist/boot/compose.js +42 -19
- package/dist/boot/compose.js.map +1 -1
- package/dist/boot/config.d.ts +11 -6
- package/dist/boot/config.d.ts.map +1 -1
- package/dist/boot/config.js +10 -5
- package/dist/boot/config.js.map +1 -1
- package/dist/domain/agent/controller.d.ts +5 -2
- package/dist/domain/agent/controller.d.ts.map +1 -1
- package/dist/domain/agent/controller.js.map +1 -1
- package/dist/domain/agentexecution/controller.d.ts +18 -4
- package/dist/domain/agentexecution/controller.d.ts.map +1 -1
- package/dist/domain/agentexecution/controller.js +2 -2
- package/dist/domain/agentexecution/controller.js.map +1 -1
- package/dist/domain/agentexecution/create-steps.d.ts +29 -15
- package/dist/domain/agentexecution/create-steps.d.ts.map +1 -1
- package/dist/domain/agentexecution/create-steps.js +118 -51
- package/dist/domain/agentexecution/create-steps.js.map +1 -1
- package/dist/domain/agentinstance/controller.d.ts +8 -2
- package/dist/domain/agentinstance/controller.d.ts.map +1 -1
- package/dist/domain/agentinstance/controller.js.map +1 -1
- package/dist/domain/agentshare/controller.d.ts +9 -4
- package/dist/domain/agentshare/controller.d.ts.map +1 -1
- package/dist/domain/agentshare/controller.js +3 -3
- package/dist/domain/agentshare/controller.js.map +1 -1
- package/dist/domain/artifact/file-server.d.ts +2 -1
- package/dist/domain/artifact/file-server.d.ts.map +1 -1
- package/dist/domain/artifact/file-server.js +6 -3
- package/dist/domain/artifact/file-server.js.map +1 -1
- package/dist/domain/channelapp/controller.d.ts +8 -3
- package/dist/domain/channelapp/controller.d.ts.map +1 -1
- package/dist/domain/channelapp/controller.js.map +1 -1
- package/dist/domain/environment/controller.d.ts +8 -5
- package/dist/domain/environment/controller.d.ts.map +1 -1
- package/dist/domain/environment/controller.js +3 -3
- package/dist/domain/environment/controller.js.map +1 -1
- package/dist/domain/executioncontext/controller.d.ts +7 -4
- package/dist/domain/executioncontext/controller.d.ts.map +1 -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 +6 -2
- package/dist/domain/mcpserver/controller.js.map +1 -1
- package/dist/domain/memory/constants.d.ts +9 -0
- package/dist/domain/memory/constants.d.ts.map +1 -1
- package/dist/domain/memory/constants.js +9 -0
- package/dist/domain/memory/constants.js.map +1 -1
- package/dist/domain/memory/controller.d.ts +18 -6
- package/dist/domain/memory/controller.d.ts.map +1 -1
- package/dist/domain/memory/controller.js +18 -21
- package/dist/domain/memory/controller.js.map +1 -1
- package/dist/domain/memory/steps.d.ts +38 -10
- package/dist/domain/memory/steps.d.ts.map +1 -1
- package/dist/domain/memory/steps.js +87 -17
- package/dist/domain/memory/steps.js.map +1 -1
- package/dist/domain/organization/controller.d.ts +7 -4
- package/dist/domain/organization/controller.d.ts.map +1 -1
- package/dist/domain/organization/controller.js.map +1 -1
- package/dist/domain/session/controller.d.ts +7 -3
- package/dist/domain/session/controller.d.ts.map +1 -1
- 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 +8 -2
- package/dist/domain/skill/controller.js.map +1 -1
- package/dist/domain/workflow/controller.d.ts +6 -2
- package/dist/domain/workflow/controller.d.ts.map +1 -1
- package/dist/domain/workflow/controller.js.map +1 -1
- package/dist/domain/workflowexecution/controller.d.ts +8 -4
- package/dist/domain/workflowexecution/controller.d.ts.map +1 -1
- package/dist/domain/workflowexecution/controller.js.map +1 -1
- package/dist/domain/workflowexecution/update-status.d.ts.map +1 -1
- package/dist/domain/workflowexecution/update-status.js +3 -2
- package/dist/domain/workflowexecution/update-status.js.map +1 -1
- package/dist/extensions/identity.d.ts +28 -14
- package/dist/extensions/identity.d.ts.map +1 -1
- package/dist/extensions/identity.js +38 -0
- package/dist/extensions/identity.js.map +1 -1
- package/dist/pipeline/steps/guard-memory-capture.d.ts.map +1 -1
- package/dist/pipeline/steps/guard-memory-capture.js +1 -13
- package/dist/pipeline/steps/guard-memory-capture.js.map +1 -1
- package/package.json +6 -6
- package/src/artifactstorage/__tests__/artifact-storage.test.ts +15 -1
- package/src/artifactstorage/artifact-storage.ts +12 -4
- package/src/boot/__tests__/artifact-lane.test.ts +71 -0
- package/src/boot/__tests__/compose.test.ts +73 -3
- package/src/boot/__tests__/config.test.ts +19 -0
- package/src/boot/artifact-lane.ts +96 -0
- package/src/boot/compose.ts +57 -21
- package/src/boot/config.ts +25 -15
- package/src/domain/agent/controller.ts +5 -2
- package/src/domain/agentexecution/__tests__/create-steps.test.ts +230 -2
- package/src/domain/agentexecution/controller.ts +32 -6
- package/src/domain/agentexecution/create-steps.ts +162 -62
- package/src/domain/agentinstance/controller.ts +8 -2
- package/src/domain/agentshare/controller.ts +12 -7
- package/src/domain/artifact/file-server.ts +8 -4
- package/src/domain/channelapp/controller.ts +8 -3
- package/src/domain/environment/controller.ts +11 -8
- package/src/domain/executioncontext/controller.ts +7 -4
- package/src/domain/mcpserver/controller.ts +6 -2
- package/src/domain/memory/__tests__/capture-credential.test.ts +6 -6
- package/src/domain/memory/__tests__/person-consent-composed.test.ts +187 -0
- package/src/domain/memory/__tests__/person-consent.test.ts +274 -0
- package/src/domain/memory/constants.ts +11 -0
- package/src/domain/memory/controller.ts +36 -27
- package/src/domain/memory/steps.ts +112 -17
- package/src/domain/organization/controller.ts +7 -4
- package/src/domain/plugin/__tests__/plugin.test.ts +8 -0
- package/src/domain/session/controller.ts +7 -3
- package/src/domain/skill/__tests__/skill.test.ts +4 -0
- package/src/domain/skill/controller.ts +8 -2
- package/src/domain/workflow/controller.ts +6 -2
- package/src/domain/workflowexecution/controller.ts +8 -4
- package/src/domain/workflowexecution/update-status.ts +3 -2
- package/src/extensions/__tests__/identity.test.ts +82 -0
- package/src/extensions/identity.ts +47 -0
- package/src/pipeline/steps/guard-memory-capture.ts +4 -19
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
* HandlerContext.values (never ambient state — the every-dependency-
|
|
13
13
|
* explicit doctrine).
|
|
14
14
|
*/
|
|
15
|
+
import { USER_TOKEN_CLAIMS } from "../domain/platformclient/constants.js";
|
|
16
|
+
import {
|
|
17
|
+
decodeVerifiedPlatformTokenPayload,
|
|
18
|
+
stringClaim,
|
|
19
|
+
} from "../platformtoken/envelope.js";
|
|
15
20
|
|
|
16
21
|
/**
|
|
17
22
|
* The caller-class discriminant. OSS knows user / machine / runner plus
|
|
@@ -152,3 +157,45 @@ export function isPlatformPipelineCaller(caller: CallerIdentity): boolean {
|
|
|
152
157
|
export function isServerComposedRequest(caller: CallerIdentity): boolean {
|
|
153
158
|
return caller.callerClass === "internal" || caller.origin === "in-process";
|
|
154
159
|
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Whether `caller` is a FIRST-PARTY HUMAN OPERATOR: a person at the
|
|
163
|
+
* console, the CLI or an SDK, speaking for themselves on the wire — the
|
|
164
|
+
* TS rendering of the Java RequestCallerIdentity.isFirstPartyHumanOperator
|
|
165
|
+
* (not machine, not impersonated, no token_type, not a PlatformClient user
|
|
166
|
+
* token). Stated once for every consumer that must tell the person from a
|
|
167
|
+
* lane acting near them: memory recall and the person's declared
|
|
168
|
+
* preferences on execution create (domain/agentexecution/create-steps.ts).
|
|
169
|
+
*
|
|
170
|
+
* An ALLOW-list, so a lane this module has never heard of is excluded by
|
|
171
|
+
* construction: the class must be `user` (every human verifier stamps it —
|
|
172
|
+
* OIDC, API key, the cloud's direct and federated logins; runners, the
|
|
173
|
+
* cloud's token lanes and the platform's own pipelines each carry their
|
|
174
|
+
* own class), the request must come from the wire (the open-source
|
|
175
|
+
* schedule fire acts as its creator with class `user` but rides the
|
|
176
|
+
* in-process transport, which is exactly what `isServerComposedRequest`
|
|
177
|
+
* reads), and the bearer must not be a PlatformClient user token (a
|
|
178
|
+
* person, but spoken for by a third-party client — DD-002 D4 as amended).
|
|
179
|
+
*/
|
|
180
|
+
export function isFirstPartyHumanOperator(caller: CallerIdentity): boolean {
|
|
181
|
+
return (
|
|
182
|
+
caller.callerClass === "user" &&
|
|
183
|
+
!isServerComposedRequest(caller) &&
|
|
184
|
+
!carriesPlatformClientClaim(caller.rawToken)
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Whether the bearer is a platform token naming a PlatformClient. Anything
|
|
190
|
+
* that is not a platform token (no token, an API key, another issuer's
|
|
191
|
+
* JWT) is not one, whatever claims it carries (stigmer#1312). Read from
|
|
192
|
+
* the raw token, never from `platformClientId`, which is audit provenance
|
|
193
|
+
* set by one verifier and not a guard vocabulary (see its field doc).
|
|
194
|
+
*/
|
|
195
|
+
export function carriesPlatformClientClaim(rawToken: string): boolean {
|
|
196
|
+
const payload = decodeVerifiedPlatformTokenPayload(rawToken);
|
|
197
|
+
return (
|
|
198
|
+
payload !== undefined &&
|
|
199
|
+
stringClaim(payload, USER_TOKEN_CLAIMS.platformClientId) !== undefined
|
|
200
|
+
);
|
|
201
|
+
}
|
|
@@ -42,14 +42,12 @@
|
|
|
42
42
|
import type { DescMessage } from "@bufbuild/protobuf";
|
|
43
43
|
import { Code, ConnectError } from "@connectrpc/connect";
|
|
44
44
|
|
|
45
|
-
import {
|
|
46
|
-
|
|
45
|
+
import {
|
|
46
|
+
carriesPlatformClientClaim,
|
|
47
|
+
isServerComposedRequest,
|
|
48
|
+
} from "../../extensions/identity.js";
|
|
47
49
|
import type { PipelineStep } from "../pipeline.js";
|
|
48
50
|
import type { RequestContext } from "../request-context.js";
|
|
49
|
-
import {
|
|
50
|
-
decodeVerifiedPlatformTokenPayload,
|
|
51
|
-
stringClaim,
|
|
52
|
-
} from "../../platformtoken/envelope.js";
|
|
53
51
|
import type { RunnerCredentialProvider } from "../../runnerauth/runner-credential-provider.js";
|
|
54
52
|
import { metadataOf } from "./shapes.js";
|
|
55
53
|
|
|
@@ -147,16 +145,3 @@ export function memoryCaptureCredentialOf<Desc extends DescMessage>(
|
|
|
147
145
|
}
|
|
148
146
|
return undefined;
|
|
149
147
|
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Whether the bearer is a platform token naming a PlatformClient. Anything
|
|
153
|
-
* that is not a platform token (no token, an API key, another issuer's
|
|
154
|
-
* JWT) is not one, whatever claims it carries.
|
|
155
|
-
*/
|
|
156
|
-
function carriesPlatformClientClaim(rawToken: string): boolean {
|
|
157
|
-
const payload = decodeVerifiedPlatformTokenPayload(rawToken);
|
|
158
|
-
return (
|
|
159
|
-
payload !== undefined &&
|
|
160
|
-
stringClaim(payload, USER_TOKEN_CLAIMS.platformClientId) !== undefined
|
|
161
|
-
);
|
|
162
|
-
}
|