@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.
- package/dist/front-door/index.d.ts +167 -0
- package/dist/front-door/index.d.ts.map +1 -0
- package/dist/front-door/index.js +85 -0
- package/dist/front-door/index.js.map +1 -0
- package/dist/front-door/index.test.d.ts +2 -0
- package/dist/front-door/index.test.d.ts.map +1 -0
- package/dist/front-door/index.test.js +91 -0
- package/dist/front-door/index.test.js.map +1 -0
- package/dist/jwt/index.d.ts +1 -0
- package/dist/jwt/index.d.ts.map +1 -1
- package/dist/jwt/index.js +1 -0
- package/dist/jwt/index.js.map +1 -1
- package/dist/jwt/jwksUri.d.ts +3 -0
- package/dist/jwt/jwksUri.d.ts.map +1 -0
- package/dist/jwt/jwksUri.js +27 -0
- package/dist/jwt/jwksUri.js.map +1 -0
- package/dist/jwt/jwksUri.test.d.ts +2 -0
- package/dist/jwt/jwksUri.test.d.ts.map +1 -0
- package/dist/jwt/jwksUri.test.js +35 -0
- package/dist/jwt/jwksUri.test.js.map +1 -0
- package/dist/socket/protocol.d.ts +3 -0
- package/dist/socket/protocol.d.ts.map +1 -1
- package/dist/types/ai/index.d.ts +4 -0
- package/dist/types/ai/index.d.ts.map +1 -1
- package/dist/types/ai/index.js +2 -0
- package/dist/types/ai/index.js.map +1 -1
- package/dist/types/ai/native-builder-model.d.ts +13 -1
- package/dist/types/ai/native-builder-model.d.ts.map +1 -1
- package/dist/types/ai/native-builder-model.js +50 -8
- package/dist/types/ai/native-builder-model.js.map +1 -1
- package/dist/types/ai/native-builder-model.test.js +15 -0
- package/dist/types/ai/native-builder-model.test.js.map +1 -1
- package/dist/types/ai/prompt-failure-shown-in-chat.d.ts +13 -0
- package/dist/types/ai/prompt-failure-shown-in-chat.d.ts.map +1 -0
- package/dist/types/ai/prompt-failure-shown-in-chat.js +16 -0
- package/dist/types/ai/prompt-failure-shown-in-chat.js.map +1 -0
- package/dist/types/ai/turn-in-progress.d.ts +11 -0
- package/dist/types/ai/turn-in-progress.d.ts.map +1 -0
- package/dist/types/ai/turn-in-progress.js +17 -0
- package/dist/types/ai/turn-in-progress.js.map +1 -0
- package/dist/types/ai/turn-in-progress.test.d.ts +2 -0
- package/dist/types/ai/turn-in-progress.test.d.ts.map +1 -0
- package/dist/types/ai/turn-in-progress.test.js +13 -0
- package/dist/types/ai/turn-in-progress.test.js.map +1 -0
- package/dist/types/application/index.d.ts +3 -0
- package/dist/types/application/index.d.ts.map +1 -1
- package/dist/types/application/index.js +2 -0
- package/dist/types/application/index.js.map +1 -1
- package/dist/types/audit/ocsf.d.ts.map +1 -1
- package/dist/types/audit/ocsf.js +12 -1
- package/dist/types/audit/ocsf.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/runs/index.d.ts +156 -0
- package/dist/types/runs/index.d.ts.map +1 -0
- package/dist/types/runs/index.js +52 -0
- package/dist/types/runs/index.js.map +1 -0
- package/dist/types/runs/index.test.d.ts +2 -0
- package/dist/types/runs/index.test.d.ts.map +1 -0
- package/dist/types/runs/index.test.js +47 -0
- package/dist/types/runs/index.test.js.map +1 -0
- package/dist/types/scheduleTriggers/index.d.ts +60 -0
- package/dist/types/scheduleTriggers/index.d.ts.map +1 -0
- package/dist/types/scheduleTriggers/index.js +17 -0
- package/dist/types/scheduleTriggers/index.js.map +1 -0
- package/dist/types/scheduleTriggers/index.test.d.ts +2 -0
- package/dist/types/scheduleTriggers/index.test.d.ts.map +1 -0
- package/dist/types/scheduleTriggers/index.test.js +16 -0
- package/dist/types/scheduleTriggers/index.test.js.map +1 -0
- package/dist/utils/data-plane-routing.d.ts +24 -0
- package/dist/utils/data-plane-routing.d.ts.map +1 -0
- package/dist/utils/data-plane-routing.js +29 -0
- package/dist/utils/data-plane-routing.js.map +1 -0
- package/dist/utils/data-plane-routing.test.d.ts +2 -0
- package/dist/utils/data-plane-routing.test.d.ts.map +1 -0
- package/dist/utils/data-plane-routing.test.js +37 -0
- package/dist/utils/data-plane-routing.test.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/platform-mcp-server-routes.d.ts +50 -1
- package/dist/utils/platform-mcp-server-routes.d.ts.map +1 -1
- package/dist/utils/platform-mcp-server-routes.js +6 -0
- package/dist/utils/platform-mcp-server-routes.js.map +1 -1
- package/package.json +11 -6
- package/src/front-door/index.test.ts +116 -0
- package/src/front-door/index.ts +116 -0
- package/src/jwt/index.ts +1 -0
- package/src/jwt/jwksUri.test.ts +50 -0
- package/src/jwt/jwksUri.ts +30 -0
- package/src/socket/protocol.ts +9 -1
- package/src/types/ai/index.ts +4 -0
- package/src/types/ai/native-builder-model.test.ts +16 -0
- package/src/types/ai/native-builder-model.ts +58 -10
- package/src/types/ai/prompt-failure-shown-in-chat.ts +18 -0
- package/src/types/ai/turn-in-progress.test.ts +15 -0
- package/src/types/ai/turn-in-progress.ts +19 -0
- package/src/types/application/index.ts +5 -0
- package/src/types/audit/ocsf.ts +12 -1
- package/src/types/index.ts +2 -0
- package/src/types/runs/index.test.ts +66 -0
- package/src/types/runs/index.ts +277 -0
- package/src/types/scheduleTriggers/index.test.ts +24 -0
- package/src/types/scheduleTriggers/index.ts +103 -0
- package/src/utils/data-plane-routing.test.ts +41 -0
- package/src/utils/data-plane-routing.ts +36 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/platform-mcp-server-routes.ts +39 -0
package/src/types/audit/ocsf.ts
CHANGED
|
@@ -266,6 +266,7 @@ export const AUDIT_EVENT_TYPE_CATALOG: AuditEventTypeEntry[] = [
|
|
|
266
266
|
operations: [
|
|
267
267
|
'organization.mcp_allowed_clients.update',
|
|
268
268
|
'organization.mcp_client_approval.update',
|
|
269
|
+
'organization.mcp_client_request.delete',
|
|
269
270
|
'organization.npm_allow_install_scripts_changed',
|
|
270
271
|
'organization.npm_registry.create',
|
|
271
272
|
'organization.npm_registry.delete',
|
|
@@ -311,6 +312,14 @@ export const AUDIT_EVENT_TYPE_CATALOG: AuditEventTypeEntry[] = [
|
|
|
311
312
|
'reviewpolicy.enable'
|
|
312
313
|
]
|
|
313
314
|
},
|
|
315
|
+
{
|
|
316
|
+
class_uid: OCSFClassUid.ENTITY_MANAGEMENT,
|
|
317
|
+
class_name: 'ENTITY_MANAGEMENT',
|
|
318
|
+
category_uid: OCSFCategoryUid.APPLICATION_ACTIVITY,
|
|
319
|
+
category_name: 'APPLICATION_ACTIVITY',
|
|
320
|
+
resource_type: 'Schedule',
|
|
321
|
+
operations: ['schedule.create', 'schedule.delete', 'schedule.pause', 'schedule.resume', 'schedule.update']
|
|
322
|
+
},
|
|
314
323
|
{
|
|
315
324
|
class_uid: OCSFClassUid.ENTITY_MANAGEMENT,
|
|
316
325
|
class_name: 'ENTITY_MANAGEMENT',
|
|
@@ -398,7 +407,9 @@ export const AUDIT_EVENT_TYPE_CATALOG: AuditEventTypeEntry[] = [
|
|
|
398
407
|
'user.email.update',
|
|
399
408
|
'user.invite',
|
|
400
409
|
'user.role.update',
|
|
401
|
-
'user.roles.bulk_update'
|
|
410
|
+
'user.roles.bulk_update',
|
|
411
|
+
'user.slack_link.create',
|
|
412
|
+
'user.slack_link.revoke'
|
|
402
413
|
]
|
|
403
414
|
}
|
|
404
415
|
];
|
package/src/types/index.ts
CHANGED
|
@@ -34,6 +34,8 @@ export type * from './repoConnection/index.js';
|
|
|
34
34
|
export * from './repository/index.js';
|
|
35
35
|
export * from './response/index.js';
|
|
36
36
|
export * from './reviewPolicy/index.js';
|
|
37
|
+
export * from './runs/index.js';
|
|
38
|
+
export * from './scheduleTriggers/index.js';
|
|
37
39
|
export * from './scim/index.js';
|
|
38
40
|
export * from './signingKeyRotationJob/index.js';
|
|
39
41
|
export * from './template/index.js';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
RUN_CONTENT_TYPES,
|
|
5
|
+
RUN_FINISHED_STATUSES,
|
|
6
|
+
RUN_IDENTITY_TYPES,
|
|
7
|
+
RUN_IN_PROGRESS_STATUSES,
|
|
8
|
+
RUN_INPUT_MAX_BYTES,
|
|
9
|
+
RUN_KINDS,
|
|
10
|
+
RUN_MODES,
|
|
11
|
+
RUN_STATUS_MESSAGE_MAX_BYTES,
|
|
12
|
+
RUN_STATUS_UPDATE_TYPES,
|
|
13
|
+
RUN_STATUSES,
|
|
14
|
+
RUN_TERMINAL_STATUSES,
|
|
15
|
+
RUN_TRIGGER_TYPES
|
|
16
|
+
} from './index.js';
|
|
17
|
+
|
|
18
|
+
// These are wire values and stored column values. Other services and stored
|
|
19
|
+
// rows depend on them, so changes must be deliberate.
|
|
20
|
+
describe('run record contract values', () => {
|
|
21
|
+
test('pins the stored and wire values', () => {
|
|
22
|
+
expect(RUN_KINDS).toEqual(['agent', 'function']);
|
|
23
|
+
expect(RUN_MODES).toEqual(['edit', 'deployed']);
|
|
24
|
+
expect(RUN_TRIGGER_TYPES).toEqual(['api', 'schedule']);
|
|
25
|
+
expect(RUN_IDENTITY_TYPES).toEqual(['user', 'workload']);
|
|
26
|
+
expect(RUN_STATUSES).toEqual(['pending', 'running', 'succeeded', 'failed', 'timed_out', 'canceled', 'skipped', 'unknown']);
|
|
27
|
+
expect(RUN_CONTENT_TYPES).toEqual(['input', 'agent_memory']);
|
|
28
|
+
expect(RUN_STATUS_UPDATE_TYPES).toEqual(['started', 'heartbeat', 'finished']);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('every value is lowercase snake_case', () => {
|
|
32
|
+
const values = [
|
|
33
|
+
...RUN_KINDS,
|
|
34
|
+
...RUN_MODES,
|
|
35
|
+
...RUN_TRIGGER_TYPES,
|
|
36
|
+
...RUN_IDENTITY_TYPES,
|
|
37
|
+
...RUN_STATUSES,
|
|
38
|
+
...RUN_CONTENT_TYPES,
|
|
39
|
+
...RUN_STATUS_UPDATE_TYPES
|
|
40
|
+
];
|
|
41
|
+
for (const value of values) {
|
|
42
|
+
expect(value).toMatch(/^[a-z]+(_[a-z]+)*$/);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('unknown is not terminal, so a late finished update can replace it', () => {
|
|
47
|
+
expect(RUN_TERMINAL_STATUSES).not.toContain('unknown');
|
|
48
|
+
expect(RUN_TERMINAL_STATUSES).toEqual(['succeeded', 'failed', 'timed_out', 'canceled', 'skipped']);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('in-progress statuses do not overlap with terminal statuses', () => {
|
|
52
|
+
for (const status of RUN_IN_PROGRESS_STATUSES) {
|
|
53
|
+
expect(RUN_TERMINAL_STATUSES).not.toContain(status);
|
|
54
|
+
}
|
|
55
|
+
expect(RUN_IN_PROGRESS_STATUSES).toEqual(['pending', 'running']);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('executors finish runs only as succeeded, failed or timed_out', () => {
|
|
59
|
+
expect(RUN_FINISHED_STATUSES).toEqual(['succeeded', 'failed', 'timed_out']);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('input cap is 256 KB and status message cap is 4 KB', () => {
|
|
63
|
+
expect(RUN_INPUT_MAX_BYTES).toBe(262144);
|
|
64
|
+
expect(RUN_STATUS_MESSAGE_MAX_BYTES).toBe(4096);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import type { AgentSessionMessage, AgentStreamEvent } from '../customAgents.js';
|
|
2
|
+
|
|
3
|
+
// Run record contract: run_definition, run_record and run_record_content, the
|
|
4
|
+
// run API, and the run status updates. See the "Decision: Run record" doc.
|
|
5
|
+
//
|
|
6
|
+
// Type and status columns are `character varying`, checked in code against
|
|
7
|
+
// these lists (no database constraint), so adding a value needs no migration.
|
|
8
|
+
// A value is never removed once rows use it; to retire one, stop accepting it
|
|
9
|
+
// for new runs.
|
|
10
|
+
|
|
11
|
+
export const RUN_KINDS = ['agent', 'function'] as const;
|
|
12
|
+
export type RunKind = (typeof RUN_KINDS)[number];
|
|
13
|
+
|
|
14
|
+
// `edit` runs the current files on a branch; `deployed` runs the deployed commit.
|
|
15
|
+
export const RUN_MODES = ['edit', 'deployed'] as const;
|
|
16
|
+
export type RunMode = (typeof RUN_MODES)[number];
|
|
17
|
+
|
|
18
|
+
// `api` covers direct calls to the run API, including Try it; `schedule` covers
|
|
19
|
+
// schedule fires. New trigger types are added with the feature that fires them.
|
|
20
|
+
export const RUN_TRIGGER_TYPES = ['api', 'schedule'] as const;
|
|
21
|
+
export type RunTriggerType = (typeof RUN_TRIGGER_TYPES)[number];
|
|
22
|
+
|
|
23
|
+
// Set by the server from how the run was started; callers never send it.
|
|
24
|
+
export const RUN_IDENTITY_TYPES = ['user', 'workload'] as const;
|
|
25
|
+
export type RunIdentityType = (typeof RUN_IDENTITY_TYPES)[number];
|
|
26
|
+
|
|
27
|
+
// `pending`: created, being handed to the orchestrator or AgentCore. There's no
|
|
28
|
+
// queue: if the executor doesn't accept the run, it's `failed` with the reason
|
|
29
|
+
// in status_message. `running`: the executor accepted it; from then on the
|
|
30
|
+
// lease must be kept alive by heartbeats.
|
|
31
|
+
export const RUN_STATUSES = ['pending', 'running', 'succeeded', 'failed', 'timed_out', 'canceled', 'skipped', 'unknown'] as const;
|
|
32
|
+
export type RunStatus = (typeof RUN_STATUSES)[number];
|
|
33
|
+
|
|
34
|
+
// Final statuses never change. `unknown` is not one of them: a late
|
|
35
|
+
// `finished` update replaces it.
|
|
36
|
+
export const RUN_TERMINAL_STATUSES = ['succeeded', 'failed', 'timed_out', 'canceled', 'skipped'] as const satisfies readonly RunStatus[];
|
|
37
|
+
export type RunTerminalStatus = (typeof RUN_TERMINAL_STATUSES)[number];
|
|
38
|
+
|
|
39
|
+
// A schedule fire is skipped while its previous run is in one of these.
|
|
40
|
+
export const RUN_IN_PROGRESS_STATUSES = ['pending', 'running'] as const satisfies readonly RunStatus[];
|
|
41
|
+
|
|
42
|
+
// `input`: a Function's arguments or an agent's prompt, written once by start
|
|
43
|
+
// run. `agent_memory`: where an agent run's conversation lives in AgentCore
|
|
44
|
+
// memory, one row per session.
|
|
45
|
+
export const RUN_CONTENT_TYPES = ['input', 'agent_memory'] as const;
|
|
46
|
+
export type RunContentType = (typeof RUN_CONTENT_TYPES)[number];
|
|
47
|
+
|
|
48
|
+
// `input` larger than this (serialized JSON) is refused with 400. Start run
|
|
49
|
+
// checks it, so schedules share the cap.
|
|
50
|
+
export const RUN_INPUT_MAX_BYTES = 256 * 1024;
|
|
51
|
+
export const RUN_IDEMPOTENCY_KEY_MAX_LENGTH = 128;
|
|
52
|
+
export const RUN_IDEMPOTENCY_KEY_HEADER = 'Idempotency-Key';
|
|
53
|
+
export const RUN_DEFINITION_NAME_MAX_LENGTH = 64;
|
|
54
|
+
export const RUN_DEDUP_KEY_MAX_LENGTH = 255;
|
|
55
|
+
// `status_message` is cut to this many bytes. It's the only error detail a
|
|
56
|
+
// failed run keeps.
|
|
57
|
+
export const RUN_STATUS_MESSAGE_MAX_BYTES = 4 * 1024;
|
|
58
|
+
|
|
59
|
+
// Which code an edit run runs on its branch: the file and export that hold a
|
|
60
|
+
// Function, nothing more for an agent. run_definition describes the deployed
|
|
61
|
+
// commit, which the branch may have changed, so every edit run brings its own.
|
|
62
|
+
export type RunEditTarget = { kind: 'function'; entryPoint: string; exportName: string } | { kind: 'agent' };
|
|
63
|
+
|
|
64
|
+
// Details only some runs have, in `run_record.attributes`. Internal: never
|
|
65
|
+
// returned by the API. Anything a client needs gets its own field on Run.
|
|
66
|
+
export interface RunAttributes {
|
|
67
|
+
// Schedule runs: the fire time the run was due (ISO 8601).
|
|
68
|
+
scheduledFor?: string;
|
|
69
|
+
// Edit runs: what ran on the branch, so dispatch needs only the run's row.
|
|
70
|
+
// `name` comes from the definition, or from the request when there's none.
|
|
71
|
+
target?: { name: string } & RunEditTarget;
|
|
72
|
+
// Runs of a definition: what the definition said when the run was created, so a
|
|
73
|
+
// deploy between create and dispatch (common for schedules) can't change what
|
|
74
|
+
// the run sends to the executor. Deployed runs run this entry point at the
|
|
75
|
+
// pinned commit; edit runs take only the name and time limit from it.
|
|
76
|
+
pinned?: { name: string; entryPoint: string | null; exportName: string | null; timeoutSeconds: number };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Body of an `agent_memory` content row: one AgentCore session of an agent run.
|
|
80
|
+
// A long run that chains sessions has one row per session; the latest is the
|
|
81
|
+
// current one.
|
|
82
|
+
export interface RunAgentMemoryContent {
|
|
83
|
+
memoryId: string;
|
|
84
|
+
actorId: string;
|
|
85
|
+
sessionId: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
// Run API: /api/v1/runs
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
|
|
92
|
+
// Timestamps are ISO 8601 strings.
|
|
93
|
+
export interface RunDto {
|
|
94
|
+
id: string;
|
|
95
|
+
kind: RunKind;
|
|
96
|
+
definitionId: string | null;
|
|
97
|
+
runMode: RunMode;
|
|
98
|
+
commitId: string | null;
|
|
99
|
+
// Edit runs only: the branch whose files ran.
|
|
100
|
+
branch: string | null;
|
|
101
|
+
dataTag: string;
|
|
102
|
+
triggerType: RunTriggerType;
|
|
103
|
+
triggerId: string | null;
|
|
104
|
+
identityType: RunIdentityType;
|
|
105
|
+
identityId: string;
|
|
106
|
+
status: RunStatus;
|
|
107
|
+
statusMessage: string | null;
|
|
108
|
+
// When the run was created.
|
|
109
|
+
created: string;
|
|
110
|
+
// When the executor accepted the run.
|
|
111
|
+
startedAt: string | null;
|
|
112
|
+
finishedAt: string | null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface CreateRunRequestBase {
|
|
116
|
+
dataTag: string;
|
|
117
|
+
input?: unknown;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Runs the project's deployed commit, pinned by start run. No branch.
|
|
121
|
+
export interface CreateDeployedRunRequest extends CreateRunRequestBase {
|
|
122
|
+
definitionId: string;
|
|
123
|
+
runMode: 'deployed';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Runs the branch's current files. `kind` must match the definition's.
|
|
127
|
+
export type CreateEditRunRequest = CreateRunRequestBase & {
|
|
128
|
+
definitionId: string;
|
|
129
|
+
runMode: 'edit';
|
|
130
|
+
branch: string;
|
|
131
|
+
} & RunEditTarget;
|
|
132
|
+
|
|
133
|
+
// Try it on something that has never been deployed, so it has no definition.
|
|
134
|
+
// Refused for deployed runs. `projectId` says whose code to run, since there's
|
|
135
|
+
// no definition to take it from. No Idempotency-Key: its dedup key needs a
|
|
136
|
+
// definition ID.
|
|
137
|
+
export type CreateUndeployedEditRunRequest = CreateRunRequestBase & {
|
|
138
|
+
projectId: string;
|
|
139
|
+
runMode: 'edit';
|
|
140
|
+
branch: string;
|
|
141
|
+
name: string;
|
|
142
|
+
} & RunEditTarget;
|
|
143
|
+
|
|
144
|
+
// POST /api/v1/runs body. Optional `Idempotency-Key` header.
|
|
145
|
+
export type CreateRunRequest = CreateDeployedRunRequest | CreateEditRunRequest | CreateUndeployedEditRunRequest;
|
|
146
|
+
|
|
147
|
+
// POST /api/v1/runs query.
|
|
148
|
+
export interface CreateRunQuery {
|
|
149
|
+
wait?: boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 202 for a new run. 200 with the existing run when the Idempotency-Key was
|
|
153
|
+
// already used.
|
|
154
|
+
export interface CreateRunResponse {
|
|
155
|
+
runId: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// 200 for `wait=true` on a Function. Output is never stored.
|
|
159
|
+
export interface CreateRunSyncFunctionResponse {
|
|
160
|
+
runId: string;
|
|
161
|
+
status: RunStatus;
|
|
162
|
+
output: unknown;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// `wait=true` on an agent streams NDJSON, one event per line.
|
|
166
|
+
export type RunAgentStreamEvent = AgentStreamEvent;
|
|
167
|
+
|
|
168
|
+
// POST /api/v1/runs/:runId/stop: 202 with the run. 409 for a running Function.
|
|
169
|
+
export type StopRunResponse = RunDto;
|
|
170
|
+
|
|
171
|
+
// GET /api/v1/runs/:runId
|
|
172
|
+
export type GetRunResponse = RunDto;
|
|
173
|
+
|
|
174
|
+
// GET /api/v1/runs query. Exactly one of projectId, definitionId or triggerId.
|
|
175
|
+
export interface ListRunsQuery {
|
|
176
|
+
projectId?: string;
|
|
177
|
+
definitionId?: string;
|
|
178
|
+
triggerId?: string;
|
|
179
|
+
status?: RunStatus;
|
|
180
|
+
triggerType?: RunTriggerType;
|
|
181
|
+
runMode?: RunMode;
|
|
182
|
+
cursor?: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface ListRunsResponse {
|
|
186
|
+
runs: RunDto[];
|
|
187
|
+
nextCursor: string | null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// GET /api/v1/runs/:runId/content
|
|
191
|
+
export interface GetRunContentResponse {
|
|
192
|
+
// The decrypted `input` row.
|
|
193
|
+
input: unknown;
|
|
194
|
+
// Agent runs only, read from AgentCore memory for each `agent_memory` row in
|
|
195
|
+
// order.
|
|
196
|
+
messages?: AgentSessionMessage[];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// ---------------------------------------------------------------------------
|
|
200
|
+
// Run definitions: /api/v1/run-definitions. Only deploy writes them.
|
|
201
|
+
// ---------------------------------------------------------------------------
|
|
202
|
+
|
|
203
|
+
export interface RunDefinitionSummaryDto {
|
|
204
|
+
id: string;
|
|
205
|
+
kind: RunKind;
|
|
206
|
+
name: string;
|
|
207
|
+
projectId: string;
|
|
208
|
+
timeoutSeconds: number;
|
|
209
|
+
removedAt: string | null;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface RunDefinitionDto extends RunDefinitionSummaryDto {
|
|
213
|
+
entryPoint: string | null;
|
|
214
|
+
exportName: string | null;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// GET /api/v1/run-definitions query.
|
|
218
|
+
export interface ListRunDefinitionsQuery {
|
|
219
|
+
projectId: string;
|
|
220
|
+
kind?: RunKind;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface ListRunDefinitionsResponse {
|
|
224
|
+
definitions: RunDefinitionSummaryDto[];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// GET /api/v1/run-definitions/:definitionId
|
|
228
|
+
export type GetRunDefinitionResponse = RunDefinitionDto;
|
|
229
|
+
|
|
230
|
+
// ---------------------------------------------------------------------------
|
|
231
|
+
// Run status updates: how a run moves through its lifecycle after start run.
|
|
232
|
+
// ---------------------------------------------------------------------------
|
|
233
|
+
|
|
234
|
+
// `started` is never posted: start run applies it from the executor's reply
|
|
235
|
+
// (the orchestrator's async /v3/execute, or AgentCore starting the session).
|
|
236
|
+
// The orchestrator posts `heartbeat` and `finished` for Function runs to
|
|
237
|
+
// POST /api/v1/agents/runs/:runId/status. Agent runs get all three from inside
|
|
238
|
+
// the server, which holds the AgentCore stream.
|
|
239
|
+
export const RUN_STATUS_UPDATE_TYPES = ['started', 'heartbeat', 'finished'] as const;
|
|
240
|
+
export type RunStatusUpdateType = (typeof RUN_STATUS_UPDATE_TYPES)[number];
|
|
241
|
+
|
|
242
|
+
// Statuses an executor can finish a run with. `canceled` comes from the stop
|
|
243
|
+
// route and kill switch; `skipped` and `unknown` from the scheduler and sweeper.
|
|
244
|
+
export const RUN_FINISHED_STATUSES = ['succeeded', 'failed', 'timed_out'] as const satisfies readonly RunStatus[];
|
|
245
|
+
export type RunFinishedStatus = (typeof RUN_FINISHED_STATUSES)[number];
|
|
246
|
+
|
|
247
|
+
// Function runs: the sender is the orchestrator's agent ID from the existing
|
|
248
|
+
// agent-key auth (x-superblocks-agent-id, checked against that agent's
|
|
249
|
+
// registered key), never a field in the body. It must match the run's
|
|
250
|
+
// `orchestrator_id`, which start run set to the orchestrator it called.
|
|
251
|
+
// TODO: agents that share a key can present each other's ID. Require the run
|
|
252
|
+
// token (which carries run_id) on status updates once every run has one.
|
|
253
|
+
interface RunStatusUpdateBase {
|
|
254
|
+
runId: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Sets status = running, started_at, lease_expires_at, and orchestrator_id for
|
|
258
|
+
// Function runs.
|
|
259
|
+
export interface RunStartedUpdate extends RunStatusUpdateBase {
|
|
260
|
+
type: 'started';
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Sent every few seconds while the run is going. Extends lease_expires_at; if
|
|
264
|
+
// heartbeats stop, the sweeper marks the run `unknown`.
|
|
265
|
+
export interface RunHeartbeatUpdate extends RunStatusUpdateBase {
|
|
266
|
+
type: 'heartbeat';
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Sets the final status, status_message and finished_at. For a failed run,
|
|
270
|
+
// statusMessage is the error message, cut to RUN_STATUS_MESSAGE_MAX_BYTES.
|
|
271
|
+
export interface RunFinishedUpdate extends RunStatusUpdateBase {
|
|
272
|
+
type: 'finished';
|
|
273
|
+
status: RunFinishedStatus;
|
|
274
|
+
statusMessage?: string;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export type RunStatusUpdate = RunStartedUpdate | RunHeartbeatUpdate | RunFinishedUpdate;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
SCHEDULE_MIN_INTERVAL_SECONDS,
|
|
5
|
+
SCHEDULE_SPEC_TYPES,
|
|
6
|
+
SCHEDULE_TRIGGER_NAME_MAX_LENGTH,
|
|
7
|
+
SCHEDULE_TRIGGER_STATUSES,
|
|
8
|
+
SCHEDULE_TRIGGERS_PER_PROJECT_DEFAULT
|
|
9
|
+
} from './index.js';
|
|
10
|
+
|
|
11
|
+
// Wire values and stored column values. Stored rows depend on them, so changes
|
|
12
|
+
// must be deliberate.
|
|
13
|
+
describe('schedules contract values', () => {
|
|
14
|
+
test('pins the stored and wire values', () => {
|
|
15
|
+
expect(SCHEDULE_TRIGGER_STATUSES).toEqual(['active', 'paused', 'disabled', 'errored']);
|
|
16
|
+
expect(SCHEDULE_SPEC_TYPES).toEqual(['cron', 'interval']);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('pins the limits from the doc', () => {
|
|
20
|
+
expect(SCHEDULE_MIN_INTERVAL_SECONDS).toBe(300);
|
|
21
|
+
expect(SCHEDULE_TRIGGERS_PER_PROJECT_DEFAULT).toBe(50);
|
|
22
|
+
expect(SCHEDULE_TRIGGER_NAME_MAX_LENGTH).toBe(128);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
|
|
5
|
+
// `paused` is set by a person. `disabled` means its agent or Function was
|
|
6
|
+
// removed, or its data tag isn't allowed for deployed runs; deploy and data tag
|
|
7
|
+
// changes restore it. `errored` means its own setup is invalid, e.g. its data
|
|
8
|
+
// tag was deleted; a person fixes it with PATCH.
|
|
9
|
+
export const SCHEDULE_TRIGGER_STATUSES = ['active', 'paused', 'disabled', 'errored'] as const;
|
|
10
|
+
export type ScheduleTriggerStatus = (typeof SCHEDULE_TRIGGER_STATUSES)[number];
|
|
11
|
+
|
|
12
|
+
export const SCHEDULE_SPEC_TYPES = ['cron', 'interval'] as const;
|
|
13
|
+
export type ScheduleSpecType = (typeof SCHEDULE_SPEC_TYPES)[number];
|
|
14
|
+
|
|
15
|
+
export const SCHEDULE_TRIGGER_NAME_MAX_LENGTH = 128;
|
|
16
|
+
// A cron or interval that could fire more often than this is rejected.
|
|
17
|
+
export const SCHEDULE_MIN_INTERVAL_SECONDS = 5 * 60;
|
|
18
|
+
// Per-project limit. The Schedules doc makes it an org setting; for now it's
|
|
19
|
+
// this constant, so raising it needs a deploy. `disabled` and `errored`
|
|
20
|
+
// schedules count; deleted ones don't.
|
|
21
|
+
export const SCHEDULE_TRIGGERS_PER_PROJECT_DEFAULT = 50;
|
|
22
|
+
|
|
23
|
+
interface ScheduleSpecBase {
|
|
24
|
+
// Optional ISO 8601 timestamps. The first occurrence is the first one at or
|
|
25
|
+
// after startAt; nothing fires after endAt.
|
|
26
|
+
startAt?: string;
|
|
27
|
+
endAt?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 5-field cron (no seconds) in an IANA timezone.
|
|
31
|
+
export interface CronScheduleSpec extends ScheduleSpecBase {
|
|
32
|
+
type: 'cron';
|
|
33
|
+
cron: string;
|
|
34
|
+
timezone: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// `every` and `offset` like `15m` or `1h`. No timezone: counted from midnight
|
|
38
|
+
// UTC.
|
|
39
|
+
export interface IntervalScheduleSpec extends ScheduleSpecBase {
|
|
40
|
+
type: 'interval';
|
|
41
|
+
every: string;
|
|
42
|
+
offset?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// When a schedule fires: the request's `schedule` object, stored as sent in
|
|
46
|
+
// schedule_trigger.spec.
|
|
47
|
+
export type ScheduleSpec = CronScheduleSpec | IntervalScheduleSpec;
|
|
48
|
+
|
|
49
|
+
// Timestamps are ISO 8601 strings.
|
|
50
|
+
export interface ScheduleTriggerDto {
|
|
51
|
+
id: string;
|
|
52
|
+
definitionId: string;
|
|
53
|
+
projectId: string;
|
|
54
|
+
name: string | null;
|
|
55
|
+
// The data tag's key, e.g. `production`.
|
|
56
|
+
dataTag: string;
|
|
57
|
+
schedule: ScheduleSpec;
|
|
58
|
+
// Left out for people who can view the project but not edit it.
|
|
59
|
+
input?: unknown;
|
|
60
|
+
status: ScheduleTriggerStatus;
|
|
61
|
+
statusMessage: string | null;
|
|
62
|
+
// Null when not active, or once endAt has passed.
|
|
63
|
+
nextFireAt: string | null;
|
|
64
|
+
createdBy: string;
|
|
65
|
+
updatedBy: string;
|
|
66
|
+
created: string;
|
|
67
|
+
updated: string;
|
|
68
|
+
// Only on GET /api/v1/schedules/:scheduleId for a deleted schedule, so a run
|
|
69
|
+
// can show which schedule started it.
|
|
70
|
+
deletedAt?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// POST /api/v1/run-definitions/:definitionId/schedules body. 201 with the
|
|
74
|
+
// schedule.
|
|
75
|
+
export interface CreateScheduleTriggerRequest {
|
|
76
|
+
name?: string;
|
|
77
|
+
dataTag: string;
|
|
78
|
+
schedule: ScheduleSpec;
|
|
79
|
+
input?: unknown;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// PATCH /api/v1/schedules/:scheduleId body: any of these. Null clears the
|
|
83
|
+
// optional name and input.
|
|
84
|
+
export interface UpdateScheduleTriggerRequest {
|
|
85
|
+
name?: string | null;
|
|
86
|
+
dataTag?: string;
|
|
87
|
+
schedule?: ScheduleSpec;
|
|
88
|
+
input?: unknown;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// GET /api/v1/schedules query: all of a project's schedules.
|
|
92
|
+
export interface ListScheduleTriggersQuery {
|
|
93
|
+
projectId: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// GET /api/v1/run-definitions/:definitionId/schedules and GET /api/v1/schedules.
|
|
97
|
+
export interface ListScheduleTriggersResponse {
|
|
98
|
+
schedules: ScheduleTriggerDto[];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// GET, PATCH, POST …/pause and POST …/resume on /api/v1/schedules/:scheduleId.
|
|
102
|
+
// DELETE returns 204.
|
|
103
|
+
export type ScheduleTriggerResponse = ScheduleTriggerDto;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { dataPlaneRouteForProfile } from './data-plane-routing.js';
|
|
4
|
+
|
|
5
|
+
describe('dataPlaneRouteForProfile', () => {
|
|
6
|
+
it('returns the URL routing.json maps the profile to', () => {
|
|
7
|
+
expect(dataPlaneRouteForProfile({ 'production-us': 'https://xk4wbn.linkedin.superblocks.com' }, 'production-us')).toEqual({
|
|
8
|
+
url: 'https://xk4wbn.linkedin.superblocks.com'
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it.each([
|
|
13
|
+
['a missing profile', { production: 'https://dp.superblocks.com' }, 'staging'],
|
|
14
|
+
['no profile', { production: 'https://dp.superblocks.com' }, undefined],
|
|
15
|
+
['an empty config', {}, 'production'],
|
|
16
|
+
['a config that is not an object', ['https://dp.superblocks.com'], '0'],
|
|
17
|
+
['a null config', null, 'production'],
|
|
18
|
+
['an inherited key', {}, 'toString'],
|
|
19
|
+
['a non-string entry', { production: 42 }, 'production']
|
|
20
|
+
])('reports %s as not mapped', (_, config, profileKey) => {
|
|
21
|
+
expect(dataPlaneRouteForProfile(config, profileKey)).toEqual({ miss: 'not_mapped' });
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('never treats * as a fallback for another profile', () => {
|
|
25
|
+
const config = { '*': 'https://wildcard.superblocks.com', production: 'https://prod.superblocks.com' };
|
|
26
|
+
expect(dataPlaneRouteForProfile(config, 'staging')).toEqual({ miss: 'not_mapped' });
|
|
27
|
+
expect(dataPlaneRouteForProfile(config, 'production')).toEqual({ url: 'https://prod.superblocks.com' });
|
|
28
|
+
expect(dataPlaneRouteForProfile(config, '*')).toEqual({ url: 'https://wildcard.superblocks.com' });
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it.each([
|
|
32
|
+
['not-a-url', 'malformed'],
|
|
33
|
+
['http://dp.superblocks.com', 'not_https'],
|
|
34
|
+
['javascript:alert(1)', 'not_https'],
|
|
35
|
+
['https://evil.example.com', 'unexpected_domain'],
|
|
36
|
+
['https://superblocks.com.evil.com', 'unexpected_domain'],
|
|
37
|
+
['https://superblocks.com', 'unexpected_domain']
|
|
38
|
+
])('refuses %s as %s', (entry, miss) => {
|
|
39
|
+
expect(dataPlaneRouteForProfile({ production: entry }, 'production')).toEqual({ miss });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
|
|
11
|
+
export type DataPlaneRoute = { url: string } | { miss: DataPlaneRouteMiss };
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The data-plane URL routing.json maps a profile key to. routing.json is a flat object from profile key to a managed
|
|
15
|
+
* data plane's origin, and the browser and the server both read it to pick where a profile's executions go.
|
|
16
|
+
*
|
|
17
|
+
* Only an exact key matches: a `*` entry is never a fallback for other profiles, because a data plane serves only the
|
|
18
|
+
* profiles it declares. Only HTTPS hosts under superblocks.com are accepted, so a bad entry cannot send executions, or
|
|
19
|
+
* the credentials they carry, to another host.
|
|
20
|
+
*/
|
|
21
|
+
export function dataPlaneRouteForProfile(config: unknown, profileKey: string | undefined): DataPlaneRoute {
|
|
22
|
+
if (!profileKey || config === null || typeof config !== 'object' || Array.isArray(config) || !Object.hasOwn(config, profileKey)) {
|
|
23
|
+
return { miss: 'not_mapped' };
|
|
24
|
+
}
|
|
25
|
+
const entry: unknown = Reflect.get(config, profileKey);
|
|
26
|
+
if (typeof entry !== 'string' || !entry) return { miss: 'not_mapped' };
|
|
27
|
+
let url: URL;
|
|
28
|
+
try {
|
|
29
|
+
url = new URL(entry);
|
|
30
|
+
} catch {
|
|
31
|
+
return { miss: 'malformed' };
|
|
32
|
+
}
|
|
33
|
+
if (url.protocol !== 'https:') return { miss: 'not_https' };
|
|
34
|
+
if (!url.hostname.endsWith('.superblocks.com')) return { miss: 'unexpected_domain' };
|
|
35
|
+
return { url: entry };
|
|
36
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -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';
|
|
@@ -30,6 +30,9 @@ export const PLATFORM_MCP_SERVER_ROUTES = [
|
|
|
30
30
|
'GET /api/v2/applications/*/deploy-status/*',
|
|
31
31
|
'GET /api/v3/applications/*/connect',
|
|
32
32
|
'GET /api/v3/applications/*/branches/*/connect',
|
|
33
|
+
// Which entry point and export an SDK API's registered name runs, deployed or on a branch.
|
|
34
|
+
'GET /api/v3/applications/*/apis/*/entry',
|
|
35
|
+
'GET /api/v3/applications/*/branches/*/apis/*/entry',
|
|
33
36
|
'POST /api/v3/applications/*/*/builds',
|
|
34
37
|
'POST /api/v3/applications/*/build-bulk-status',
|
|
35
38
|
'GET /api/v1/integrations/superset',
|
|
@@ -39,6 +42,9 @@ export const PLATFORM_MCP_SERVER_ROUTES = [
|
|
|
39
42
|
'POST /api/v1/ai/generate-app-name',
|
|
40
43
|
// Reports what the Builder tools did, for usage analytics.
|
|
41
44
|
'POST /api/v1/builder-usage',
|
|
45
|
+
'POST /api/v1/mcp/data-plane',
|
|
46
|
+
// Where the hosted live canvas sends the app's API calls; never an agent record an organization registered.
|
|
47
|
+
'GET /api/v1/mcp/data-plane/destination',
|
|
42
48
|
// The plan check every Builder tool runs first, assertEnterprisePlan in @superblocksteam/mcp-server.
|
|
43
49
|
'GET /api/v1/public/users/me',
|
|
44
50
|
// The server limits the tools token here to the scopes the Builder tools mint.
|
|
@@ -47,6 +53,39 @@ export const PLATFORM_MCP_SERVER_ROUTES = [
|
|
|
47
53
|
|
|
48
54
|
export type PlatformMcpServerRoute = (typeof PLATFORM_MCP_SERVER_ROUTES)[number];
|
|
49
55
|
|
|
56
|
+
/** Interim execution boundary; RAS will replace the checked caller profile with a server-selected profile. */
|
|
57
|
+
export type PlatformMcpDataPlaneRequest = {
|
|
58
|
+
profileKey: string;
|
|
59
|
+
} & (
|
|
60
|
+
| {
|
|
61
|
+
operation: 'api_test';
|
|
62
|
+
target: { applicationId: string; branchName: string };
|
|
63
|
+
payload: {
|
|
64
|
+
entryPoint: string;
|
|
65
|
+
inputs: Record<string, unknown>;
|
|
66
|
+
exportName?: string;
|
|
67
|
+
includeDiagnostics?: boolean;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
| {
|
|
71
|
+
operation: 'integration_execute';
|
|
72
|
+
// At least one of the two. Without an app, every step must use this integration.
|
|
73
|
+
target: { integrationId?: string; applicationId?: string };
|
|
74
|
+
payload: { api: Record<string, unknown>; inputs: Record<string, unknown> };
|
|
75
|
+
}
|
|
76
|
+
| {
|
|
77
|
+
// A deployed agent's run of one of its app's APIs, by registered name. Only a deployed agent's turn may send it.
|
|
78
|
+
operation: 'app_api_run';
|
|
79
|
+
target: { applicationId: string; mode: 'deployed' } | { applicationId: string; mode: 'edit'; branchName: string };
|
|
80
|
+
payload: { apiName: string; inputs: Record<string, unknown> };
|
|
81
|
+
}
|
|
82
|
+
| {
|
|
83
|
+
operation: 'metadata_fetch';
|
|
84
|
+
target: { integrationId: string; applicationId?: string };
|
|
85
|
+
payload: { stepConfiguration?: Record<string, unknown> };
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
|
|
50
89
|
/** One value for each `*` in the route, in order. */
|
|
51
90
|
type RouteSegments<Route extends string, Values extends string[] = []> = Route extends `${string}*${infer Rest}`
|
|
52
91
|
? RouteSegments<Rest, [...Values, string]>
|