@superblocksteam/shared 0.9622.2 → 0.9623.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.
Files changed (111) hide show
  1. package/dist/front-door/index.d.ts +167 -0
  2. package/dist/front-door/index.d.ts.map +1 -0
  3. package/dist/front-door/index.js +85 -0
  4. package/dist/front-door/index.js.map +1 -0
  5. package/dist/front-door/index.test.d.ts +2 -0
  6. package/dist/front-door/index.test.d.ts.map +1 -0
  7. package/dist/front-door/index.test.js +91 -0
  8. package/dist/front-door/index.test.js.map +1 -0
  9. package/dist/jwt/index.d.ts +1 -0
  10. package/dist/jwt/index.d.ts.map +1 -1
  11. package/dist/jwt/index.js +1 -0
  12. package/dist/jwt/index.js.map +1 -1
  13. package/dist/jwt/jwksUri.d.ts +3 -0
  14. package/dist/jwt/jwksUri.d.ts.map +1 -0
  15. package/dist/jwt/jwksUri.js +27 -0
  16. package/dist/jwt/jwksUri.js.map +1 -0
  17. package/dist/jwt/jwksUri.test.d.ts +2 -0
  18. package/dist/jwt/jwksUri.test.d.ts.map +1 -0
  19. package/dist/jwt/jwksUri.test.js +35 -0
  20. package/dist/jwt/jwksUri.test.js.map +1 -0
  21. package/dist/socket/protocol.d.ts +3 -0
  22. package/dist/socket/protocol.d.ts.map +1 -1
  23. package/dist/types/ai/index.d.ts +4 -0
  24. package/dist/types/ai/index.d.ts.map +1 -1
  25. package/dist/types/ai/index.js +2 -0
  26. package/dist/types/ai/index.js.map +1 -1
  27. package/dist/types/ai/native-builder-model.d.ts +13 -1
  28. package/dist/types/ai/native-builder-model.d.ts.map +1 -1
  29. package/dist/types/ai/native-builder-model.js +50 -8
  30. package/dist/types/ai/native-builder-model.js.map +1 -1
  31. package/dist/types/ai/native-builder-model.test.js +15 -0
  32. package/dist/types/ai/native-builder-model.test.js.map +1 -1
  33. package/dist/types/ai/prompt-failure-shown-in-chat.d.ts +13 -0
  34. package/dist/types/ai/prompt-failure-shown-in-chat.d.ts.map +1 -0
  35. package/dist/types/ai/prompt-failure-shown-in-chat.js +16 -0
  36. package/dist/types/ai/prompt-failure-shown-in-chat.js.map +1 -0
  37. package/dist/types/ai/turn-in-progress.d.ts +11 -0
  38. package/dist/types/ai/turn-in-progress.d.ts.map +1 -0
  39. package/dist/types/ai/turn-in-progress.js +17 -0
  40. package/dist/types/ai/turn-in-progress.js.map +1 -0
  41. package/dist/types/ai/turn-in-progress.test.d.ts +2 -0
  42. package/dist/types/ai/turn-in-progress.test.d.ts.map +1 -0
  43. package/dist/types/ai/turn-in-progress.test.js +13 -0
  44. package/dist/types/ai/turn-in-progress.test.js.map +1 -0
  45. package/dist/types/application/index.d.ts +3 -0
  46. package/dist/types/application/index.d.ts.map +1 -1
  47. package/dist/types/application/index.js +2 -0
  48. package/dist/types/application/index.js.map +1 -1
  49. package/dist/types/audit/ocsf.d.ts.map +1 -1
  50. package/dist/types/audit/ocsf.js +12 -1
  51. package/dist/types/audit/ocsf.js.map +1 -1
  52. package/dist/types/index.d.ts +2 -0
  53. package/dist/types/index.d.ts.map +1 -1
  54. package/dist/types/index.js +2 -0
  55. package/dist/types/index.js.map +1 -1
  56. package/dist/types/runs/index.d.ts +156 -0
  57. package/dist/types/runs/index.d.ts.map +1 -0
  58. package/dist/types/runs/index.js +52 -0
  59. package/dist/types/runs/index.js.map +1 -0
  60. package/dist/types/runs/index.test.d.ts +2 -0
  61. package/dist/types/runs/index.test.d.ts.map +1 -0
  62. package/dist/types/runs/index.test.js +47 -0
  63. package/dist/types/runs/index.test.js.map +1 -0
  64. package/dist/types/scheduleTriggers/index.d.ts +60 -0
  65. package/dist/types/scheduleTriggers/index.d.ts.map +1 -0
  66. package/dist/types/scheduleTriggers/index.js +17 -0
  67. package/dist/types/scheduleTriggers/index.js.map +1 -0
  68. package/dist/types/scheduleTriggers/index.test.d.ts +2 -0
  69. package/dist/types/scheduleTriggers/index.test.d.ts.map +1 -0
  70. package/dist/types/scheduleTriggers/index.test.js +16 -0
  71. package/dist/types/scheduleTriggers/index.test.js.map +1 -0
  72. package/dist/utils/data-plane-routing.d.ts +24 -0
  73. package/dist/utils/data-plane-routing.d.ts.map +1 -0
  74. package/dist/utils/data-plane-routing.js +29 -0
  75. package/dist/utils/data-plane-routing.js.map +1 -0
  76. package/dist/utils/data-plane-routing.test.d.ts +2 -0
  77. package/dist/utils/data-plane-routing.test.d.ts.map +1 -0
  78. package/dist/utils/data-plane-routing.test.js +37 -0
  79. package/dist/utils/data-plane-routing.test.js.map +1 -0
  80. package/dist/utils/index.d.ts +1 -0
  81. package/dist/utils/index.d.ts.map +1 -1
  82. package/dist/utils/index.js +1 -0
  83. package/dist/utils/index.js.map +1 -1
  84. package/dist/utils/platform-mcp-server-routes.d.ts +50 -1
  85. package/dist/utils/platform-mcp-server-routes.d.ts.map +1 -1
  86. package/dist/utils/platform-mcp-server-routes.js +6 -0
  87. package/dist/utils/platform-mcp-server-routes.js.map +1 -1
  88. package/package.json +11 -6
  89. package/src/front-door/index.test.ts +116 -0
  90. package/src/front-door/index.ts +116 -0
  91. package/src/jwt/index.ts +1 -0
  92. package/src/jwt/jwksUri.test.ts +50 -0
  93. package/src/jwt/jwksUri.ts +30 -0
  94. package/src/socket/protocol.ts +9 -1
  95. package/src/types/ai/index.ts +4 -0
  96. package/src/types/ai/native-builder-model.test.ts +16 -0
  97. package/src/types/ai/native-builder-model.ts +58 -10
  98. package/src/types/ai/prompt-failure-shown-in-chat.ts +18 -0
  99. package/src/types/ai/turn-in-progress.test.ts +15 -0
  100. package/src/types/ai/turn-in-progress.ts +19 -0
  101. package/src/types/application/index.ts +5 -0
  102. package/src/types/audit/ocsf.ts +12 -1
  103. package/src/types/index.ts +2 -0
  104. package/src/types/runs/index.test.ts +66 -0
  105. package/src/types/runs/index.ts +277 -0
  106. package/src/types/scheduleTriggers/index.test.ts +24 -0
  107. package/src/types/scheduleTriggers/index.ts +103 -0
  108. package/src/utils/data-plane-routing.test.ts +41 -0
  109. package/src/utils/data-plane-routing.ts +36 -0
  110. package/src/utils/index.ts +1 -0
  111. package/src/utils/platform-mcp-server-routes.ts +39 -0
