@agent-deck/shared 2.3.0 → 2.3.2

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.
@@ -33,6 +33,16 @@ export declare const AGENT_DECK_RECOVERED_SESSION_HEADER = "x-agent-deck-recover
33
33
  export declare const AGENT_DECK_BRIDGE_LIVENESS_HEADER = "x-agent-deck-bridge-liveness";
34
34
  /** Header value advertising the v1 bridge-owned `ping` heartbeat contract. */
35
35
  export declare const AGENT_DECK_BRIDGE_LIVENESS_V1 = "1";
36
+ /**
37
+ * Pinned playbook version for one run's MCP session (NOT-537).
38
+ *
39
+ * Value shape is `<playbookId>=<versionId>`. Adopt-once per MCP session like
40
+ * the correlation id: the first valid value sticks, later changes are
41
+ * ignored, and invalid values are dropped. The pin changes only what
42
+ * `get_playbook` and the playbook summaries show for that one playbook id;
43
+ * it never selects a deck, grants access, or participates in authorization.
44
+ */
45
+ export declare const AGENT_DECK_PLAYBOOK_PIN_HEADER = "x-agent-deck-playbook-pin";
36
46
  /**
37
47
  * Host-side session id for status-line self-match (NOT-513). The bridge sends
38
48
  * the id its host assigned the session (Claude Code: `CLAUDE_CODE_SESSION_ID`
@@ -1 +1 @@
1
- {"version":3,"file":"client-scope.d.ts","sourceRoot":"","sources":["../../src/constants/client-scope.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAE9D,mEAAmE;AACnE,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAE/C,uEAAuE;AACvE,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AAEpE,sCAAsC;AACtC,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,gCAAgC,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,mCAAmC,CAAC;AAEpF;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,iCAAiC,CAAC;AAEhF,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,iCAAiC,CAAC"}
1
+ {"version":3,"file":"client-scope.d.ts","sourceRoot":"","sources":["../../src/constants/client-scope.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAE9D,mEAAmE;AACnE,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAE/C,uEAAuE;AACvE,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AAEpE,sCAAsC;AACtC,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,gCAAgC,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,mCAAmC,CAAC;AAEpF;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,iCAAiC,CAAC;AAEhF,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,8BAA8B,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,iCAAiC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AGENT_DECK_HOST_SESSION_ID_HEADER = exports.AGENT_DECK_BRIDGE_LIVENESS_V1 = exports.AGENT_DECK_BRIDGE_LIVENESS_HEADER = exports.AGENT_DECK_RECOVERED_SESSION_HEADER = exports.AGENT_DECK_CORRELATION_HEADER = exports.AGENT_DECK_DECK_ID_HEADER = exports.AGENT_DECK_WORKSPACE_HEADER = exports.AGENT_DECK_AGENT_CLIENT = exports.AGENT_DECK_DASHBOARD_CLIENT = exports.AGENT_DECK_CLIENT_HEADER = void 0;
3
+ exports.AGENT_DECK_HOST_SESSION_ID_HEADER = exports.AGENT_DECK_PLAYBOOK_PIN_HEADER = exports.AGENT_DECK_BRIDGE_LIVENESS_V1 = exports.AGENT_DECK_BRIDGE_LIVENESS_HEADER = exports.AGENT_DECK_RECOVERED_SESSION_HEADER = exports.AGENT_DECK_CORRELATION_HEADER = exports.AGENT_DECK_DECK_ID_HEADER = exports.AGENT_DECK_WORKSPACE_HEADER = exports.AGENT_DECK_AGENT_CLIENT = exports.AGENT_DECK_DASHBOARD_CLIENT = exports.AGENT_DECK_CLIENT_HEADER = void 0;
4
4
  /** HTTP header distinguishing dashboard (human UI) from agent API clients. */
5
5
  exports.AGENT_DECK_CLIENT_HEADER = 'x-agent-deck-client';
6
6
  /** Value sent by the Agent Deck dashboard for vault management. */
@@ -36,6 +36,16 @@ exports.AGENT_DECK_RECOVERED_SESSION_HEADER = 'x-agent-deck-recovered-session';
36
36
  exports.AGENT_DECK_BRIDGE_LIVENESS_HEADER = 'x-agent-deck-bridge-liveness';
37
37
  /** Header value advertising the v1 bridge-owned `ping` heartbeat contract. */
38
38
  exports.AGENT_DECK_BRIDGE_LIVENESS_V1 = '1';
