@stigmer/server 3.14.0-dev.20260910084630 → 3.14.1
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/domain/agentexecution/constants.d.ts +16 -0
- package/dist/domain/agentexecution/constants.d.ts.map +1 -1
- package/dist/domain/agentexecution/constants.js +22 -0
- package/dist/domain/agentexecution/constants.js.map +1 -1
- package/dist/domain/agentexecution/controller.d.ts.map +1 -1
- package/dist/domain/agentexecution/controller.js +10 -3
- package/dist/domain/agentexecution/controller.js.map +1 -1
- package/dist/domain/agentexecution/run-target.d.ts +26 -0
- package/dist/domain/agentexecution/run-target.d.ts.map +1 -0
- package/dist/domain/agentexecution/run-target.js +31 -0
- package/dist/domain/agentexecution/run-target.js.map +1 -0
- package/dist/domain/session/constants.d.ts +15 -0
- package/dist/domain/session/constants.d.ts.map +1 -0
- package/dist/domain/session/constants.js +17 -0
- package/dist/domain/session/constants.js.map +1 -0
- package/dist/domain/session/controller.d.ts.map +1 -1
- package/dist/domain/session/controller.js +10 -0
- package/dist/domain/session/controller.js.map +1 -1
- package/dist/domain/session/run-target.d.ts +15 -0
- package/dist/domain/session/run-target.d.ts.map +1 -0
- package/dist/domain/session/run-target.js +14 -0
- package/dist/domain/session/run-target.js.map +1 -0
- package/dist/domain/workflowexecution/constants.d.ts +9 -0
- package/dist/domain/workflowexecution/constants.d.ts.map +1 -1
- package/dist/domain/workflowexecution/constants.js +13 -0
- package/dist/domain/workflowexecution/constants.js.map +1 -1
- package/dist/domain/workflowexecution/controller.d.ts.map +1 -1
- package/dist/domain/workflowexecution/controller.js +8 -0
- package/dist/domain/workflowexecution/controller.js.map +1 -1
- package/dist/domain/workflowexecution/run-target.d.ts +18 -0
- package/dist/domain/workflowexecution/run-target.d.ts.map +1 -0
- package/dist/domain/workflowexecution/run-target.js +23 -0
- package/dist/domain/workflowexecution/run-target.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/steps/authorize-run-target.d.ts +105 -0
- package/dist/pipeline/steps/authorize-run-target.d.ts.map +1 -0
- package/dist/pipeline/steps/authorize-run-target.js +61 -0
- package/dist/pipeline/steps/authorize-run-target.js.map +1 -0
- package/dist/query/search/criteria.d.ts +10 -3
- package/dist/query/search/criteria.d.ts.map +1 -1
- package/dist/query/search/criteria.js +11 -4
- package/dist/query/search/criteria.js.map +1 -1
- package/package.json +4 -4
- package/src/domain/agentexecution/__tests__/run-gate.test.ts +245 -0
- package/src/domain/agentexecution/__tests__/run-target.test.ts +117 -0
- package/src/domain/agentexecution/constants.ts +25 -0
- package/src/domain/agentexecution/controller.ts +10 -3
- package/src/domain/agentexecution/run-target.ts +64 -0
- package/src/domain/session/__tests__/run-gate.test.ts +219 -0
- package/src/domain/session/__tests__/run-target.test.ts +43 -0
- package/src/domain/session/constants.ts +17 -0
- package/src/domain/session/controller.ts +10 -0
- package/src/domain/session/run-target.ts +30 -0
- package/src/domain/workflowexecution/__tests__/run-gate.test.ts +200 -0
- package/src/domain/workflowexecution/__tests__/run-target.test.ts +80 -0
- package/src/domain/workflowexecution/constants.ts +17 -0
- package/src/domain/workflowexecution/controller.ts +10 -0
- package/src/domain/workflowexecution/run-target.ts +47 -0
- package/src/extensions/__tests__/extension-composition.test.ts +49 -0
- package/src/index.ts +7 -0
- package/src/pipeline/__tests__/support.ts +34 -0
- package/src/pipeline/steps/__tests__/authorize-run-target.test.ts +261 -0
- package/src/pipeline/steps/authorize-run-target.ts +148 -0
- package/src/query/search/__tests__/criteria.test.ts +18 -1
- package/src/query/search/criteria.ts +11 -4
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The workflow-execution run-target resolver (P1 sp.run-gate): the chain's
|
|
3
|
+
* own precedence — an explicit workflow_instance_id fully names the target
|
|
4
|
+
* (CreateDefaultInstanceIfNeeded returns early on it):
|
|
5
|
+
* workflow_instance#can_execute; else workflow_id names the blueprint whose
|
|
6
|
+
* default instance the chain resolves (or mints) only AFTER the gate:
|
|
7
|
+
* workflow#can_execute (the model derives the default instance's viewers
|
|
8
|
+
* from the blueprint's, so asking the blueprint's question is what lets the
|
|
9
|
+
* gate precede the side effect).
|
|
10
|
+
*
|
|
11
|
+
* Neither set is ValidateWorkflowOrInstance's INVALID_ARGUMENT, thrown
|
|
12
|
+
* before this resolver runs — never a check. Pure over the record being
|
|
13
|
+
* built.
|
|
14
|
+
*/
|
|
15
|
+
import type { WorkflowExecution } from "@stigmer/protos/ai/stigmer/agentic/workflowexecution/v1/api_pb";
|
|
16
|
+
import { type RunTarget } from "../../pipeline/steps/authorize-run-target.js";
|
|
17
|
+
export declare function workflowExecutionRunTarget(execution: WorkflowExecution): RunTarget | undefined;
|
|
18
|
+
//# sourceMappingURL=run-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-target.d.ts","sourceRoot":"","sources":["../../../src/domain/workflowexecution/run-target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gEAAgE,CAAC;AAExG,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,8CAA8C,CAAC;AAMtD,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,iBAAiB,GAC3B,SAAS,GAAG,SAAS,CAmBvB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RUN_GATE_CHECKS, } from "../../pipeline/steps/authorize-run-target.js";
|
|
2
|
+
import { runWorkflowDeniedMessage, runWorkflowInstanceDeniedMessage, } from "./constants.js";
|
|
3
|
+
export function workflowExecutionRunTarget(execution) {
|
|
4
|
+
const spec = execution.spec;
|
|
5
|
+
const workflowInstanceId = spec?.workflowInstanceId ?? "";
|
|
6
|
+
if (workflowInstanceId !== "") {
|
|
7
|
+
return {
|
|
8
|
+
...RUN_GATE_CHECKS.workflowInstance,
|
|
9
|
+
resourceId: workflowInstanceId,
|
|
10
|
+
deniedMessage: runWorkflowInstanceDeniedMessage(workflowInstanceId),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const workflowId = spec?.workflowId ?? "";
|
|
14
|
+
if (workflowId !== "") {
|
|
15
|
+
return {
|
|
16
|
+
...RUN_GATE_CHECKS.workflow,
|
|
17
|
+
resourceId: workflowId,
|
|
18
|
+
deniedMessage: runWorkflowDeniedMessage(workflowId),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=run-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-target.js","sourceRoot":"","sources":["../../../src/domain/workflowexecution/run-target.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,eAAe,GAEhB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,wBAAwB,EACxB,gCAAgC,GACjC,MAAM,gBAAgB,CAAC;AAExB,MAAM,UAAU,0BAA0B,CACxC,SAA4B;IAE5B,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;IAC5B,MAAM,kBAAkB,GAAG,IAAI,EAAE,kBAAkB,IAAI,EAAE,CAAC;IAC1D,IAAI,kBAAkB,KAAK,EAAE,EAAE,CAAC;QAC9B,OAAO;YACL,GAAG,eAAe,CAAC,gBAAgB;YACnC,UAAU,EAAE,kBAAkB;YAC9B,aAAa,EAAE,gCAAgC,CAAC,kBAAkB,CAAC;SACpE,CAAC;IACJ,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,EAAE,UAAU,IAAI,EAAE,CAAC;IAC1C,IAAI,UAAU,KAAK,EAAE,EAAE,CAAC;QACtB,OAAO;YACL,GAAG,eAAe,CAAC,QAAQ;YAC3B,UAAU,EAAE,UAAU;YACtB,aAAa,EAAE,wBAAwB,CAAC,UAAU,CAAC;SACpD,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ export { createVerifierChainInterceptor } from "./pipeline/interceptors/auth.js"
|
|
|
71
71
|
export { authenticateBearerToken, parseBearerToken, } from "./pipeline/interceptors/auth.js";
|
|
72
72
|
export { newPipeline } from "./pipeline/pipeline.js";
|
|
73
73
|
export { newAuthorizeStep } from "./pipeline/steps/authorize.js";
|
|
74
|
+
export { isRunGateCheck } from "./pipeline/steps/authorize-run-target.js";
|
|
74
75
|
export { newValidateProtoStep } from "./pipeline/steps/validation.js";
|
|
75
76
|
export type { Store } from "./store/interface.js";
|
|
76
77
|
export { AuditNotFoundError, ResourceNotFoundError, } from "./store/interface.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,YAAY,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,aAAa,EACb,QAAQ,EACR,OAAO,GACR,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,4BAA4B,EAC5B,kBAAkB,EAClB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,WAAW,EACX,cAAc,EACd,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AASlC,YAAY,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAOjE,YAAY,EACV,UAAU,EACV,UAAU,EACV,aAAa,GACd,M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AE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AAS9E,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,gBAAgB,IAAI,sCAAsC,GAC3D,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAQrE,YAAY,EACV,cAAc,EACd,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,0CAA0C,CAAC;AAOlD,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -88,6 +88,13 @@ export { createVerifierChainInterceptor } from "./pipeline/interceptors/auth.js"
|
|
|
88
88
|
export { authenticateBearerToken, parseBearerToken, } from "./pipeline/interceptors/auth.js";
|
|
89
89
|
export { newPipeline } from "./pipeline/pipeline.js";
|
|
90
90
|
export { newAuthorizeStep } from "./pipeline/steps/authorize.js";
|
|
91
|
+
// The run gate's check set (P1 sp.run-gate): an edition's Authorizer keys
|
|
92
|
+
// its lane admission on this predicate — the runtime lanes it mints (a
|
|
93
|
+
// guest share, a channel, a schedule fire, a workflow sandbox) were
|
|
94
|
+
// admitted upstream by their own gate steps and are not re-asked here.
|
|
95
|
+
// OSS defines the gate, so OSS defines which checks are the gate; a
|
|
96
|
+
// composition never re-derives the set.
|
|
97
|
+
export { isRunGateCheck } from "./pipeline/steps/authorize-run-target.js";
|
|
91
98
|
export { newValidateProtoStep } from "./pipeline/steps/validation.js";
|
|
92
99
|
export { AuditNotFoundError, ResourceNotFoundError, } from "./store/interface.js";
|
|
93
100
|
// The Postgres driver constructor (stigmer-cloud 20260910.04 ruling 4;
|
package/dist/index.js.map
CHANGED
|
@@ -1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1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthorizeRunTarget — the run gate (P1 sp.run-gate, 2026-09-11;
|
|
3
|
+
* stigmer-cloud#709): may this caller RUN what this record targets?
|
|
4
|
+
*
|
|
5
|
+
* Every create that starts or continues a run names a target — a blueprint
|
|
6
|
+
* (`agent`, `workflow`), an instance (`agent_instance`, `workflow_instance`)
|
|
7
|
+
* or a conversation (`session`) — and until this step nothing asked whether
|
|
8
|
+
* the caller may use it: session-create authorized only the organization's
|
|
9
|
+
* `can_create_session`, agent- and workflow-execution create are
|
|
10
|
+
* `is_skip_authorization`, and `can_execute` was defined on every blueprint
|
|
11
|
+
* and instance type of the FGA model and checked nowhere. The invariant the
|
|
12
|
+
* model states ("you can run what you can read") is enforced here.
|
|
13
|
+
*
|
|
14
|
+
* One shared step, one domain resolver: the shape of IndexSearch (a shared
|
|
15
|
+
* step over a domain extractor). The resolver is a PURE function of the
|
|
16
|
+
* record being built (`ctx.newState`, where the chain's own resolution
|
|
17
|
+
* steps write) that names the target and the domain's byte-pinned deny
|
|
18
|
+
* copy; this step hands it to authorizeResolvedResource — the ratified
|
|
19
|
+
* mid-chain resolved-id form (DD-007; the ListVersions and listByChannel
|
|
20
|
+
* precedent) for lanes the position-1 annotation cannot express. A
|
|
21
|
+
* resolver that answers no target makes NO check: the chain's own
|
|
22
|
+
* invariant guards (EnsureSessionOrAgentResolved,
|
|
23
|
+
* ValidateWorkflowOrInstance) own the shape-less arm, and this step never
|
|
24
|
+
* second-guesses them.
|
|
25
|
+
*
|
|
26
|
+
* Position, in every chain: immediately after the step that guarantees the
|
|
27
|
+
* target reference exists — before EnsureEngineAvailable (a denied caller
|
|
28
|
+
* learns nothing about engine state), before every gate slot, before every
|
|
29
|
+
* side effect the chain owns. The chains' own convention, Authorize before
|
|
30
|
+
* Validate, is what places it there.
|
|
31
|
+
*
|
|
32
|
+
* Admission has one owner per lane. This step asks for EVERY caller but the
|
|
33
|
+
* `internal` class (authorizeResolvedResource's contract): a direct
|
|
34
|
+
* principal is admitted by the Authorizer; a runtime lane (a guest share, a
|
|
35
|
+
* channel, a schedule fire, a workflow sandbox's child run) is admitted by
|
|
36
|
+
* the gate step that vouches for it, and the edition's Authorizer says so
|
|
37
|
+
* for the lanes it mints — the OSS chain stays policy-free. RUN_GATE_CHECKS
|
|
38
|
+
* is the one definition of "the run-gate checks" that such an Authorizer
|
|
39
|
+
* keys on (isRunGateCheck, exported on the barrel); the resolvers draw their
|
|
40
|
+
* (kind, permission) pairs from the same table, so the predicate cannot
|
|
41
|
+
* drift from what the step actually asks.
|
|
42
|
+
*/
|
|
43
|
+
import type { DescMessage, MessageShape } from "@bufbuild/protobuf";
|
|
44
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
45
|
+
import { IamPermission } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
46
|
+
import type { Authorizer, AuthzCheck } from "../../extensions/authorizer.js";
|
|
47
|
+
import type { PipelineStep } from "../pipeline.js";
|
|
48
|
+
/** One (kind, permission) pair the run gate asks about. */
|
|
49
|
+
export interface RunGateCheck {
|
|
50
|
+
readonly permission: IamPermission;
|
|
51
|
+
readonly resourceKind: ApiResourceKind;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The run-gate check set — exactly the pairs a resolver can produce. Each
|
|
55
|
+
* is the FGA model's own relation for "may run this": `can_execute` on the
|
|
56
|
+
* blueprints and instances (`agent.fga` `can_execute: viewer`;
|
|
57
|
+
* `agent_instance.fga` `can_execute: can_view`; the workflow twins), and
|
|
58
|
+
* `can_create_execution_in` on a session (`session.fga`: adding a turn to a
|
|
59
|
+
* conversation is the session's own permission, not the agent's).
|
|
60
|
+
*/
|
|
61
|
+
export declare const RUN_GATE_CHECKS: {
|
|
62
|
+
readonly agent: {
|
|
63
|
+
readonly permission: IamPermission.can_execute;
|
|
64
|
+
readonly resourceKind: ApiResourceKind.agent;
|
|
65
|
+
};
|
|
66
|
+
readonly agentInstance: {
|
|
67
|
+
readonly permission: IamPermission.can_execute;
|
|
68
|
+
readonly resourceKind: ApiResourceKind.agent_instance;
|
|
69
|
+
};
|
|
70
|
+
readonly session: {
|
|
71
|
+
readonly permission: IamPermission.can_create_execution_in;
|
|
72
|
+
readonly resourceKind: ApiResourceKind.session;
|
|
73
|
+
};
|
|
74
|
+
readonly workflow: {
|
|
75
|
+
readonly permission: IamPermission.can_execute;
|
|
76
|
+
readonly resourceKind: ApiResourceKind.workflow;
|
|
77
|
+
};
|
|
78
|
+
readonly workflowInstance: {
|
|
79
|
+
readonly permission: IamPermission.can_execute;
|
|
80
|
+
readonly resourceKind: ApiResourceKind.workflow_instance;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Whether `check` is one of the run gate's — the predicate an edition's
|
|
85
|
+
* Authorizer keys its lane admission on. Reads only the pair (an AuthzCheck
|
|
86
|
+
* is one); the resource id is the target's identity, not part of the
|
|
87
|
+
* question.
|
|
88
|
+
*/
|
|
89
|
+
export declare function isRunGateCheck(check: RunGateCheck | AuthzCheck): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* A resolved run target: the check plus the domain's byte-pinned deny copy
|
|
92
|
+
* for it (the lane's error_msg, in the position-1 annotation's terms).
|
|
93
|
+
*/
|
|
94
|
+
export interface RunTarget extends RunGateCheck {
|
|
95
|
+
readonly resourceId: string;
|
|
96
|
+
readonly deniedMessage: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Names a record's run target, or `undefined` when the record names none
|
|
100
|
+
* (a state the chain's own guards refuse; never this step's arm). Pure over
|
|
101
|
+
* the record being built — no store, no clock, no caller.
|
|
102
|
+
*/
|
|
103
|
+
export type RunTargetResolver<Desc extends DescMessage> = (record: MessageShape<Desc>) => RunTarget | undefined;
|
|
104
|
+
export declare function newAuthorizeRunTargetStep<Desc extends DescMessage>(authorizer: Authorizer, resolveRunTarget: RunTargetResolver<Desc>): PipelineStep<Desc>;
|
|
105
|
+
//# sourceMappingURL=authorize-run-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorize-run-target.d.ts","sourceRoot":"","sources":["../../../src/pipeline/steps/authorize-run-target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD,2DAA2D;AAC3D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;CACxC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;CAqBqB,CAAC;AAKlD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,OAAO,CAMxE;AAED;;;GAGG;AACH,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,IAAI,SAAS,WAAW,IAAI,CACxD,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,KACvB,SAAS,GAAG,SAAS,CAAC;AAE3B,wBAAgB,yBAAyB,CAAC,IAAI,SAAS,WAAW,EAChE,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,iBAAiB,CAAC,IAAI,CAAC,GACxC,YAAY,CAAC,IAAI,CAAC,CAoBpB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
2
|
+
import { IamPermission } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
|
|
3
|
+
import { authorizeResolvedResource } from "./authorize.js";
|
|
4
|
+
/**
|
|
5
|
+
* The run-gate check set — exactly the pairs a resolver can produce. Each
|
|
6
|
+
* is the FGA model's own relation for "may run this": `can_execute` on the
|
|
7
|
+
* blueprints and instances (`agent.fga` `can_execute: viewer`;
|
|
8
|
+
* `agent_instance.fga` `can_execute: can_view`; the workflow twins), and
|
|
9
|
+
* `can_create_execution_in` on a session (`session.fga`: adding a turn to a
|
|
10
|
+
* conversation is the session's own permission, not the agent's).
|
|
11
|
+
*/
|
|
12
|
+
export const RUN_GATE_CHECKS = {
|
|
13
|
+
agent: {
|
|
14
|
+
permission: IamPermission.can_execute,
|
|
15
|
+
resourceKind: ApiResourceKind.agent,
|
|
16
|
+
},
|
|
17
|
+
agentInstance: {
|
|
18
|
+
permission: IamPermission.can_execute,
|
|
19
|
+
resourceKind: ApiResourceKind.agent_instance,
|
|
20
|
+
},
|
|
21
|
+
session: {
|
|
22
|
+
permission: IamPermission.can_create_execution_in,
|
|
23
|
+
resourceKind: ApiResourceKind.session,
|
|
24
|
+
},
|
|
25
|
+
workflow: {
|
|
26
|
+
permission: IamPermission.can_execute,
|
|
27
|
+
resourceKind: ApiResourceKind.workflow,
|
|
28
|
+
},
|
|
29
|
+
workflowInstance: {
|
|
30
|
+
permission: IamPermission.can_execute,
|
|
31
|
+
resourceKind: ApiResourceKind.workflow_instance,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
const RUN_GATE_CHECK_LIST = Object.values(RUN_GATE_CHECKS);
|
|
35
|
+
/**
|
|
36
|
+
* Whether `check` is one of the run gate's — the predicate an edition's
|
|
37
|
+
* Authorizer keys its lane admission on. Reads only the pair (an AuthzCheck
|
|
38
|
+
* is one); the resource id is the target's identity, not part of the
|
|
39
|
+
* question.
|
|
40
|
+
*/
|
|
41
|
+
export function isRunGateCheck(check) {
|
|
42
|
+
return RUN_GATE_CHECK_LIST.some((candidate) => candidate.permission === check.permission &&
|
|
43
|
+
candidate.resourceKind === check.resourceKind);
|
|
44
|
+
}
|
|
45
|
+
export function newAuthorizeRunTargetStep(authorizer, resolveRunTarget) {
|
|
46
|
+
return {
|
|
47
|
+
name: "AuthorizeRunTarget",
|
|
48
|
+
async execute(ctx) {
|
|
49
|
+
const target = resolveRunTarget(ctx.newState);
|
|
50
|
+
if (target === undefined) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
await authorizeResolvedResource(authorizer, ctx.callerIdentity, {
|
|
54
|
+
permission: target.permission,
|
|
55
|
+
resourceKind: target.resourceKind,
|
|
56
|
+
resourceId: target.resourceId,
|
|
57
|
+
}, target.deniedMessage);
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=authorize-run-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorize-run-target.js","sourceRoot":"","sources":["../../../src/pipeline/steps/authorize-run-target.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAK1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAQ3D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,KAAK,EAAE;QACL,UAAU,EAAE,aAAa,CAAC,WAAW;QACrC,YAAY,EAAE,eAAe,CAAC,KAAK;KACpC;IACD,aAAa,EAAE;QACb,UAAU,EAAE,aAAa,CAAC,WAAW;QACrC,YAAY,EAAE,eAAe,CAAC,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DERIVED from the proto kind_meta extension
|
|
8
|
-
* (not_search_indexed: false, tier
|
|
8
|
+
* (not_search_indexed: false, tier == open_source) — Go's
|
|
9
9
|
* SearchIndexedKinds() posture since stigmer/stigmer#439, where hand-copied
|
|
10
10
|
* kind lists drifted from the proto and from each other. Go still carries a
|
|
11
11
|
* hand map (SearchableKinds) pinned to the derivation by an invariant test;
|
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
* registry unit test pins the registered extractors against this same
|
|
14
14
|
* derivation (the #439 invariant's TS home).
|
|
15
15
|
*
|
|
16
|
+
* The tier clause admits open_source alone, not "anything but cloud_only":
|
|
17
|
+
* the index is the core's, and a kind tiered enterprise (editions program,
|
|
18
|
+
* DD-001) must not enter it by accident. This derivation is edition-blind
|
|
19
|
+
* by design (the same code runs in every composition); an edition-aware
|
|
20
|
+
* derivation is a design act with a named trigger — the first searchable
|
|
21
|
+
* kind above open_source.
|
|
22
|
+
*
|
|
16
23
|
* kinds are kept VERBATIM from the request; filtering to the searchable set
|
|
17
24
|
* happens in effectiveKinds(). Keeping the raw request is what
|
|
18
25
|
* distinguishes "no kinds requested" (discover mode) from "kinds requested
|
|
@@ -33,8 +40,8 @@ export declare const MAX_PAGE_SIZE = 100;
|
|
|
33
40
|
export declare const MAX_QUERY_LENGTH = 500;
|
|
34
41
|
/**
|
|
35
42
|
* Go SearchIndexedKinds(): every kind this edition's search read side
|
|
36
|
-
* serves — kind_meta declares it search-indexed and
|
|
37
|
-
*
|
|
43
|
+
* serves — kind_meta declares it search-indexed and open_source-tier.
|
|
44
|
+
* Sorted ascending by enum value, exactly Go's sort. Kinds whose
|
|
38
45
|
* kind_meta cannot be read are skipped (Go's contract; the registry unit
|
|
39
46
|
* test separately fails on such a defect).
|
|
40
47
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"criteria.d.ts","sourceRoot":"","sources":["../../../src/query/search/criteria.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"criteria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AAY,IAAI,OAAO;IAIvB;;;;;;OAMG;IACH,cAAc,IAAI,SAAS,eAAe,EAAE;IAQ5C,wDAAwD;IACxD,MAAM,IAAI,MAAM;CAGjB"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* discover).
|
|
6
6
|
*
|
|
7
7
|
* The searchable-kind set is DERIVED from the proto kind_meta extension
|
|
8
|
-
* (not_search_indexed: false, tier
|
|
8
|
+
* (not_search_indexed: false, tier == open_source) — Go's
|
|
9
9
|
* SearchIndexedKinds() posture since stigmer/stigmer#439, where hand-copied
|
|
10
10
|
* kind lists drifted from the proto and from each other. Go still carries a
|
|
11
11
|
* hand map (SearchableKinds) pinned to the derivation by an invariant test;
|
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
* registry unit test pins the registered extractors against this same
|
|
14
14
|
* derivation (the #439 invariant's TS home).
|
|
15
15
|
*
|
|
16
|
+
* The tier clause admits open_source alone, not "anything but cloud_only":
|
|
17
|
+
* the index is the core's, and a kind tiered enterprise (editions program,
|
|
18
|
+
* DD-001) must not enter it by accident. This derivation is edition-blind
|
|
19
|
+
* by design (the same code runs in every composition); an edition-aware
|
|
20
|
+
* derivation is a design act with a named trigger — the first searchable
|
|
21
|
+
* kind above open_source.
|
|
22
|
+
*
|
|
16
23
|
* kinds are kept VERBATIM from the request; filtering to the searchable set
|
|
17
24
|
* happens in effectiveKinds(). Keeping the raw request is what
|
|
18
25
|
* distinguishes "no kinds requested" (discover mode) from "kinds requested
|
|
@@ -37,8 +44,8 @@ let searchIndexedKindsCache;
|
|
|
37
44
|
let searchableKindSetCache;
|
|
38
45
|
/**
|
|
39
46
|
* Go SearchIndexedKinds(): every kind this edition's search read side
|
|
40
|
-
* serves — kind_meta declares it search-indexed and
|
|
41
|
-
*
|
|
47
|
+
* serves — kind_meta declares it search-indexed and open_source-tier.
|
|
48
|
+
* Sorted ascending by enum value, exactly Go's sort. Kinds whose
|
|
42
49
|
* kind_meta cannot be read are skipped (Go's contract; the registry unit
|
|
43
50
|
* test separately fails on such a defect).
|
|
44
51
|
*/
|
|
@@ -57,7 +64,7 @@ export function searchIndexedKinds() {
|
|
|
57
64
|
catch {
|
|
58
65
|
continue;
|
|
59
66
|
}
|
|
60
|
-
if (meta.notSearchIndexed || meta.tier
|
|
67
|
+
if (meta.notSearchIndexed || meta.tier !== ResourceTier.open_source) {
|
|
61
68
|
continue;
|
|
62
69
|
}
|
|
63
70
|
kinds.push(kind);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"criteria.js","sourceRoot":"","sources":["../../../src/query/search/criteria.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"criteria.js","sourceRoot":"","sources":["../../../src/query/search/criteria.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,YAAY,GACb,MAAM,qFAAqF,CAAC;AAE7F,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,0BAA0B;AAC1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC,sBAAsB;AACtB,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AACjC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC,IAAI,uBAA+D,CAAC;AACpE,IAAI,sBAAgE,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,uBAAuB,KAAK,SAAS,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAsB,EAAE,CAAC;QACpC,KAAK,MAAM,KAAK,IAAI,qBAAqB,CAAC,MAAM,EAAE,CAAC;YACjD,MAAM,IAAI,GAAG,KAAK,CAAC,MAAyB,CAAC;YAC7C,IAAI,IAAI,KAAK,eAAe,CAAC,yBAAyB,EAAE,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AI,CAAC,cAAc,KAAK,EAAE,CAAC;IACpC,CAAC;IAED;;;;;;OAMG;IACH,cAAc;QACZ,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrC,OAAO,kBAAkB,EAAE,CAAC;QAC9B,CAAC;QACD,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,wDAAwD;IACxD,MAAM;QACJ,OAAO,CAAC,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;IACzD,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/server",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.1",
|
|
4
4
|
"description": "The Stigmer OSS control plane as a composable library: composeServer, the extension registry and the driver seams a composition builds on. The self-contained deployable of the same server is @stigmer/server-slim.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"@connectrpc/connect-node": "^2.0.0",
|
|
63
63
|
"@kubernetes/client-node": "2.0.0",
|
|
64
64
|
"@opentelemetry/api": "^1.9.0",
|
|
65
|
-
"@stigmer/protos": "3.14.
|
|
66
|
-
"@stigmer/temporal-codecs": "3.14.
|
|
67
|
-
"@stigmer/zip-structure": "3.14.
|
|
65
|
+
"@stigmer/protos": "3.14.1",
|
|
66
|
+
"@stigmer/temporal-codecs": "3.14.1",
|
|
67
|
+
"@stigmer/zip-structure": "3.14.1",
|
|
68
68
|
"@temporalio/activity": "1.16.2",
|
|
69
69
|
"@temporalio/client": "1.16.2",
|
|
70
70
|
"@temporalio/common": "1.16.2",
|