@@ -0,0 +1,156 @@
1
+ import type { AgentSessionMessage, AgentStreamEvent } from '../customAgents.js';
2
+ export declare const RUN_KINDS: readonly ['agent', 'function'];
3
+ export type RunKind = (typeof RUN_KINDS)[number];
4
+ export declare const RUN_MODES: readonly ['edit', 'deployed'];
5
+ export type RunMode = (typeof RUN_MODES)[number];
6
+ export declare const RUN_TRIGGER_TYPES: readonly ['api', 'schedule'];
7
+ export type RunTriggerType = (typeof RUN_TRIGGER_TYPES)[number];
8
+ export declare const RUN_IDENTITY_TYPES: readonly ['user', 'workload'];
9
+ export type RunIdentityType = (typeof RUN_IDENTITY_TYPES)[number];
10
+ export declare const RUN_STATUSES: readonly ['pending', 'running', 'succeeded', 'failed', 'timed_out', 'canceled', 'skipped', 'unknown'];
11
+ export type RunStatus = (typeof RUN_STATUSES)[number];
12
+ export declare const RUN_TERMINAL_STATUSES: readonly ["succeeded", "failed", "timed_out", "canceled", "skipped"];
13
+ export type RunTerminalStatus = (typeof RUN_TERMINAL_STATUSES)[number];
14
+ export declare const RUN_IN_PROGRESS_STATUSES: readonly ["pending", "running"];
15
+ export declare const RUN_CONTENT_TYPES: readonly ['input', 'agent_memory'];
16
+ export type RunContentType = (typeof RUN_CONTENT_TYPES)[number];
17
+ export declare const RUN_INPUT_MAX_BYTES: number;
18
+ export declare const RUN_IDEMPOTENCY_KEY_MAX_LENGTH = 128;
19
+ export declare const RUN_IDEMPOTENCY_KEY_HEADER = "Idempotency-Key";
20
+ export declare const RUN_DEFINITION_NAME_MAX_LENGTH = 64;
21
+ export declare const RUN_DEDUP_KEY_MAX_LENGTH = 255;
22
+ export declare const RUN_STATUS_MESSAGE_MAX_BYTES: number;
23
+ export type RunEditTarget = {
24
+ kind: 'function';
25
+ entryPoint: string;
26
+ exportName: string;
27
+ } | {
28
+ kind: 'agent';
29
+ };
30
+ export interface RunAttributes {
31
+ scheduledFor?: string;
32
+ target?: {
33
+ name: string;
34
+ } & RunEditTarget;
35
+ pinned?: {
36
+ name: string;
37
+ entryPoint: string | null;
38
+ exportName: string | null;
39
+ timeoutSeconds: number;
40
+ };
41
+ }
42
+ export interface RunAgentMemoryContent {
43
+ memoryId: string;
44
+ actorId: string;
45
+ sessionId: string;
46
+ }
47
+ export interface RunDto {
48
+ id: string;
49
+ kind: RunKind;
50
+ definitionId: string | null;
51
+ runMode: RunMode;
52
+ commitId: string | null;
53
+ branch: string | null;
54
+ dataTag: string;
55
+ triggerType: RunTriggerType;
56
+ triggerId: string | null;
57
+ identityType: RunIdentityType;
58
+ identityId: string;
59
+ status: RunStatus;
60
+ statusMessage: string | null;
61
+ created: string;
62
+ startedAt: string | null;
63
+ finishedAt: string | null;
64
+ }
65
+ interface CreateRunRequestBase {
66
+ dataTag: string;
67
+ input?: unknown;
68
+ }
69
+ export interface CreateDeployedRunRequest extends CreateRunRequestBase {
70
+ definitionId: string;
71
+ runMode: 'deployed';
72
+ }
73
+ export type CreateEditRunRequest = CreateRunRequestBase & {
74
+ definitionId: string;
75
+ runMode: 'edit';
76
+ branch: string;
77
+ } & RunEditTarget;
78
+ export type CreateUndeployedEditRunRequest = CreateRunRequestBase & {
79
+ projectId: string;
80
+ runMode: 'edit';
81
+ branch: string;
82
+ name: string;
83
+ } & RunEditTarget;
84
+ export type CreateRunRequest = CreateDeployedRunRequest | CreateEditRunRequest | CreateUndeployedEditRunRequest;
85
+ export interface CreateRunQuery {
86
+ wait?: boolean;
87
+ }
88
+ export interface CreateRunResponse {
89
+ runId: string;
90
+ }
91
+ export interface CreateRunSyncFunctionResponse {
92
+ runId: string;
93
+ status: RunStatus;
94
+ output: unknown;
95
+ }
96
+ export type RunAgentStreamEvent = AgentStreamEvent;
97
+ export type StopRunResponse = RunDto;
98
+ export type GetRunResponse = RunDto;
99
+ export interface ListRunsQuery {
100
+ projectId?: string;
101
+ definitionId?: string;
102
+ triggerId?: string;
103
+ status?: RunStatus;
104
+ triggerType?: RunTriggerType;
105
+ runMode?: RunMode;
106
+ cursor?: string;
107
+ }
108
+ export interface ListRunsResponse {
109
+ runs: RunDto[];
110
+ nextCursor: string | null;
111
+ }
112
+ export interface GetRunContentResponse {
113
+ input: unknown;
114
+ messages?: AgentSessionMessage[];
115
+ }
116
+ export interface RunDefinitionSummaryDto {
117
+ id: string;
118
+ kind: RunKind;
119
+ name: string;
120
+ projectId: string;
121
+ timeoutSeconds: number;
122
+ removedAt: string | null;
123
+ }
124
+ export interface RunDefinitionDto extends RunDefinitionSummaryDto {
125
+ entryPoint: string | null;
126
+ exportName: string | null;
127
+ }
128
+ export interface ListRunDefinitionsQuery {
129
+ projectId: string;
130
+ kind?: RunKind;
131
+ }
132
+ export interface ListRunDefinitionsResponse {
133
+ definitions: RunDefinitionSummaryDto[];
134
+ }
135
+ export type GetRunDefinitionResponse = RunDefinitionDto;
136
+ export declare const RUN_STATUS_UPDATE_TYPES: readonly ['started', 'heartbeat', 'finished'];
137
+ export type RunStatusUpdateType = (typeof RUN_STATUS_UPDATE_TYPES)[number];
138
+ export declare const RUN_FINISHED_STATUSES: readonly ["succeeded", "failed", "timed_out"];
139
+ export type RunFinishedStatus = (typeof RUN_FINISHED_STATUSES)[number];
140
+ interface RunStatusUpdateBase {
141
+ runId: string;
142
+ }
143
+ export interface RunStartedUpdate extends RunStatusUpdateBase {
144
+ type: 'started';
145
+ }
146
+ export interface RunHeartbeatUpdate extends RunStatusUpdateBase {
147
+ type: 'heartbeat';
148
+ }
149
+ export interface RunFinishedUpdate extends RunStatusUpdateBase {
150
+ type: 'finished';
151
+ status: RunFinishedStatus;
152
+ statusMessage?: string;
153
+ }
154
+ export type RunStatusUpdate = RunStartedUpdate | RunHeartbeatUpdate | RunFinishedUpdate;
155
+ export {};
156
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/runs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KA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AAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAQvE,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf;AAID,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,IAAI,EAAE,SAAS,CAAC;CACjB;AAID,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,IAAI,EAAE,WAAW,CAAC;CACnB;AAID,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,52 @@
1
+ // Run record contract: run_definition, run_record and run_record_content, the
2
+ // run API, and the run status updates. See the "Decision: Run record" doc.
3
+ //
4
+ // Type and status columns are `character varying`, checked in code against
5
+ // these lists (no database constraint), so adding a value needs no migration.
6
+ // A value is never removed once rows use it; to retire one, stop accepting it
7
+ // for new runs.
8
+ export const RUN_KINDS = ['agent', 'function'];
9
+ // `edit` runs the current files on a branch; `deployed` runs the deployed commit.
10
+ export const RUN_MODES = ['edit', 'deployed'];
11
+ // `api` covers direct calls to the run API, including Try it; `schedule` covers
12
+ // schedule fires. New trigger types are added with the feature that fires them.
13
+ export const RUN_TRIGGER_TYPES = ['api', 'schedule'];
14
+ // Set by the server from how the run was started; callers never send it.
15
+ export const RUN_IDENTITY_TYPES = ['user', 'workload'];
16
+ // `pending`: created, being handed to the orchestrator or AgentCore. There's no
17
+ // queue: if the executor doesn't accept the run, it's `failed` with the reason
18
+ // in status_message. `running`: the executor accepted it; from then on the
19
+ // lease must be kept alive by heartbeats.
20
+ export const RUN_STATUSES = ['pending', 'running', 'succeeded', 'failed', 'timed_out', 'canceled', 'skipped', 'unknown'];
21
+ // Final statuses never change. `unknown` is not one of them: a late
22
+ // `finished` update replaces it.
23
+ export const RUN_TERMINAL_STATUSES = ['succeeded', 'failed', 'timed_out', 'canceled', 'skipped'];
24
+ // A schedule fire is skipped while its previous run is in one of these.
25
+ export const RUN_IN_PROGRESS_STATUSES = ['pending', 'running'];
26
+ // `input`: a Function's arguments or an agent's prompt, written once by start
27
+ // run. `agent_memory`: where an agent run's conversation lives in AgentCore
28
+ // memory, one row per session.
29
+ export const RUN_CONTENT_TYPES = ['input', 'agent_memory'];
30
+ // `input` larger than this (serialized JSON) is refused with 400. Start run
31
+ // checks it, so schedules share the cap.
32
+ export const RUN_INPUT_MAX_BYTES = 256 * 1024;
33
+ export const RUN_IDEMPOTENCY_KEY_MAX_LENGTH = 128;
34
+ export const RUN_IDEMPOTENCY_KEY_HEADER = 'Idempotency-Key';
35
+ export const RUN_DEFINITION_NAME_MAX_LENGTH = 64;
36
+ export const RUN_DEDUP_KEY_MAX_LENGTH = 255;
37
+ // `status_message` is cut to this many bytes. It's the only error detail a
38
+ // failed run keeps.
39
+ export const RUN_STATUS_MESSAGE_MAX_BYTES = 4 * 1024;
40
+ // ---------------------------------------------------------------------------
41
+ // Run status updates: how a run moves through its lifecycle after start run.
42
+ // ---------------------------------------------------------------------------
43
+ // `started` is never posted: start run applies it from the executor's reply
44
+ // (the orchestrator's async /v3/execute, or AgentCore starting the session).
45
+ // The orchestrator posts `heartbeat` and `finished` for Function runs to
46
+ // POST /api/v1/agents/runs/:runId/status. Agent runs get all three from inside
47
+ // the server, which holds the AgentCore stream.
48
+ export const RUN_STATUS_UPDATE_TYPES = ['started', 'heartbeat', 'finished'];
49
+ // Statuses an executor can finish a run with. `canceled` comes from the stop
50
+ // route and kill switch; `skipped` and `unknown` from the scheduler and sweeper.
51
+ export const RUN_FINISHED_STATUSES = ['succeeded', 'failed', 'timed_out'];
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/runs/index.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B,CAAC;AAC5D,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AACjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,2EAA2E;AAC3E,oBAAoB;AACpB,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,GAAG,IAAI,CAAC;AA6KrD,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAE9E,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,+EAA+E;AAC/E,gDAAgD;AAChD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC;AAGrF,6EAA6E;AAC7E,iFAAiF;AACjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAyC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/types/runs/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ import { describe, expect, test } from 'vitest';
2
+ import { RUN_CONTENT_TYPES, RUN_FINISHED_STATUSES, RUN_IDENTITY_TYPES, RUN_IN_PROGRESS_STATUSES, RUN_INPUT_MAX_BYTES, RUN_KINDS, RUN_MODES, RUN_STATUS_MESSAGE_MAX_BYTES, RUN_STATUS_UPDATE_TYPES, RUN_STATUSES, RUN_TERMINAL_STATUSES, RUN_TRIGGER_TYPES } from './index.js';
3
+ // These are wire values and stored column values. Other services and stored
4
+ // rows depend on them, so changes must be deliberate.
5
+ describe('run record contract values', () => {
6
+ test('pins the stored and wire values', () => {
7
+ expect(RUN_KINDS).toEqual(['agent', 'function']);
8
+ expect(RUN_MODES).toEqual(['edit', 'deployed']);
9
+ expect(RUN_TRIGGER_TYPES).toEqual(['api', 'schedule']);
10
+ expect(RUN_IDENTITY_TYPES).toEqual(['user', 'workload']);
11
+ expect(RUN_STATUSES).toEqual(['pending', 'running', 'succeeded', 'failed', 'timed_out', 'canceled', 'skipped', 'unknown']);
12
+ expect(RUN_CONTENT_TYPES).toEqual(['input', 'agent_memory']);
13
+ expect(RUN_STATUS_UPDATE_TYPES).toEqual(['started', 'heartbeat', 'finished']);
14
+ });
15
+ test('every value is lowercase snake_case', () => {
16
+ const values = [
17
+ ...RUN_KINDS,
18
+ ...RUN_MODES,
19
+ ...RUN_TRIGGER_TYPES,
20
+ ...RUN_IDENTITY_TYPES,
21
+ ...RUN_STATUSES,
22
+ ...RUN_CONTENT_TYPES,
23
+ ...RUN_STATUS_UPDATE_TYPES
24
+ ];
25
+ for (const value of values) {
26
+ expect(value).toMatch(/^[a-z]+(_[a-z]+)*$/);
27
+ }
28
+ });
29
+ test('unknown is not terminal, so a late finished update can replace it', () => {
30
+ expect(RUN_TERMINAL_STATUSES).not.toContain('unknown');
31
+ expect(RUN_TERMINAL_STATUSES).toEqual(['succeeded', 'failed', 'timed_out', 'canceled', 'skipped']);
32
+ });
33
+ test('in-progress statuses do not overlap with terminal statuses', () => {
34
+ for (const status of RUN_IN_PROGRESS_STATUSES) {
35
+ expect(RUN_TERMINAL_STATUSES).not.toContain(status);
36
+ }
37
+ expect(RUN_IN_PROGRESS_STATUSES).toEqual(['pending', 'running']);
38
+ });
39
+ test('executors finish runs only as succeeded, failed or timed_out', () => {
40
+ expect(RUN_FINISHED_STATUSES).toEqual(['succeeded', 'failed', 'timed_out']);
41
+ });
42
+ test('input cap is 256 KB and status message cap is 4 KB', () => {
43
+ expect(RUN_INPUT_MAX_BYTES).toBe(262144);
44
+ expect(RUN_STATUS_MESSAGE_MAX_BYTES).toBe(4096);
45
+ });
46
+ });
47
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/types/runs/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ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C;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,60 @@
1
+ export declare const SCHEDULE_TRIGGER_STATUSES: readonly ['active', 'paused', 'disabled', 'errored'];
2
+ export type ScheduleTriggerStatus = (typeof SCHEDULE_TRIGGER_STATUSES)[number];
3
+ export declare const SCHEDULE_SPEC_TYPES: readonly ['cron', 'interval'];
4
+ export type ScheduleSpecType = (typeof SCHEDULE_SPEC_TYPES)[number];
5
+ export declare const SCHEDULE_TRIGGER_NAME_MAX_LENGTH = 128;
6
+ export declare const SCHEDULE_MIN_INTERVAL_SECONDS: number;
7
+ export declare const SCHEDULE_TRIGGERS_PER_PROJECT_DEFAULT = 50;
8
+ interface ScheduleSpecBase {
9
+ startAt?: string;
10
+ endAt?: string;
11
+ }
12
+ export interface CronScheduleSpec extends ScheduleSpecBase {
13
+ type: 'cron';
14
+ cron: string;
15
+ timezone: string;
16
+ }
17
+ export interface IntervalScheduleSpec extends ScheduleSpecBase {
18
+ type: 'interval';
19
+ every: string;
20
+ offset?: string;
21
+ }
22
+ export type ScheduleSpec = CronScheduleSpec | IntervalScheduleSpec;
23
+ export interface ScheduleTriggerDto {
24
+ id: string;
25
+ definitionId: string;
26
+ projectId: string;
27
+ name: string | null;
28
+ dataTag: string;
29
+ schedule: ScheduleSpec;
30
+ input?: unknown;
31
+ status: ScheduleTriggerStatus;
32
+ statusMessage: string | null;
33
+ nextFireAt: string | null;
34
+ createdBy: string;
35
+ updatedBy: string;
36
+ created: string;
37
+ updated: string;
38
+ deletedAt?: string;
39
+ }
40
+ export interface CreateScheduleTriggerRequest {
41
+ name?: string;
42
+ dataTag: string;
43
+ schedule: ScheduleSpec;
44
+ input?: unknown;
45
+ }
46
+ export interface UpdateScheduleTriggerRequest {
47
+ name?: string | null;
48
+ dataTag?: string;
49
+ schedule?: ScheduleSpec;
50
+ input?: unknown;
51
+ }
52
+ export interface ListScheduleTriggersQuery {
53
+ projectId: string;
54
+ }
55
+ export interface ListScheduleTriggersResponse {
56
+ schedules: ScheduleTriggerDto[];
57
+ }
58
+ export type ScheduleTriggerResponse = ScheduleTriggerDto;
59
+ export {};
60
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/scheduleTriggers/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,yBAAyB,YAAI,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAU,CAAC;AAC9F,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,eAAO,MAAM,mBAAmB,YAAI,MAAM,EAAE,UAAU,CAAU,CAAC;AACjE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,gCAAgC,MAAM,CAAC;AAEpD,eAAO,MAAM,6BAA6B,QAAS,CAAC;AAIpD,eAAO,MAAM,qCAAqC,KAAK,CAAC;AAExD,UAAU,gBAAgB;IAGxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAGnE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,YAAY,CAAC;IAEvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAGhB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAID,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAGD,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,kBAAkB,EAAE,CAAC;CACjC;AAID,MAAM,MAAM,uBAAuB,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,17 @@
1
+ // Schedules contract: schedule_trigger and the Schedules API. See the
2
+ // "Schedules" doc. A schedule runs an agent or Function (a run_definition) at
3
+ // set times with a fixed input, through start run.
4
+ // `paused` is set by a person. `disabled` means its agent or Function was
5
+ // removed, or its data tag isn't allowed for deployed runs; deploy and data tag
6
+ // changes restore it. `errored` means its own setup is invalid, e.g. its data
7
+ // tag was deleted; a person fixes it with PATCH.
8
+ export const SCHEDULE_TRIGGER_STATUSES = ['active', 'paused', 'disabled', 'errored'];
9
+ export const SCHEDULE_SPEC_TYPES = ['cron', 'interval'];
10
+ export const SCHEDULE_TRIGGER_NAME_MAX_LENGTH = 128;
11
+ // A cron or interval that could fire more often than this is rejected.
12
+ export const SCHEDULE_MIN_INTERVAL_SECONDS = 5 * 60;
13
+ // Per-project limit. The Schedules doc makes it an org setting; for now it's
14
+ // this constant, so raising it needs a deploy. `disabled` and `errored`
15
+ // schedules count; deleted ones don't.
16
+ export const SCHEDULE_TRIGGERS_PER_PROJECT_DEFAULT = 50;
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/scheduleTriggers/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,8EAA8E;AAC9E,mDAAmD;AAEnD,0EAA0E;AAC1E,gFAAgF;AAChF,8EAA8E;AAC9E,iDAAiD;AACjD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAU,CAAC;AAG9F,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAU,CAAC;AAGjE,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,CAAC;AACpD,uEAAuE;AACvE,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,GAAG,EAAE,CAAC;AACpD,6EAA6E;AAC7E,wEAAwE;AACxE,uCAAuC;AACvC,MAAM,CAAC,MAAM,qCAAqC,GAAG,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/types/scheduleTriggers/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { describe, expect, test } from 'vitest';
2
+ import { SCHEDULE_MIN_INTERVAL_SECONDS, SCHEDULE_SPEC_TYPES, SCHEDULE_TRIGGER_NAME_MAX_LENGTH, SCHEDULE_TRIGGER_STATUSES, SCHEDULE_TRIGGERS_PER_PROJECT_DEFAULT } from './index.js';
3
+ // Wire values and stored column values. Stored rows depend on them, so changes
4
+ // must be deliberate.
5
+ describe('schedules contract values', () => {
6
+ test('pins the stored and wire values', () => {
7
+ expect(SCHEDULE_TRIGGER_STATUSES).toEqual(['active', 'paused', 'disabled', 'errored']);
8
+ expect(SCHEDULE_SPEC_TYPES).toEqual(['cron', 'interval']);
9
+ });
10
+ test('pins the limits from the doc', () => {
11
+ expect(SCHEDULE_MIN_INTERVAL_SECONDS).toBe(300);
12
+ expect(SCHEDULE_TRIGGERS_PER_PROJECT_DEFAULT).toBe(50);
13
+ expect(SCHEDULE_TRIGGER_NAME_MAX_LENGTH).toBe(128);
14
+ });
15
+ });
16
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/types/scheduleTriggers/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,gCAAgC,EAChC,yBAAyB,EACzB,qCAAqC,EACtC,MAAM,YAAY,CAAC;AAEpB,+EAA+E;AAC/E,sBAAsB;AACtB,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,CAAC,iCAAiC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;QACvF,MAAM,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACxC,MAAM,CAAC,6BAA6B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChD,MAAM,CAAC,qCAAqC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvD,MAAM,CAAC,gCAAgC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Why routing.json gives no data-plane URL for a profile.
3
+ *
4
+ * - `not_mapped`: no profile was given, or routing.json has no entry for it.
5
+ * - `malformed`: the entry is not a URL.
6
+ * - `not_https`: the entry is not an HTTPS URL.
7
+ * - `unexpected_domain`: the entry's host is not a subdomain of superblocks.com.
8
+ */
9
+ export type DataPlaneRouteMiss = 'malformed' | 'not_https' | 'not_mapped' | 'unexpected_domain';
10
+ export type DataPlaneRoute = {
11
+ url: string;
12
+ } | {
13
+ miss: DataPlaneRouteMiss;
14
+ };
15
+ /**
16
+ * The data-plane URL routing.json maps a profile key to. routing.json is a flat object from profile key to a managed
17
+ * data plane's origin, and the browser and the server both read it to pick where a profile's executions go.
18
+ *
19
+ * Only an exact key matches: a `*` entry is never a fallback for other profiles, because a data plane serves only the
20
+ * profiles it declares. Only HTTPS hosts under superblocks.com are accepted, so a bad entry cannot send executions, or
21
+ * the credentials they carry, to another host.
22
+ */
23
+ export declare function dataPlaneRouteForProfile(config: unknown, profileKey: string | undefined): DataPlaneRoute;
24
+ //# sourceMappingURL=data-plane-routing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-plane-routing.d.ts","sourceRoot":"","sources":["../../src/utils/data-plane-routing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,mBAAmB,CAAC;AAEhG,MAAM,MAAM,cAAc,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,CAexG"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The data-plane URL routing.json maps a profile key to. routing.json is a flat object from profile key to a managed
3
+ * data plane's origin, and the browser and the server both read it to pick where a profile's executions go.
4
+ *
5
+ * Only an exact key matches: a `*` entry is never a fallback for other profiles, because a data plane serves only the
6
+ * profiles it declares. Only HTTPS hosts under superblocks.com are accepted, so a bad entry cannot send executions, or
7
+ * the credentials they carry, to another host.
8
+ */
9
+ export function dataPlaneRouteForProfile(config, profileKey) {
10
+ if (!profileKey || config === null || typeof config !== 'object' || Array.isArray(config) || !Object.hasOwn(config, profileKey)) {
11
+ return { miss: 'not_mapped' };
12
+ }
13
+ const entry = Reflect.get(config, profileKey);
14
+ if (typeof entry !== 'string' || !entry)
15
+ return { miss: 'not_mapped' };
16
+ let url;
17
+ try {
18
+ url = new URL(entry);
19
+ }
20
+ catch {
21
+ return { miss: 'malformed' };
22
+ }
23
+ if (url.protocol !== 'https:')
24
+ return { miss: 'not_https' };
25
+ if (!url.hostname.endsWith('.superblocks.com'))
26
+ return { miss: 'unexpected_domain' };
27
+ return { url: entry };
28
+ }
29
+ //# sourceMappingURL=data-plane-routing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-plane-routing.js","sourceRoot":"","sources":["../../src/utils/data-plane-routing.ts"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAe,EAAE,UAA8B;IACtF,IAAI,CAAC,UAAU,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC;QAChI,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAChC,CAAC;IACD,MAAM,KAAK,GAAY,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACvD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACvE,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAC/B,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAC5D,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;IACrF,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AACxB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data-plane-routing.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-plane-routing.test.d.ts","sourceRoot":"","sources":["../../src/utils/data-plane-routing.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { dataPlaneRouteForProfile } from './data-plane-routing.js';
3
+ describe('dataPlaneRouteForProfile', () => {
4
+ it('returns the URL routing.json maps the profile to', () => {
5
+ expect(dataPlaneRouteForProfile({ 'production-us': 'https://xk4wbn.linkedin.superblocks.com' }, 'production-us')).toEqual({
6
+ url: 'https://xk4wbn.linkedin.superblocks.com'
7
+ });
8
+ });
9
+ it.each([
10
+ ['a missing profile', { production: 'https://dp.superblocks.com' }, 'staging'],
11
+ ['no profile', { production: 'https://dp.superblocks.com' }, undefined],
12
+ ['an empty config', {}, 'production'],
13
+ ['a config that is not an object', ['https://dp.superblocks.com'], '0'],
14
+ ['a null config', null, 'production'],
15
+ ['an inherited key', {}, 'toString'],
16
+ ['a non-string entry', { production: 42 }, 'production']
17
+ ])('reports %s as not mapped', (_, config, profileKey) => {
18
+ expect(dataPlaneRouteForProfile(config, profileKey)).toEqual({ miss: 'not_mapped' });
19
+ });
20
+ it('never treats * as a fallback for another profile', () => {
21
+ const config = { '*': 'https://wildcard.superblocks.com', production: 'https://prod.superblocks.com' };
22
+ expect(dataPlaneRouteForProfile(config, 'staging')).toEqual({ miss: 'not_mapped' });
23
+ expect(dataPlaneRouteForProfile(config, 'production')).toEqual({ url: 'https://prod.superblocks.com' });
24
+ expect(dataPlaneRouteForProfile(config, '*')).toEqual({ url: 'https://wildcard.superblocks.com' });
25
+ });
26
+ it.each([
27
+ ['not-a-url', 'malformed'],
28
+ ['http://dp.superblocks.com', 'not_https'],
29
+ ['javascript:alert(1)', 'not_https'],
30
+ ['https://evil.example.com', 'unexpected_domain'],
31
+ ['https://superblocks.com.evil.com', 'unexpected_domain'],
32
+ ['https://superblocks.com', 'unexpected_domain']
33
+ ])('refuses %s as %s', (entry, miss) => {
34
+ expect(dataPlaneRouteForProfile({ production: entry }, 'production')).toEqual({ miss });
35
+ });
36
+ });
37
+ //# sourceMappingURL=data-plane-routing.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-plane-routing.test.js","sourceRoot":"","sources":["../../src/utils/data-plane-routing.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,CAAC,wBAAwB,CAAC,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AM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,kCAAkC,EAAE,CAAC,CAAC;IACrG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,IAAI,CAAC;QACN,CAAC,WAAW,EAAE,WAAW,CAAC;QAC1B,CAAC,2BAA2B,EAAE,WAAW,CAAC;QAC1C,CAAC,qBAAqB,EAAE,WAAW,CAAC;QACpC,CAAC,0BAA0B,EAAE,mBAAmB,CAAC;QACjD,CAAC,kCAAkC,EAAE,mBAAmB,CAAC;QACzD,CAAC,yBAAyB,EAAE,mBAAmB,CAAC;KACjD,CAAC,CAAC,kBAAkB,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACrC,MAAM,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -6,6 +6,7 @@ export * from './attachment-validation.js';
6
6
  export * from './bytestring.js';