39
+ /**
40
+ * Pinned playbook version for one run's MCP session (NOT-537).
41
+ *
42
+ * Value shape is `<playbookId>=<versionId>`. Adopt-once per MCP session like
43
+ * the correlation id: the first valid value sticks, later changes are
44
+ * ignored, and invalid values are dropped. The pin changes only what
45
+ * `get_playbook` and the playbook summaries show for that one playbook id;
46
+ * it never selects a deck, grants access, or participates in authorization.
47
+ */
48
+ exports.AGENT_DECK_PLAYBOOK_PIN_HEADER = 'x-agent-deck-playbook-pin';
39
49
  /**
40
50
  * Host-side session id for status-line self-match (NOT-513). The bridge sends
41
51
  * the id its host assigned the session (Claude Code: `CLAUDE_CODE_SESSION_ID`
@@ -1 +1 @@
1
- {"version":3,"file":"client-scope.js","sourceRoot":"","sources":["../../src/constants/client-scope.ts"],"names":[],"mappings":";;;AAAA,8EAA8E;AACjE,QAAA,wBAAwB,GAAG,qBAAqB,CAAC;AAE9D,mEAAmE;AACtD,QAAA,2BAA2B,GAAG,WAAW,CAAC;AAEvD,+EAA+E;AAClE,QAAA,uBAAuB,GAAG,OAAO,CAAC;AAE/C,uEAAuE;AAC1D,QAAA,2BAA2B,GAAG,wBAAwB,CAAC;AAEpE,sCAAsC;AACzB,QAAA,yBAAyB,GAAG,sBAAsB,CAAC;AAEhE;;;;;;GAMG;AACU,QAAA,6BAA6B,GAAG,6BAA6B,CAAC;AAE3E;;;;GAIG;AACU,QAAA,mCAAmC,GAAG,gCAAgC,CAAC;AAEpF;;;;;;;GAOG;AACU,QAAA,iCAAiC,GAAG,8BAA8B,CAAC;AAEhF,8EAA8E;AACjE,QAAA,6BAA6B,GAAG,GAAG,CAAC;AAEjD;;;;;;GAMG;AACU,QAAA,iCAAiC,GAAG,8BAA8B,CAAC"}
1
+ {"version":3,"file":"client-scope.js","sourceRoot":"","sources":["../../src/constants/client-scope.ts"],"names":[],"mappings":";;;AAAA,8EAA8E;AACjE,QAAA,wBAAwB,GAAG,qBAAqB,CAAC;AAE9D,mEAAmE;AACtD,QAAA,2BAA2B,GAAG,WAAW,CAAC;AAEvD,+EAA+E;AAClE,QAAA,uBAAuB,GAAG,OAAO,CAAC;AAE/C,uEAAuE;AAC1D,QAAA,2BAA2B,GAAG,wBAAwB,CAAC;AAEpE,sCAAsC;AACzB,QAAA,yBAAyB,GAAG,sBAAsB,CAAC;AAEhE;;;;;;GAMG;AACU,QAAA,6BAA6B,GAAG,6BAA6B,CAAC;AAE3E;;;;GAIG;AACU,QAAA,mCAAmC,GAAG,gCAAgC,CAAC;AAEpF;;;;;;;GAOG;AACU,QAAA,iCAAiC,GAAG,8BAA8B,CAAC;AAEhF,8EAA8E;AACjE,QAAA,6BAA6B,GAAG,GAAG,CAAC;AAEjD;;;;;;;;GAQG;AACU,QAAA,8BAA8B,GAAG,2BAA2B,CAAC;AAE1E;;;;;;GAMG;AACU,QAAA,iCAAiC,GAAG,8BAA8B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './schemas/oauth';
5
5
  export * from './schemas/playbook';
6
6
  export * from './schemas/playbook-patch';
7
7
  export * from './schemas/feedback-signal';
8
+ export * from './schemas/evaluation-scenario';
8
9
  export * from './schemas/deck-display';
9
10
  export * from './schemas/export-bundle';
10
11
  export * from './schemas/store';
@@ -12,12 +13,13 @@ export * from './schemas/session-bootstrap';
12
13
  export * from './schemas/trusted-session';
13
14
  export * from './schemas/card-usage';
14
15
  export * from './schemas/agent-run';
16
+ export * from './schemas/playbook-pin';
15
17
  export * from './types/api';
16
18
  export { OAuthDiscoveryResult } from './types/oauth';
17
19
  export * from './utils';
18
20
  export { summarizeCollectionWarnings, getServiceWarnings, getCredentialWarnings, getPlaybookWarnings, primaryCollectionWarning, type CollectionCardWarning, type CollectionWarningKind, } from './utils/collection-warnings';
19
21
  export { normalizeLocalMcpManifestInput, parseLocalMcpManifestJson, stripJsonMarkdownFences, } from './utils/local-mcp-manifest';
20
- export { AGENT_DECK_CLIENT_HEADER, AGENT_DECK_DASHBOARD_CLIENT, AGENT_DECK_AGENT_CLIENT, AGENT_DECK_WORKSPACE_HEADER, AGENT_DECK_DECK_ID_HEADER, AGENT_DECK_CORRELATION_HEADER, AGENT_DECK_RECOVERED_SESSION_HEADER, AGENT_DECK_BRIDGE_LIVENESS_HEADER, AGENT_DECK_BRIDGE_LIVENESS_V1, AGENT_DECK_HOST_SESSION_ID_HEADER, } from './constants/client-scope';
22
+ export { AGENT_DECK_CLIENT_HEADER, AGENT_DECK_DASHBOARD_CLIENT, AGENT_DECK_AGENT_CLIENT, AGENT_DECK_WORKSPACE_HEADER, AGENT_DECK_DECK_ID_HEADER, AGENT_DECK_CORRELATION_HEADER, AGENT_DECK_RECOVERED_SESSION_HEADER, AGENT_DECK_BRIDGE_LIVENESS_HEADER, AGENT_DECK_BRIDGE_LIVENESS_V1, AGENT_DECK_HOST_SESSION_ID_HEADER, AGENT_DECK_PLAYBOOK_PIN_HEADER, } from './constants/client-scope';
21
23
  export { AGENT_DECK_SESSION_HEADER, AGENT_DECK_DASHBOARD_COOKIE, RUNTIME_SESSION_LEASE_MS, ADMIN_MODE_LEASE_MS, ADMIN_CHALLENGE_TTL_MS, DASHBOARD_NONCE_TTL_MS, DASHBOARD_SESSION_LEASE_MS, DASHBOARD_COOKIE_MAX_AGE_MS, } from './constants/trusted-session';
22
24
  export { MCP_CARD_COLOR, API_KEY_CARD_COLOR, PLAYBOOK_CARD_COLOR, getServiceCardColor } from './constants/card-colors';
23
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAC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xB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,mCAAmC,EACnC,iCAAiC,EACjC,6BAA6B,EAC7B,iCAAiC,EACjC,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.getServiceCardColor = exports.PLAYBOOK_CARD_COLOR = exports.API_KEY_CARD_COLOR = exports.MCP_CARD_COLOR = exports.DASHBOARD_COOKIE_MAX_AGE_MS = exports.DASHBOARD_SESSION_LEASE_MS = exports.DASHBOARD_NONCE_TTL_MS = exports.ADMIN_CHALLENGE_TTL_MS = exports.ADMIN_MODE_LEASE_MS = exports.RUNTIME_SESSION_LEASE_MS = exports.AGENT_DECK_DASHBOARD_COOKIE = exports.AGENT_DECK_SESSION_HEADER = exports.AGENT_DECK_HOST_SESSION_ID_HEADER = exports.AGENT_DECK_BRIDGE_LIVENESS_V1 = exports.AGENT_DECK_BRIDGE_LIVENESS_HEADER = exports.AGENT_DECK_RECOVERED_SESSION_HEADER = exports.AGENT_DECK_CORRELATION_HEADER = exports.AGENT_DECK_DECK_ID_HEADER = exports.AGENT_DECK_WORKSPACE_HEADER = exports.AGENT_DECK_AGENT_CLIENT = exports.AGENT_DECK_DASHBOARD_CLIENT = exports.AGENT_DECK_CLIENT_HEADER = exports.stripJsonMarkdownFences = exports.parseLocalMcpManifestJson = exports.normalizeLocalMcpManifestInput = exports.primaryCollectionWarning = exports.getPlaybookWarnings = exports.getCredentialWarnings = exports.getServiceWarnings = exports.summarizeCollectionWarnings = void 0;
17
+ exports.getServiceCardColor = exports.PLAYBOOK_CARD_COLOR = exports.API_KEY_CARD_COLOR = exports.MCP_CARD_COLOR = exports.DASHBOARD_COOKIE_MAX_AGE_MS = exports.DASHBOARD_SESSION_LEASE_MS = exports.DASHBOARD_NONCE_TTL_MS = exports.ADMIN_CHALLENGE_TTL_MS = exports.ADMIN_MODE_LEASE_MS = exports.RUNTIME_SESSION_LEASE_MS = exports.AGENT_DECK_DASHBOARD_COOKIE = exports.AGENT_DECK_SESSION_HEADER = exports.AGENT_DECK_PLAYBOOK_PIN_HEADER = exports.AGENT_DECK_HOST_SESSION_ID_HEADER = exports.AGENT_DECK_BRIDGE_LIVENESS_V1 = exports.AGENT_DECK_BRIDGE_LIVENESS_HEADER = exports.AGENT_DECK_RECOVERED_SESSION_HEADER = exports.AGENT_DECK_CORRELATION_HEADER = exports.AGENT_DECK_DECK_ID_HEADER = exports.AGENT_DECK_WORKSPACE_HEADER = exports.AGENT_DECK_AGENT_CLIENT = exports.AGENT_DECK_DASHBOARD_CLIENT = exports.AGENT_DECK_CLIENT_HEADER = exports.stripJsonMarkdownFences = exports.parseLocalMcpManifestJson = exports.normalizeLocalMcpManifestInput = exports.primaryCollectionWarning = exports.getPlaybookWarnings = exports.getCredentialWarnings = exports.getServiceWarnings = exports.summarizeCollectionWarnings = void 0;
18
18
  // Schemas (includes Zod-inferred types)
19
19
  __exportStar(require("./schemas/service"), exports);
20
20
  __exportStar(require("./schemas/deck"), exports);
@@ -23,6 +23,7 @@ __exportStar(require("./schemas/oauth"), exports);
23
23
  __exportStar(require("./schemas/playbook"), exports);
24
24
  __exportStar(require("./schemas/playbook-patch"), exports);
25
25
  __exportStar(require("./schemas/feedback-signal"), exports);
26
+ __exportStar(require("./schemas/evaluation-scenario"), exports);
26
27
  __exportStar(require("./schemas/deck-display"), exports);
27
28
  __exportStar(require("./schemas/export-bundle"), exports);
28
29
  __exportStar(require("./schemas/store"), exports);
@@ -30,6 +31,7 @@ __exportStar(require("./schemas/session-bootstrap"), exports);
30
31
  __exportStar(require("./schemas/trusted-session"), exports);
31
32
  __exportStar(require("./schemas/card-usage"), exports);
32
33
  __exportStar(require("./schemas/agent-run"), exports);
34
+ __exportStar(require("./schemas/playbook-pin"), exports);
33
35
  // Additional types not covered by schemas
34
36
  __exportStar(require("./types/api"), exports);
35
37
  // Utils
@@ -56,6 +58,7 @@ Object.defineProperty(exports, "AGENT_DECK_RECOVERED_SESSION_HEADER", { enumerab
56
58
  Object.defineProperty(exports, "AGENT_DECK_BRIDGE_LIVENESS_HEADER", { enumerable: true, get: function () { return client_scope_1.AGENT_DECK_BRIDGE_LIVENESS_HEADER; } });
57
59
  Object.defineProperty(exports, "AGENT_DECK_BRIDGE_LIVENESS_V1", { enumerable: true, get: function () { return client_scope_1.AGENT_DECK_BRIDGE_LIVENESS_V1; } });
58
60
  Object.defineProperty(exports, "AGENT_DECK_HOST_SESSION_ID_HEADER", { enumerable: true, get: function () { return client_scope_1.AGENT_DECK_HOST_SESSION_ID_HEADER; } });
61
+ Object.defineProperty(exports, "AGENT_DECK_PLAYBOOK_PIN_HEADER", { enumerable: true, get: function () { return client_scope_1.AGENT_DECK_PLAYBOOK_PIN_HEADER; } });
59
62
  var trusted_session_1 = require("./constants/trusted-session");
60
63
  Object.defineProperty(exports, "AGENT_DECK_SESSION_HEADER", { enumerable: true, get: function () { return trusted_session_1.AGENT_DECK_SESSION_HEADER; } });
61
64
  Object.defineProperty(exports, "AGENT_DECK_DASHBOARD_COOKIE", { enumerable: true, get: function () { return trusted_session_1.AGENT_DECK_DASHBOARD_COOKIE; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@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B,6HAAA,0BAA0B,OAAA;AAC1B,8HAAA,2BAA2B,OAAA;AAE7B,uDAAuH;AAA9G,6GAAA,cAAc,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AAAE,kHAAA,mBAAmB,OAAA;AAAE,kHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,439 @@
1
+ import { z } from 'zod';
2
+ /** Frozen-output checks supported by the deterministic experiment evaluator. */
3
+ export declare const DeterministicExpectationSchema: z.ZodUnion<[z.ZodObject<{
4
+ id: z.ZodString;
5
+ value: z.ZodString;
6
+ } & {
7
+ type: z.ZodEnum<["contains", "not_contains", "equals"]>;
8
+ caseSensitive: z.ZodOptional<z.ZodBoolean>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ id: string;
11
+ type: "contains" | "not_contains" | "equals";
12
+ value: string;
13
+ caseSensitive?: boolean | undefined;
14
+ }, {
15
+ id: string;
16
+ type: "contains" | "not_contains" | "equals";
17
+ value: string;
18
+ caseSensitive?: boolean | undefined;
19
+ }>, z.ZodEffects<z.ZodObject<{
20
+ id: z.ZodString;
21
+ value: z.ZodString;
22
+ } & {
23
+ type: z.ZodLiteral<"regex">;
24
+ flags: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ id: string;
27
+ type: "regex";
28
+ value: string;
29
+ flags?: string | undefined;
30
+ }, {
31
+ id: string;
32
+ type: "regex";
33
+ value: string;
34
+ flags?: string | undefined;
35
+ }>, {
36
+ id: string;
37
+ type: "regex";
38
+ value: string;
39
+ flags?: string | undefined;
40
+ }, {
41
+ id: string;
42
+ type: "regex";
43
+ value: string;
44
+ flags?: string | undefined;
45
+ }>]>;
46
+ export type DeterministicExpectation = z.infer<typeof DeterministicExpectationSchema>;
47
+ export declare const EvaluationScenarioIdSchema: z.ZodString;
48
+ export declare const EvaluationScenarioStatusSchema: z.ZodEnum<["draft", "ready", "retired"]>;
49
+ export declare const EvaluationScenarioSchema: z.ZodEffects<z.ZodObject<{
50
+ taskInput: z.ZodString;
51
+ historicalFailedOutput: z.ZodNullable<z.ZodString>;
52
+ expectations: z.ZodArray<z.ZodUnion<[z.ZodObject<{
53
+ id: z.ZodString;
54
+ value: z.ZodString;
55
+ } & {
56
+ type: z.ZodEnum<["contains", "not_contains", "equals"]>;
57
+ caseSensitive: z.ZodOptional<z.ZodBoolean>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ id: string;
60
+ type: "contains" | "not_contains" | "equals";
61
+ value: string;
62
+ caseSensitive?: boolean | undefined;
63
+ }, {
64
+ id: string;
65
+ type: "contains" | "not_contains" | "equals";
66
+ value: string;
67
+ caseSensitive?: boolean | undefined;
68
+ }>, z.ZodEffects<z.ZodObject<{
69
+ id: z.ZodString;
70
+ value: z.ZodString;
71
+ } & {
72
+ type: z.ZodLiteral<"regex">;
73
+ flags: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ id: string;
76
+ type: "regex";
77
+ value: string;
78
+ flags?: string | undefined;
79
+ }, {
80
+ id: string;
81
+ type: "regex";
82
+ value: string;
83
+ flags?: string | undefined;
84
+ }>, {
85
+ id: string;
86
+ type: "regex";
87
+ value: string;
88
+ flags?: string | undefined;
89
+ }, {
90
+ id: string;
91
+ type: "regex";
92
+ value: string;
93
+ flags?: string | undefined;
94
+ }>]>, "many">;
95
+ sourceSignalIds: z.ZodArray<z.ZodString, "many">;
96
+ status: z.ZodEnum<["draft", "ready", "retired"]>;
97
+ } & {
98
+ id: z.ZodString;
99
+ targetPlaybookId: z.ZodString;
100
+ name: z.ZodString;
101
+ description: z.ZodDefault<z.ZodString>;
102
+ createdAt: z.ZodString;
103
+ updatedAt: z.ZodString;
104
+ }, "strip", z.ZodTypeAny, {
105
+ id: string;
106
+ name: string;
107
+ status: "draft" | "ready" | "retired";
108
+ description: string;
109
+ updatedAt: string;
110
+ createdAt: string;
111
+ taskInput: string;
112
+ historicalFailedOutput: string | null;
113
+ expectations: ({
114
+ id: string;
115
+ type: "contains" | "not_contains" | "equals";
116
+ value: string;
117
+ caseSensitive?: boolean | undefined;
118
+ } | {
119
+ id: string;
120
+ type: "regex";
121
+ value: string;
122
+ flags?: string | undefined;
123
+ })[];
124
+ sourceSignalIds: string[];
125
+ targetPlaybookId: string;
126
+ }, {
127
+ id: string;
128
+ name: string;
129
+ status: "draft" | "ready" | "retired";
130
+ updatedAt: string;
131
+ createdAt: string;
132
+ taskInput: string;
133
+ historicalFailedOutput: string | null;
134
+ expectations: ({
135
+ id: string;
136
+ type: "contains" | "not_contains" | "equals";
137
+ value: string;
138
+ caseSensitive?: boolean | undefined;
139
+ } | {
140
+ id: string;
141
+ type: "regex";
142
+ value: string;
143
+ flags?: string | undefined;
144
+ })[];
145
+ sourceSignalIds: string[];
146
+ targetPlaybookId: string;
147
+ description?: string | undefined;
148
+ }>, {
149
+ id: string;
150
+ name: string;
151
+ status: "draft" | "ready" | "retired";
152
+ description: string;
153
+ updatedAt: string;
154
+ createdAt: string;
155
+ taskInput: string;
156
+ historicalFailedOutput: string | null;
157
+ expectations: ({
158
+ id: string;
159
+ type: "contains" | "not_contains" | "equals";
160
+ value: string;
161
+ caseSensitive?: boolean | undefined;
162
+ } | {
163
+ id: string;
164
+ type: "regex";
165
+ value: string;
166
+ flags?: string | undefined;
167
+ })[];
168
+ sourceSignalIds: string[];
169
+ targetPlaybookId: string;
170
+ }, {
171
+ id: string;
172
+ name: string;
173
+ status: "draft" | "ready" | "retired";
174
+ updatedAt: string;
175
+ createdAt: string;
176
+ taskInput: string;
177
+ historicalFailedOutput: string | null;
178
+ expectations: ({
179
+ id: string;
180
+ type: "contains" | "not_contains" | "equals";
181
+ value: string;
182
+ caseSensitive?: boolean | undefined;
183
+ } | {
184
+ id: string;
185
+ type: "regex";
186
+ value: string;
187
+ flags?: string | undefined;
188
+ })[];
189
+ sourceSignalIds: string[];
190
+ targetPlaybookId: string;
191
+ description?: string | undefined;
192
+ }>;
193
+ export type EvaluationScenario = z.infer<typeof EvaluationScenarioSchema>;
194
+ export type EvaluationScenarioStatus = z.infer<typeof EvaluationScenarioStatusSchema>;
195
+ export declare const CreateEvaluationScenarioSchema: z.ZodEffects<z.ZodObject<{} & {
196
+ id: z.ZodOptional<z.ZodString>;
197
+ targetPlaybookId: z.ZodString;
198
+ name: z.ZodString;
199
+ description: z.ZodDefault<z.ZodString>;
200
+ taskInput: z.ZodDefault<z.ZodString>;
201
+ historicalFailedOutput: z.ZodDefault<z.ZodNullable<z.ZodString>>;
202
+ expectations: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodObject<{
203
+ id: z.ZodString;
204
+ value: z.ZodString;
205
+ } & {
206
+ type: z.ZodEnum<["contains", "not_contains", "equals"]>;
207
+ caseSensitive: z.ZodOptional<z.ZodBoolean>;
208
+ }, "strip", z.ZodTypeAny, {
209
+ id: string;
210
+ type: "contains" | "not_contains" | "equals";
211
+ value: string;
212
+ caseSensitive?: boolean | undefined;
213
+ }, {
214
+ id: string;
215
+ type: "contains" | "not_contains" | "equals";
216
+ value: string;
217
+ caseSensitive?: boolean | undefined;
218
+ }>, z.ZodEffects<z.ZodObject<{
219
+ id: z.ZodString;
220
+ value: z.ZodString;
221
+ } & {
222
+ type: z.ZodLiteral<"regex">;
223
+ flags: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
224
+ }, "strip", z.ZodTypeAny, {
225
+ id: string;
226
+ type: "regex";
227
+ value: string;
228
+ flags?: string | undefined;
229
+ }, {
230
+ id: string;
231
+ type: "regex";
232
+ value: string;
233
+ flags?: string | undefined;
234
+ }>, {
235
+ id: string;
236
+ type: "regex";
237
+ value: string;
238
+ flags?: string | undefined;
239
+ }, {
240
+ id: string;
241
+ type: "regex";
242
+ value: string;
243
+ flags?: string | undefined;
244
+ }>]>, "many">>;
245
+ sourceSignalIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
246
+ status: z.ZodDefault<z.ZodEnum<["draft", "ready", "retired"]>>;
247
+ }, "strip", z.ZodTypeAny, {
248
+ name: string;
249
+ status: "draft" | "ready" | "retired";
250
+ description: string;
251
+ taskInput: string;
252
+ historicalFailedOutput: string | null;
253
+ expectations: ({
254
+ id: string;
255
+ type: "contains" | "not_contains" | "equals";
256
+ value: string;
257
+ caseSensitive?: boolean | undefined;
258
+ } | {
259
+ id: string;
260
+ type: "regex";
261
+ value: string;
262
+ flags?: string | undefined;
263
+ })[];
264
+ sourceSignalIds: string[];
265
+ targetPlaybookId: string;
266
+ id?: string | undefined;
267
+ }, {
268
+ name: string;
269
+ targetPlaybookId: string;
270
+ id?: string | undefined;
271
+ status?: "draft" | "ready" | "retired" | undefined;
272
+ description?: string | undefined;
273
+ taskInput?: string | undefined;
274
+ historicalFailedOutput?: string | null | undefined;
275
+ expectations?: ({
276
+ id: string;
277
+ type: "contains" | "not_contains" | "equals";
278
+ value: string;
279
+ caseSensitive?: boolean | undefined;
280
+ } | {
281
+ id: string;
282
+ type: "regex";
283
+ value: string;
284
+ flags?: string | undefined;
285
+ })[] | undefined;
286
+ sourceSignalIds?: string[] | undefined;
287
+ }>, {
288
+ name: string;
289
+ status: "draft" | "ready" | "retired";
290
+ description: string;
291
+ taskInput: string;
292
+ historicalFailedOutput: string | null;
293
+ expectations: ({
294
+ id: string;
295
+ type: "contains" | "not_contains" | "equals";
296
+ value: string;
297
+ caseSensitive?: boolean | undefined;
298
+ } | {
299
+ id: string;
300
+ type: "regex";
301
+ value: string;
302
+ flags?: string | undefined;
303
+ })[];
304
+ sourceSignalIds: string[];
305
+ targetPlaybookId: string;
306
+ id?: string | undefined;
307
+ }, {
308
+ name: string;
309
+ targetPlaybookId: string;
310
+ id?: string | undefined;
311
+ status?: "draft" | "ready" | "retired" | undefined;
312
+ description?: string | undefined;
313
+ taskInput?: string | undefined;
314
+ historicalFailedOutput?: string | null | undefined;
315
+ expectations?: ({
316
+ id: string;
317
+ type: "contains" | "not_contains" | "equals";
318
+ value: string;
319
+ caseSensitive?: boolean | undefined;
320
+ } | {
321
+ id: string;
322
+ type: "regex";
323
+ value: string;
324
+ flags?: string | undefined;
325
+ })[] | undefined;
326
+ sourceSignalIds?: string[] | undefined;
327
+ }>;
328
+ export type CreateEvaluationScenarioInput = z.infer<typeof CreateEvaluationScenarioSchema>;
329
+ export declare const UpdateEvaluationScenarioSchema: z.ZodObject<{
330
+ targetPlaybookId: z.ZodOptional<z.ZodString>;
331
+ name: z.ZodOptional<z.ZodString>;
332
+ description: z.ZodOptional<z.ZodString>;
333
+ taskInput: z.ZodOptional<z.ZodString>;
334
+ historicalFailedOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
335
+ expectations: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
336
+ id: z.ZodString;
337
+ value: z.ZodString;
338
+ } & {
339
+ type: z.ZodEnum<["contains", "not_contains", "equals"]>;
340
+ caseSensitive: z.ZodOptional<z.ZodBoolean>;
341
+ }, "strip", z.ZodTypeAny, {
342
+ id: string;
343
+ type: "contains" | "not_contains" | "equals";
344
+ value: string;
345
+ caseSensitive?: boolean | undefined;
346
+ }, {
347
+ id: string;
348
+ type: "contains" | "not_contains" | "equals";
349
+ value: string;
350
+ caseSensitive?: boolean | undefined;
351
+ }>, z.ZodEffects<z.ZodObject<{
352
+ id: z.ZodString;
353
+ value: z.ZodString;
354
+ } & {
355
+ type: z.ZodLiteral<"regex">;
356
+ flags: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
357
+ }, "strip", z.ZodTypeAny, {
358
+ id: string;
359
+ type: "regex";
360
+ value: string;
361
+ flags?: string | undefined;
362
+ }, {
363
+ id: string;
364
+ type: "regex";
365
+ value: string;
366
+ flags?: string | undefined;
367
+ }>, {
368
+ id: string;
369
+ type: "regex";
370
+ value: string;
371
+ flags?: string | undefined;
372
+ }, {
373
+ id: string;
374
+ type: "regex";
375
+ value: string;
376
+ flags?: string | undefined;
377
+ }>]>, "many">>;
378
+ sourceSignalIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
379
+ status: z.ZodOptional<z.ZodEnum<["draft", "ready", "retired"]>>;
380
+ }, "strip", z.ZodTypeAny, {
381
+ name?: string | undefined;
382
+ status?: "draft" | "ready" | "retired" | undefined;
383
+ description?: string | undefined;
384
+ taskInput?: string | undefined;
385
+ historicalFailedOutput?: string | null | undefined;
386
+ expectations?: ({
387
+ id: string;
388
+ type: "contains" | "not_contains" | "equals";
389
+ value: string;
390
+ caseSensitive?: boolean | undefined;
391
+ } | {
392
+ id: string;
393
+ type: "regex";
394
+ value: string;
395
+ flags?: string | undefined;
396
+ })[] | undefined;
397
+ sourceSignalIds?: string[] | undefined;
398
+ targetPlaybookId?: string | undefined;
399
+ }, {
400
+ name?: string | undefined;
401
+ status?: "draft" | "ready" | "retired" | undefined;
402
+ description?: string | undefined;
403
+ taskInput?: string | undefined;
404
+ historicalFailedOutput?: string | null | undefined;
405
+ expectations?: ({
406
+ id: string;
407
+ type: "contains" | "not_contains" | "equals";
408
+ value: string;
409
+ caseSensitive?: boolean | undefined;
410
+ } | {
411
+ id: string;
412
+ type: "regex";
413
+ value: string;
414
+ flags?: string | undefined;
415
+ })[] | undefined;
416
+ sourceSignalIds?: string[] | undefined;
417
+ targetPlaybookId?: string | undefined;
418
+ }>;
419
+ export type UpdateEvaluationScenarioInput = z.infer<typeof UpdateEvaluationScenarioSchema>;
420
+ export declare const ListEvaluationScenariosQuerySchema: z.ZodObject<{
421
+ targetPlaybookId: z.ZodOptional<z.ZodString>;
422
+ status: z.ZodOptional<z.ZodEnum<["draft", "ready", "retired"]>>;
423
+ }, "strip", z.ZodTypeAny, {
424
+ status?: "draft" | "ready" | "retired" | undefined;
425
+ targetPlaybookId?: string | undefined;
426
+ }, {
427
+ status?: "draft" | "ready" | "retired" | undefined;
428
+ targetPlaybookId?: string | undefined;
429
+ }>;
430
+ export type ListEvaluationScenariosQuery = z.infer<typeof ListEvaluationScenariosQuerySchema>;
431
+ export type EvaluationScenarioExperimentCase = {
432
+ id: string;
433
+ description: string;
434
+ sourceSignalIds: string[];
435
+ expectations: DeterministicExpectation[];
436
+ };
437
+ /** Exact deterministic evaluator case shape; intentionally excludes task/output observations. */
438
+ export declare function evaluationScenarioToExperimentCase(scenario: EvaluationScenario): EvaluationScenarioExperimentCase;
439
+ //# sourceMappingURL=evaluation-scenario.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluation-scenario.d.ts","sourceRoot":"","sources":["../../src/schemas/evaluation-scenario.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB,gFAAgF;AAChF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,0BAA0B,aAEwB,CAAC;AAEhE,eAAO,MAAM,8BAA8B,0CAAwC,CAAC;AAyEpF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEpC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUF,CAAC;AAE1C,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAE3F,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASzC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAE3F,eAAO,MAAM,kCAAkC;;;;;;;;;EAG7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,MAAM,MAAM,gCAAgC,GAAG;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,EAAE,wBAAwB,EAAE,CAAC;CAC1C,CAAC;AAEF,iGAAiG;AACjG,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,kBAAkB,GAC3B,gCAAgC,CAOlC"}
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListEvaluationScenariosQuerySchema = exports.UpdateEvaluationScenarioSchema = exports.CreateEvaluationScenarioSchema = exports.EvaluationScenarioSchema = exports.EvaluationScenarioStatusSchema = exports.EvaluationScenarioIdSchema = exports.DeterministicExpectationSchema = void 0;
4
+ exports.evaluationScenarioToExperimentCase = evaluationScenarioToExperimentCase;
5
+ const zod_1 = require("zod");
6
+ const feedback_signal_1 = require("./feedback-signal");
7
+ const playbook_1 = require("./playbook");
8
+ const ExpectationBaseSchema = zod_1.z.object({
9
+ id: zod_1.z.string().trim().min(1, 'Expectation id is required'),
10
+ value: zod_1.z.string().min(1, 'Expectation value is required'),
11
+ });
12
+ const TextExpectationSchema = ExpectationBaseSchema.extend({
13
+ type: zod_1.z.enum(['contains', 'not_contains', 'equals']),
14
+ caseSensitive: zod_1.z.boolean().optional(),
15
+ });
16
+ const RegexExpectationSchema = ExpectationBaseSchema.extend({
17
+ type: zod_1.z.literal('regex'),
18
+ flags: zod_1.z
19
+ .string()
20
+ .regex(/^[imsu]*$/, 'Regex flags may only contain i, m, s, and u')
21
+ .refine((flags) => new Set(flags).size === flags.length, 'Regex flags must not repeat')
22
+ .optional(),
23
+ }).superRefine((expectation, ctx) => {
24
+ try {
25
+ new RegExp(expectation.value, expectation.flags ?? '');
26
+ }
27
+ catch (error) {
28
+ ctx.addIssue({
29
+ code: zod_1.z.ZodIssueCode.custom,
30
+ path: ['value'],
31
+ message: `Invalid regular expression: ${error instanceof Error ? error.message : String(error)}`,
32
+ });
33
+ }
34
+ });
35
+ /** Frozen-output checks supported by the deterministic experiment evaluator. */
36
+ exports.DeterministicExpectationSchema = zod_1.z.union([
37
+ TextExpectationSchema,
38
+ RegexExpectationSchema,
39
+ ]);
40
+ exports.EvaluationScenarioIdSchema = zod_1.z
41
+ .string()
42
+ .regex(/^es_[a-z0-9_]+$/, 'Scenario id must match es_<slug>');
43
+ exports.EvaluationScenarioStatusSchema = zod_1.z.enum(['draft', 'ready', 'retired']);
44
+ const ScenarioEvidenceSchema = zod_1.z.object({
45
+ taskInput: zod_1.z.string(),
46
+ historicalFailedOutput: zod_1.z.string().nullable(),
47
+ expectations: zod_1.z.array(exports.DeterministicExpectationSchema),
48
+ sourceSignalIds: zod_1.z.array(feedback_signal_1.FeedbackSignalIdSchema),
49
+ status: exports.EvaluationScenarioStatusSchema,
50
+ });
51
+ function addScenarioEvidenceIssues(scenario, ctx) {
52
+ const duplicateExpectationIds = scenario.expectations
53
+ .map((expectation) => expectation.id)
54
+ .filter((id, index, ids) => ids.indexOf(id) !== index);
55
+ if (duplicateExpectationIds.length > 0) {
56
+ ctx.addIssue({
57
+ code: zod_1.z.ZodIssueCode.custom,
58
+ path: ['expectations'],
59
+ message: 'Expectation ids must be unique',
60
+ });
61
+ }
62
+ if (new Set(scenario.sourceSignalIds).size !== scenario.sourceSignalIds.length) {
63
+ ctx.addIssue({
64
+ code: zod_1.z.ZodIssueCode.custom,
65
+ path: ['sourceSignalIds'],
66
+ message: 'Source signal ids must be unique',
67
+ });
68
+ }
69
+ if (scenario.status !== 'ready')
70
+ return;
71
+ if (scenario.taskInput.trim().length === 0) {
72
+ ctx.addIssue({
73
+ code: zod_1.z.ZodIssueCode.custom,
74
+ path: ['taskInput'],
75
+ message: 'Ready scenarios require task input',
76
+ });
77
+ }
78
+ if (!scenario.historicalFailedOutput?.trim()) {
79
+ ctx.addIssue({
80
+ code: zod_1.z.ZodIssueCode.custom,
81
+ path: ['historicalFailedOutput'],
82
+ message: 'Ready scenarios require a historical failed output',
83
+ });
84
+ }
85
+ if (scenario.sourceSignalIds.length === 0) {
86
+ ctx.addIssue({
87
+ code: zod_1.z.ZodIssueCode.custom,
88
+ path: ['sourceSignalIds'],
89
+ message: 'Ready scenarios require at least one source signal',
90
+ });
91
+ }
92
+ if (scenario.expectations.length === 0) {
93
+ ctx.addIssue({
94
+ code: zod_1.z.ZodIssueCode.custom,
95
+ path: ['expectations'],
96
+ message: 'Ready scenarios require at least one deterministic expectation',
97
+ });
98
+ }
99
+ }
100
+ const EvaluationScenarioFieldsSchema = ScenarioEvidenceSchema.extend({
101
+ id: exports.EvaluationScenarioIdSchema,
102
+ targetPlaybookId: playbook_1.PlaybookIdSchema,
103
+ name: zod_1.z.string().trim().min(1, 'Name is required'),
104
+ description: zod_1.z.string().default(''),
105
+ createdAt: zod_1.z.string().datetime(),
106
+ updatedAt: zod_1.z.string().datetime(),
107
+ });
108
+ exports.EvaluationScenarioSchema = EvaluationScenarioFieldsSchema.superRefine(addScenarioEvidenceIssues);
109
+ exports.CreateEvaluationScenarioSchema = ScenarioEvidenceSchema.extend({
110
+ id: exports.EvaluationScenarioIdSchema.optional(),
111
+ targetPlaybookId: playbook_1.PlaybookIdSchema,
112
+ name: zod_1.z.string().trim().min(1, 'Name is required'),
113
+ description: zod_1.z.string().default(''),
114
+ taskInput: zod_1.z.string().default(''),
115
+ historicalFailedOutput: zod_1.z.string().nullable().default(null),
116
+ expectations: zod_1.z.array(exports.DeterministicExpectationSchema).default([]),
117
+ sourceSignalIds: zod_1.z.array(feedback_signal_1.FeedbackSignalIdSchema).default([]),
118
+ status: exports.EvaluationScenarioStatusSchema.default('draft'),
119
+ }).superRefine(addScenarioEvidenceIssues);
120
+ exports.UpdateEvaluationScenarioSchema = zod_1.z.object({
121
+ targetPlaybookId: playbook_1.PlaybookIdSchema.optional(),
122
+ name: zod_1.z.string().trim().min(1, 'Name is required').optional(),
123
+ description: zod_1.z.string().optional(),
124
+ taskInput: zod_1.z.string().optional(),
125
+ historicalFailedOutput: zod_1.z.string().nullable().optional(),
126
+ expectations: zod_1.z.array(exports.DeterministicExpectationSchema).optional(),
127
+ sourceSignalIds: zod_1.z.array(feedback_signal_1.FeedbackSignalIdSchema).optional(),
128
+ status: exports.EvaluationScenarioStatusSchema.optional(),
129
+ });
130
+ exports.ListEvaluationScenariosQuerySchema = zod_1.z.object({
131
+ targetPlaybookId: playbook_1.PlaybookIdSchema.optional(),
132
+ status: exports.EvaluationScenarioStatusSchema.optional(),
133
+ });
134
+ /** Exact deterministic evaluator case shape; intentionally excludes task/output observations. */
135
+ function evaluationScenarioToExperimentCase(scenario) {
136
+ return {
137
+ id: scenario.id,
138
+ description: scenario.description,
139
+ sourceSignalIds: [...scenario.sourceSignalIds],
140
+ expectations: scenario.expectations.map((expectation) => ({ ...expectation })),
141
+ };
142
+ }
143
+ //# sourceMappingURL=evaluation-scenario.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluation-scenario.js","sourceRoot":"","sources":["../../src/schemas/evaluation-scenario.ts"],"names":[],"mappings":";;;AAuKA,gFASC;AAhLD,6BAAwB;AACxB,uDAA2D;AAC3D,yCAA8C;AAE9C,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,OAAC,CAAC,M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AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * One pinned playbook version for a run's MCP session (NOT-537).
3
+ *
4
+ * The pin travels as `<playbookId>=<versionId>` — the `--playbook-version`
5
+ * flag value, the run's pin env var, and the `x-agent-deck-playbook-pin`
6
+ * launch header all share this shape. One pin per run; it lives only as
7
+ * long as the run's MCP session.
8
+ */
9
+ export type PlaybookPin = {
10
+ playbookId: string;
11
+ versionId: string;
12
+ };
13
+ /**
14
+ * Parse a candidate pin, or return null when it is absent or malformed.
15
+ * Invalid values are dropped — never coerced — so untrusted input cannot
16
+ * smuggle task content into a session. The playbook id must match
17
+ * `pb_<slug>` and the version id must be a UUID (the only shape version
18
+ * snapshots are ever stored with).
19
+ */
20
+ export declare function normalizePlaybookPin(raw: unknown): PlaybookPin | null;
21
+ /** Canonical `<playbookId>=<versionId>` form for headers and env. */
22
+ export declare function formatPlaybookPin(pin: PlaybookPin): string;
23
+ //# sourceMappingURL=playbook-pin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playbook-pin.d.ts","sourceRoot":"","sources":["../../src/schemas/playbook-pin.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAkBrE;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizePlaybookPin = normalizePlaybookPin;
4
+ exports.formatPlaybookPin = formatPlaybookPin;
5
+ const id_1 = require("../utils/id");
6
+ const PLAYBOOK_ID_RE = /^pb_[a-z0-9_]+$/;
7
+ /**
8
+ * Parse a candidate pin, or return null when it is absent or malformed.
9
+ * Invalid values are dropped — never coerced — so untrusted input cannot
10
+ * smuggle task content into a session. The playbook id must match
11
+ * `pb_<slug>` and the version id must be a UUID (the only shape version
12
+ * snapshots are ever stored with).
13
+ */
14
+ function normalizePlaybookPin(raw) {
15
+ if (typeof raw !== 'string') {
16
+ return null;
17
+ }
18
+ const value = raw.trim();
19
+ if (!value) {
20
+ return null;
21
+ }
22
+ const separator = value.indexOf('=');
23
+ if (separator === -1 || value.indexOf('=', separator + 1) !== -1) {
24
+ return null;
25
+ }
26
+ const playbookId = value.slice(0, separator).trim();
27
+ const versionId = value.slice(separator + 1).trim();
28
+ if (!PLAYBOOK_ID_RE.test(playbookId) || !(0, id_1.isValidUUID)(versionId)) {
29
+ return null;
30
+ }
31
+ return { playbookId, versionId };
32
+ }
33
+ /** Canonical `<playbookId>=<versionId>` form for headers and env. */
34
+ function formatPlaybookPin(pin) {
35
+ return `${pin.playbookId}=${pin.versionId}`;
36
+ }
37
+ //# sourceMappingURL=playbook-pin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playbook-pin.js","sourceRoot":"","sources":["../../src/schemas/playbook-pin.ts"],"names":[],"mappings":";;AAwBA,oDAkBC;AAGD,8CAEC;AA/CD,oCAA0C;AAe1C,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAEzC;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,GAAY;IAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACzB,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,SAAS,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACjE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC;IACpD,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACpD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAA,gBAAW,EAAC,SAAS,CAAC,EAAE,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACnC,CAAC;AAED,qEAAqE;AACrE,SAAgB,iBAAiB,CAAC,GAAgB;IAChD,OAAO,GAAG,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;AAC9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-deck/shared",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "Shared types, schemas, and utilities for Agent Deck",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",