7
7
  export * from './builderHarnessAvailability.js';
8
8
  export * from './configuration.js';
9
+ export * from './data-plane-routing.js';
9
10
  export * from './env.js';
10
11
  export * from './environment.js';
11
12
  export * from './git-url.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB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ation.js';
6
6
  export * from './bytestring.js';
7
7
  export * from './builderHarnessAvailability.js';
8
8
  export * from './configuration.js';
9
+ export * from './data-plane-routing.js';
9
10
  export * from './env.js';
10
11
  export * from './environment.js';
11
12
  export * from './git-url.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AAEzB,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AAEzB,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,cAAc,8BAA8B,CAAC"}
@@ -3,8 +3,57 @@
3
3
  * being one path segment. The gateway can only build requests from this list, and the server accepts the /mcp tools
4
4
  * token on exactly these routes, so a Builder tool can't call a route the server would refuse it on.
5
5
  */
6
- export declare const PLATFORM_MCP_SERVER_ROUTES: readonly ['GET /api/v1/users/me', 'GET /api/v2/applications', 'POST /api/v2/applications/', 'GET /api/v2/applications/*/environments', 'PUT /api/v2/applications/*/metadata', 'POST /api/v2/applications/*/commit', 'POST /api/v2/applications/*/branches/*/commit', 'GET /api/v2/applications/*/branch/status', 'POST /api/v2/applications/*/branch/land', 'POST /api/v2/applications/*/branch/update', 'POST /api/v2/applications/*/branch/enable', 'POST /api/v2/applications/*/branch/create', 'DELETE /api/v2/applications/*/branch/*', 'GET /api/v2/applications/*/branches/*/commits', 'GET /api/v2/applications/*/branches/*/commits/compare', 'POST /api/v2/applications/*/branches/*/reset', 'POST /api/v2/applications/*/deployments', 'GET /api/v2/applications/*/deployments', 'GET /api/v2/applications/*/current-publish', 'GET /api/v2/applications/*/deploy-status/*', 'GET /api/v3/applications/*/connect', 'GET /api/v3/applications/*/branches/*/connect', 'POST /api/v3/applications/*/*/builds', 'POST /api/v3/applications/*/build-bulk-status', 'GET /api/v1/integrations/superset', 'GET /api/v1/integrations/*', 'GET /api/v1/organizations/*/profiles', 'POST /api/v1/files/upload', 'POST /api/v1/ai/generate-app-name', 'POST /api/v1/builder-usage', 'GET /api/v1/public/users/me', 'POST /api/v1/token/scoped'];
6
+ export declare const PLATFORM_MCP_SERVER_ROUTES: readonly ['GET /api/v1/users/me', 'GET /api/v2/applications', 'POST /api/v2/applications/', 'GET /api/v2/applications/*/environments', 'PUT /api/v2/applications/*/metadata', 'POST /api/v2/applications/*/commit', 'POST /api/v2/applications/*/branches/*/commit', 'GET /api/v2/applications/*/branch/status', 'POST /api/v2/applications/*/branch/land', 'POST /api/v2/applications/*/branch/update', 'POST /api/v2/applications/*/branch/enable', 'POST /api/v2/applications/*/branch/create', 'DELETE /api/v2/applications/*/branch/*', 'GET /api/v2/applications/*/branches/*/commits', 'GET /api/v2/applications/*/branches/*/commits/compare', 'POST /api/v2/applications/*/branches/*/reset', 'POST /api/v2/applications/*/deployments', 'GET /api/v2/applications/*/deployments', 'GET /api/v2/applications/*/current-publish', 'GET /api/v2/applications/*/deploy-status/*', 'GET /api/v3/applications/*/connect', 'GET /api/v3/applications/*/branches/*/connect', 'GET /api/v3/applications/*/apis/*/entry', 'GET /api/v3/applications/*/branches/*/apis/*/entry', 'POST /api/v3/applications/*/*/builds', 'POST /api/v3/applications/*/build-bulk-status', 'GET /api/v1/integrations/superset', 'GET /api/v1/integrations/*', 'GET /api/v1/organizations/*/profiles', 'POST /api/v1/files/upload', 'POST /api/v1/ai/generate-app-name', 'POST /api/v1/builder-usage', 'POST /api/v1/mcp/data-plane', 'GET /api/v1/mcp/data-plane/destination', 'GET /api/v1/public/users/me', 'POST /api/v1/token/scoped'];
7
7
  export type PlatformMcpServerRoute = (typeof PLATFORM_MCP_SERVER_ROUTES)[number];
8
+ /** Interim execution boundary; RAS will replace the checked caller profile with a server-selected profile. */
9
+ export type PlatformMcpDataPlaneRequest = {
10
+ profileKey: string;
11
+ } & ({
12
+ operation: 'api_test';
13
+ target: {
14
+ applicationId: string;
15
+ branchName: string;
16
+ };
17
+ payload: {
18
+ entryPoint: string;
19
+ inputs: Record<string, unknown>;
20
+ exportName?: string;
21
+ includeDiagnostics?: boolean;
22
+ };
23
+ } | {
24
+ operation: 'integration_execute';
25
+ target: {
26
+ integrationId?: string;
27
+ applicationId?: string;
28
+ };
29
+ payload: {
30
+ api: Record<string, unknown>;
31
+ inputs: Record<string, unknown>;
32
+ };
33
+ } | {
34
+ operation: 'app_api_run';
35
+ target: {
36
+ applicationId: string;
37
+ mode: 'deployed';
38
+ } | {
39
+ applicationId: string;
40
+ mode: 'edit';
41
+ branchName: string;
42
+ };
43
+ payload: {
44
+ apiName: string;
45
+ inputs: Record<string, unknown>;
46
+ };
47
+ } | {
48
+ operation: 'metadata_fetch';
49
+ target: {
50
+ integrationId: string;
51
+ applicationId?: string;
52
+ };
53
+ payload: {
54
+ stepConfiguration?: Record<string, unknown>;
55
+ };
56
+ });
8
57
  /** One value for each `*` in the route, in order. */
9
58
  type RouteSegments<Route extends string, Values extends string[] = []> = Route extends `${string}*${infer Rest}` ? RouteSegments<Rest, [...Values, string]> : Values;
10
59
  /**