@xfey/tutti 0.1.120 → 0.1.122

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 (47) hide show
  1. package/dist/platform-outbound/repository.js +5 -0
  2. package/dist/platform-outbound/task-result-text.d.ts +3 -0
  3. package/dist/platform-outbound/task-result-text.js +26 -0
  4. package/dist/server-shell/http/routes/project-api/openapi-workspace-routes.d.ts +0 -2
  5. package/dist/server-shell/http/routes/project-api/openapi.d.ts +0 -2
  6. package/dist/server-shell/http/routes/project-api/schemas.d.ts +0 -1
  7. package/dist/server-shell/http/routes/project-api/types.d.ts +0 -1
  8. package/dist/server-shell/local-console/managed-project-routes.js +15 -1
  9. package/dist/server-shell/local-console/managed-project-service.d.ts +26 -10
  10. package/dist/server-shell/local-console/managed-project-service.js +22 -6
  11. package/dist/server-shell/local-console/project-service.d.ts +0 -1
  12. package/dist/server-shell/local-console/project-service.js +1 -2
  13. package/dist/server-shell/managed-access/legacy-records.d.ts +2 -0
  14. package/dist/server-shell/managed-access/legacy-records.js +24 -0
  15. package/dist/server-shell/managed-access/model-control-client.d.ts +0 -1
  16. package/dist/server-shell/managed-access/model-control-client.js +1 -3
  17. package/dist/server-shell/managed-access/project-provider.js +1 -1
  18. package/dist/server-shell/managed-access/records.d.ts +4 -9
  19. package/dist/server-shell/managed-access/records.js +4 -3
  20. package/dist/server-shell/managed-access/runtime-records.d.ts +4 -8
  21. package/dist/server-shell/managed-access/runtime-records.js +4 -4
  22. package/dist/server-shell/managed-access/runtime.js +5 -6
  23. package/dist/server-shell/managed-access/state.d.ts +1 -2
  24. package/dist/server-shell/managed-access/state.js +15 -10
  25. package/dist/server-shell/managed-access/transport.d.ts +0 -3
  26. package/dist/server-shell/managed-access/transport.js +2 -1
  27. package/node_modules/@tutti/relay-client/dist/project-authority.d.ts +12 -6
  28. package/node_modules/@tutti/relay-client/dist/project-authority.js +21 -3
  29. package/node_modules/@tutti/shared/dist/schemas/api/local-console-account-handoffs.d.ts +1 -0
  30. package/node_modules/@tutti/shared/dist/schemas/api/local-console-account-handoffs.js +1 -0
  31. package/node_modules/@tutti/shared/dist/schemas/api/managed-account.d.ts +0 -1
  32. package/node_modules/@tutti/shared/dist/schemas/api/managed-account.js +0 -1
  33. package/node_modules/@tutti/shared/dist/schemas/api/provider-config.d.ts +0 -1
  34. package/node_modules/@tutti/shared/dist/schemas/api/provider-config.js +0 -1
  35. package/node_modules/@tutti/shared/dist/schemas/api/runtime-events.d.ts +0 -1
  36. package/node_modules/@tutti/shared/dist/schemas/internal/creation-validation.d.ts +1 -3
  37. package/node_modules/@tutti/shared/dist/schemas/internal/creation-validation.js +2 -4
  38. package/node_modules/@tutti/shared/dist/schemas/internal/managed-runtime.d.ts +1 -4
  39. package/node_modules/@tutti/shared/dist/schemas/internal/managed-runtime.js +3 -6
  40. package/node_modules/@tutti/shared/dist/schemas/internal/project-authority.d.ts +16 -6
  41. package/node_modules/@tutti/shared/dist/schemas/internal/project-authority.js +4 -8
  42. package/package.json +1 -1
  43. package/web/assets/{homepage-motion-scene-DyMFsYmT.js → homepage-motion-scene-ClLzlKMk.js} +1 -1
  44. package/web/assets/{index-DsYi7AhN.css → index-DTaMPmTW.css} +1 -1
  45. package/web/assets/index-v5xKB6AX.js +70 -0
  46. package/web/index.html +2 -2
  47. package/web/assets/index-DSlecDXC.js +0 -70
@@ -34,7 +34,7 @@ export class NativeManagedRuntime {
34
34
  },
35
35
  ...(options.fetchImpl === undefined ? {} : { fetchImpl: options.fetchImpl }),
36
36
  });
37
- if (authority.tier !== journal.tier ||
37
+ if (authority.delegation_ref !== journal.authority.delegation_ref ||
38
38
  authority.expires_at <= Math.floor(this.now().getTime() / 1000))
39
39
  throw new ManagedLocalStateError("managed_runtime_authority_mismatch");
40
40
  return authority;
@@ -65,8 +65,7 @@ export class NativeManagedRuntime {
65
65
  if (row.project_id !== this.options.projectId ||
66
66
  row.owner.kind !== owner.kind ||
67
67
  row.owner.ref !== owner.ref ||
68
- row.installation_ref !== authority.installation_ref ||
69
- row.tier !== authority.tier)
68
+ row.installation_ref !== authority.installation_ref)
70
69
  throw new ManagedLocalStateError("managed_model_session_scope_changed");
71
70
  if (row.delegation_ref !== authority.delegation_ref ||
72
71
  row.grant_ref !== authority.grant_ref) {
@@ -85,15 +84,16 @@ export class NativeManagedRuntime {
85
84
  this.files.write(`${name}.json`, renewed);
86
85
  return renewed;
87
86
  }
87
+ if (typeof saved === "object" && "version" in saved && saved.version === 1)
88
+ this.files.write(`${name}.json`, row);
88
89
  return row;
89
90
  }
90
91
  const row = {
91
- version: 1,
92
+ version: 2,
92
93
  project_id: this.options.projectId,
93
94
  delegation_ref: authority.delegation_ref,
94
95
  grant_ref: authority.grant_ref,
95
96
  installation_ref: authority.installation_ref,
96
- tier: authority.tier,
97
97
  owner,
98
98
  session_ref: createPrefixedId(ID_PREFIXES.managedSession),
99
99
  state: "ready",
@@ -111,7 +111,6 @@ export class NativeManagedRuntime {
111
111
  async pin(name, row) {
112
112
  const pin = await this.client.pin(row.session_ref, row.route_ref);
113
113
  if (pin.session_ref !== row.session_ref ||
114
- pin.tier !== row.tier ||
115
114
  (row.route_ref !== undefined && pin.route_ref !== row.route_ref) ||
116
115
  (row.provider_identity !== undefined &&
117
116
  (row.provider_identity.model !== pin.provider.model ||
@@ -22,7 +22,6 @@ export declare class NativeManagedState {
22
22
  displayName: string;
23
23
  description?: string;
24
24
  surface: "standalone" | "feishu";
25
- tier: "light" | "high" | "max";
26
25
  requestRef?: string;
27
26
  projectId?: string;
28
27
  existing?: {
@@ -33,6 +32,7 @@ export declare class NativeManagedState {
33
32
  now?: Date;
34
33
  }): CreationJournal;
35
34
  read(requestRef: string): CreationJournal;
35
+ private readJournal;
36
36
  attachProject(requestRef: string, now?: Date): CreationJournal;
37
37
  project(projectId: string): CreationJournal;
38
38
  preparationBody(requestRef: string): PrepareProjectAuthority;
@@ -42,7 +42,6 @@ export declare class NativeManagedState {
42
42
  project_id: string;
43
43
  installation_ref: string;
44
44
  surface: string;
45
- tier: string;
46
45
  expires_at: string;
47
46
  }, now?: Date): CreationJournal;
48
47
  validation(requestRef: string, outcome: "validated" | "validation_unknown" | "validation_failed"): CreationJournal;
@@ -85,12 +85,11 @@ export class NativeManagedState {
85
85
  return this.files.transaction(() => {
86
86
  const saved = this.files.read(name);
87
87
  if (saved !== null) {
88
- const record = parseJournal(saved, this.origin, requestRef);
88
+ const record = this.readJournal(requestRef);
89
89
  if (record.workspace_root !== workspace ||
90
90
  record.display_name !== options.displayName ||
91
91
  record.description !== options.description ||
92
92
  record.surface !== options.surface ||
93
- record.tier !== options.tier ||
94
93
  (options.projectId !== undefined && record.project_id !== options.projectId) ||
95
94
  record.existing_relay_project_ref !== options.existing?.relayProjectRef ||
96
95
  record.previous_request_ref !== options.existing?.previousRequestRef ||
@@ -101,7 +100,7 @@ export class NativeManagedState {
101
100
  return record;
102
101
  }
103
102
  const record = parseJournal({
104
- version: 1,
103
+ version: 2,
105
104
  request_ref: requestRef,
106
105
  project_id: options.projectId ?? createProjectId(),
107
106
  relay_origin: this.origin,
@@ -110,7 +109,6 @@ export class NativeManagedState {
110
109
  display_name: options.displayName,
111
110
  ...(options.description === undefined ? {} : { description: options.description }),
112
111
  surface: options.surface,
113
- tier: options.tier,
114
112
  ...(options.existing === undefined
115
113
  ? {}
116
114
  : {
@@ -130,12 +128,22 @@ export class NativeManagedState {
130
128
  });
131
129
  }
132
130
  read(requestRef) {
133
- return this.files.transaction(() => parseJournal(this.files.read(this.journalName(requestRef)), this.origin, requestRef));
131
+ return this.files.transaction(() => this.readJournal(requestRef));
132
+ }
133
+ // Called only inside the private-store mutex. Upgrade metadata atomically;
134
+ // never rotate proofs, extend consent or restore revoked runtime credentials.
135
+ readJournal(requestRef) {
136
+ const name = this.journalName(requestRef);
137
+ const saved = this.files.read(name);
138
+ const row = parseJournal(saved, this.origin, requestRef);
139
+ if (saved && typeof saved === "object" && "version" in saved && saved.version === 1)
140
+ this.files.write(name, row);
141
+ return row;
134
142
  }
135
143
  attachProject(requestRef, now = new Date()) {
136
144
  this.bootstrap(requestRef, now);
137
145
  return this.files.transaction(() => {
138
- const row = parseJournal(this.files.read(this.journalName(requestRef)), this.origin, requestRef);
146
+ const row = this.readJournal(requestRef);
139
147
  const name = `project-${row.project_id}.json`;
140
148
  const old = this.files.read(name);
141
149
  if (old !== null &&
@@ -156,7 +164,7 @@ export class NativeManagedState {
156
164
  const pointer = this.files.read(`project-${projectId}.json`);
157
165
  if (!Value.Check(NativeProjectPointerSchema, pointer) || pointer.project_id !== projectId)
158
166
  throw new ManagedLocalStateError("managed_project_binding_invalid");
159
- const row = parseJournal(this.files.read(this.journalName(pointer.request_ref)), this.origin, pointer.request_ref);
167
+ const row = this.readJournal(pointer.request_ref);
160
168
  if (row.project_id !== projectId || (row.state !== "validated" && row.state !== "registered"))
161
169
  throw new ManagedLocalStateError("managed_project_binding_invalid");
162
170
  return row;
@@ -170,7 +178,6 @@ export class NativeManagedState {
170
178
  request_ref: row.request_ref,
171
179
  project_id: row.project_id,
172
180
  surface: row.surface,
173
- tier: row.tier,
174
181
  ...(row.existing_relay_project_ref === undefined
175
182
  ? {}
176
183
  : { existing_relay_project_ref: row.existing_relay_project_ref }),
@@ -201,7 +208,6 @@ export class NativeManagedState {
201
208
  if (row.project_id !== receipt.project_id ||
202
209
  row.installation_ref !== receipt.installation_ref ||
203
210
  row.surface !== receipt.surface ||
204
- row.tier !== receipt.tier ||
205
211
  !Number.isFinite(Date.parse(receipt.expires_at)) ||
206
212
  Date.parse(receipt.expires_at) > Date.parse(row.expires_at))
207
213
  throw new ManagedLocalStateError("managed_preparation_mismatch");
@@ -253,7 +259,6 @@ export class NativeManagedState {
253
259
  return this.update(requestRef, (row) => {
254
260
  if (!Value.Check(HostDelegationProjectionSchema, authority) ||
255
261
  authority.installation_ref !== row.installation_ref ||
256
- authority.tier !== row.tier ||
257
262
  (row.existing_relay_project_ref !== undefined &&
258
263
  authority.relay_project_ref !== row.existing_relay_project_ref))
259
264
  throw new ManagedLocalStateError("managed_registration_mismatch");
@@ -12,7 +12,6 @@ export declare function reconcileNativePreparation(options: {
12
12
  grant_ref: string;
13
13
  installation_ref: string;
14
14
  relay_project_ref: string;
15
- tier: "light" | "high" | "max";
16
15
  expires_at: null;
17
16
  funding_kind: "trial";
18
17
  model_access: "runtime_authority_required" | "not_enabled";
@@ -24,7 +23,6 @@ export declare function reconcileNativePreparation(options: {
24
23
  state: "revoked" | "expired" | "prepared" | "activated";
25
24
  installation_ref: string;
26
25
  surface: "standalone" | "feishu";
27
- tier: "light" | "high" | "max";
28
26
  expires_at: string;
29
27
  project_id: string;
30
28
  creation_ref: string;
@@ -38,7 +36,6 @@ export declare function validateNativePreparation(options: {
38
36
  }): Promise<{
39
37
  state: "failed" | "unknown" | "started" | "succeeded";
40
38
  installation_ref: string;
41
- tier: "light" | "high" | "max";
42
39
  reason_code: "validation_started" | "validation_succeeded" | "validation_route_unavailable" | "validation_http_rejected" | "validation_response_invalid" | "validation_transport_unknown" | "validation_interrupted";
43
40
  project_id: string;
44
41
  creation_ref: string;
@@ -25,7 +25,8 @@ export async function validateNativePreparation(options) {
25
25
  const row = options.state.read(options.requestRef);
26
26
  if (!("creation_ref" in row) ||
27
27
  row.creation_ref !== result.creation_ref ||
28
- row.tier !== result.tier)
28
+ row.project_id !== result.project_id ||
29
+ row.installation_ref !== result.installation_ref)
29
30
  throw new ManagedLocalStateError("managed_validation_mismatch");
30
31
  if (result.state === "succeeded")
31
32
  options.state.validation(options.requestRef, "validated");
@@ -1,4 +1,4 @@
1
- import { type HostDelegationStatusBody, type NativeCreationProof } from "@tutti/shared/schemas/internal";
1
+ import { type ConsoleProjectAuthority, type HostDelegationStatusBody, type NativeCreationProof } from "@tutti/shared/schemas/internal";
2
2
  export declare class NativeAuthorityTransportError extends Error {
3
3
  readonly code: string;
4
4
  readonly status?: number | undefined;
@@ -10,6 +10,17 @@ type Transport = {
10
10
  fetchImpl?: typeof fetch;
11
11
  signal?: AbortSignal;
12
12
  };
13
+ export declare function prepareNativeConsoleAuthority(options: Transport & {
14
+ body: ConsoleProjectAuthority;
15
+ }): Promise<{
16
+ relay_project_ref?: string;
17
+ expires_at: string;
18
+ state: "expired" | "prepared" | "activated" | "revoked";
19
+ installation_ref: string;
20
+ project_id: string;
21
+ surface: "standalone" | "feishu";
22
+ creation_ref: string;
23
+ }>;
13
24
  export declare function validateNativeCreationAuthority(options: Transport & {
14
25
  body: NativeCreationProof;
15
26
  }): Promise<{
@@ -17,7 +28,6 @@ export declare function validateNativeCreationAuthority(options: Transport & {
17
28
  state: "failed" | "started" | "succeeded" | "unknown";
18
29
  installation_ref: string;
19
30
  project_id: string;
20
- tier: "light" | "high" | "max";
21
31
  creation_ref: string;
22
32
  route_ref: string;
23
33
  http_status: number | null;
@@ -31,7 +41,6 @@ export declare function readNativeCreationAuthority(options: Transport & {
31
41
  relay_project_ref: string;
32
42
  installation_ref: string;
33
43
  funding_kind: "trial";
34
- tier: "light" | "high" | "max";
35
44
  delegation_ref: string;
36
45
  grant_ref: string;
37
46
  model_access: "runtime_authority_required" | "not_enabled";
@@ -44,7 +53,6 @@ export declare function readNativeCreationAuthority(options: Transport & {
44
53
  state: "expired" | "prepared" | "activated" | "revoked";
45
54
  installation_ref: string;
46
55
  project_id: string;
47
- tier: "light" | "high" | "max";
48
56
  surface: "standalone" | "feishu";
49
57
  creation_ref: string;
50
58
  };
@@ -57,7 +65,6 @@ export declare function readNativeHostAuthority(options: Transport & {
57
65
  relay_project_ref: string;
58
66
  installation_ref: string;
59
67
  funding_kind: "trial";
60
- tier: "light" | "high" | "max";
61
68
  delegation_ref: string;
62
69
  grant_ref: string;
63
70
  model_access: "runtime_authority_required" | "not_enabled";
@@ -67,7 +74,6 @@ export declare function authorizeNativeModelRuntime(options: Transport & {
67
74
  }): Promise<{
68
75
  expires_at: number;
69
76
  authorization: string;
70
- tier: "light" | "high" | "max";
71
77
  delegation_ref: string;
72
78
  control_origin: string;
73
79
  }>;
@@ -1,5 +1,5 @@
1
1
  import { Value } from "@sinclair/typebox/value";
2
- import { HostDelegationProjectionSchema, HostDelegationStatusBodySchema, NativeCreationProofSchema, NativeCreationStatusSchema, CreationValidationResultSchema, NativeRuntimeAuthorizationSchema, } from "@tutti/shared/schemas/internal";
2
+ import { HostDelegationProjectionSchema, HostDelegationStatusBodySchema, NativeCreationProofSchema, NativeCreationStatusSchema, CreationValidationResultSchema, NativeRuntimeAuthorizationSchema, ConsoleProjectAuthoritySchema, ManagedCreationProjectionSchema, } from "@tutti/shared/schemas/internal";
3
3
  export class NativeAuthorityTransportError extends Error {
4
4
  code;
5
5
  status;
@@ -13,6 +13,15 @@ export class NativeAuthorityTransportError extends Error {
13
13
  }
14
14
  }
15
15
  const safeReasons = new Set([
16
+ "console_setup_access_invalid",
17
+ "project_already_registered",
18
+ "project_authority_conflict",
19
+ "command_replay_mismatch",
20
+ "creation_limit_reached",
21
+ "project_creation_pending",
22
+ "installation_identity_conflict",
23
+ "host_delegation_already_active",
24
+ "host_delegation_revocation_pending",
16
25
  "account_session_required",
17
26
  "account_authority_inactive",
18
27
  "project_owner_required",
@@ -95,6 +104,16 @@ async function request(options, path, body, schema, timeoutMs = 15_000) {
95
104
  : new NativeAuthorityTransportError("managed_authority_unavailable");
96
105
  }
97
106
  }
107
+ export async function prepareNativeConsoleAuthority(options) {
108
+ if (!Value.Check(ConsoleProjectAuthoritySchema, options.body))
109
+ throw new NativeAuthorityTransportError("managed_authority_invalid_request");
110
+ const result = await request(options, "/host-control/v1/managed-authority/prepare", options.body, ManagedCreationProjectionSchema);
111
+ if (result.project_id !== options.body.preparation.project_id ||
112
+ result.surface !== options.body.preparation.surface ||
113
+ result.installation_ref !== options.body.preparation.installation_ref)
114
+ throw new NativeAuthorityTransportError("managed_authority_invalid_response");
115
+ return result;
116
+ }
98
117
  export async function validateNativeCreationAuthority(options) {
99
118
  if (!Value.Check(NativeCreationProofSchema, options.body))
100
119
  throw new NativeAuthorityTransportError("managed_authority_invalid_request");
@@ -113,8 +132,7 @@ export async function readNativeCreationAuthority(options) {
113
132
  result.creation.installation_ref !== options.body.installation_ref ||
114
133
  (result.creation.state === "activated") !== (result.authority !== undefined) ||
115
134
  (result.authority !== undefined &&
116
- (result.authority.tier !== result.creation.tier ||
117
- result.authority.installation_ref !== options.body.installation_ref ||
135
+ (result.authority.installation_ref !== options.body.installation_ref ||
118
136
  result.authority.relay_project_ref !== result.creation.relay_project_ref)))
119
137
  throw new NativeAuthorityTransportError("managed_authority_invalid_response");
120
138
  return result;
@@ -2,6 +2,7 @@ import type { Static } from "@sinclair/typebox";
2
2
  export declare const LOCAL_CONSOLE_ACCOUNT_HANDOFF_TOKEN_MIN_LENGTH = 32;
3
3
  export declare const LOCAL_CONSOLE_ACCOUNT_HANDOFF_TOKEN_MAX_LENGTH = 128;
4
4
  export declare const RegisterLocalConsoleAccountHandoffBodySchema: import("@sinclair/typebox").TObject<{
5
+ setup_access: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TLiteral<true>>;
5
6
  handoff_token: import("@sinclair/typebox").TString;
6
7
  }>;
7
8
  export declare const RegisterLocalConsoleAccountHandoffResponseSchema: import("@sinclair/typebox").TObject<{
@@ -3,6 +3,7 @@ import { IsoDateTimeStringSchema } from "../domain/index.js";
3
3
  export const LOCAL_CONSOLE_ACCOUNT_HANDOFF_TOKEN_MIN_LENGTH = 32;
4
4
  export const LOCAL_CONSOLE_ACCOUNT_HANDOFF_TOKEN_MAX_LENGTH = 128;
5
5
  export const RegisterLocalConsoleAccountHandoffBodySchema = Type.Object({
6
+ setup_access: Type.Optional(Type.Literal(true)),
6
7
  handoff_token: Type.String({
7
8
  minLength: LOCAL_CONSOLE_ACCOUNT_HANDOFF_TOKEN_MIN_LENGTH,
8
9
  maxLength: LOCAL_CONSOLE_ACCOUNT_HANDOFF_TOKEN_MAX_LENGTH,
@@ -18,7 +18,6 @@ export declare const ManagedAccountOverviewSchema: import("@sinclair/typebox").T
18
18
  relay_project_ref: import("@sinclair/typebox").TString;
19
19
  project_name: import("@sinclair/typebox").TString;
20
20
  surface: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"standalone">, import("@sinclair/typebox").TLiteral<"feishu">]>;
21
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
22
21
  created_at: import("@sinclair/typebox").TString;
23
22
  state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"active">, import("@sinclair/typebox").TLiteral<"revoked">]>;
24
23
  downstream_keys: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"not_requested">, import("@sinclair/typebox").TLiteral<"pending">, import("@sinclair/typebox").TLiteral<"confirmed">]>;
@@ -21,7 +21,6 @@ export const ManagedAccountOverviewSchema = Type.Object({
21
21
  relay_project_ref: RelayProjectRefSchema,
22
22
  project_name: Type.String(),
23
23
  surface: Type.Union([Type.Literal("standalone"), Type.Literal("feishu")]),
24
- tier: Type.Union([Type.Literal("light"), Type.Literal("high"), Type.Literal("max")]),
25
24
  created_at: timestamp,
26
25
  state: Type.Union([Type.Literal("active"), Type.Literal("revoked")]),
27
26
  downstream_keys: Type.Union([
@@ -41,7 +41,6 @@ export declare const ProviderConfigProjectionSchema: import("@sinclair/typebox")
41
41
  }>, import("@sinclair/typebox").TObject<{
42
42
  status: import("@sinclair/typebox").TLiteral<"managed">;
43
43
  funding_kind: import("@sinclair/typebox").TLiteral<"trial">;
44
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
45
44
  }>, import("@sinclair/typebox").TObject<{
46
45
  status: import("@sinclair/typebox").TLiteral<"configured">;
47
46
  provider: import("@sinclair/typebox").TLiteral<"openai">;
@@ -73,7 +73,6 @@ export const ProviderConfigProjectionSchema = Type.Union([
73
73
  Type.Object({
74
74
  status: Type.Literal("managed"),
75
75
  funding_kind: Type.Literal("trial"),
76
- tier: Type.Union([Type.Literal("light"), Type.Literal("high"), Type.Literal("max")]),
77
76
  }, { additionalProperties: false }),
78
77
  Type.Object({
79
78
  status: Type.Literal("configured"),
@@ -540,7 +540,6 @@ export declare const ProviderConfigChangedEventPayloadSchema: import("@sinclair/
540
540
  }>, import("@sinclair/typebox").TObject<{
541
541
  status: import("@sinclair/typebox").TLiteral<"managed">;
542
542
  funding_kind: import("@sinclair/typebox").TLiteral<"trial">;
543
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
544
543
  }>, import("@sinclair/typebox").TObject<{
545
544
  status: import("@sinclair/typebox").TLiteral<"configured">;
546
545
  provider: import("@sinclair/typebox").TLiteral<"openai">;
@@ -1,13 +1,12 @@
1
1
  import { type Static } from "@sinclair/typebox";
2
2
  export declare const CreationValidationAuthoritySchema: import("@sinclair/typebox").TObject<{
3
- version: import("@sinclair/typebox").TLiteral<1>;
3
+ version: import("@sinclair/typebox").TLiteral<2>;
4
4
  audience: import("@sinclair/typebox").TLiteral<"tutti-creation-validation">;
5
5
  issuer: import("@sinclair/typebox").TString;
6
6
  account_ref: import("@sinclair/typebox").TString;
7
7
  creation_ref: import("@sinclair/typebox").TString;
8
8
  project_id: import("@sinclair/typebox").TString;
9
9
  installation_ref: import("@sinclair/typebox").TString;
10
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
11
10
  creation_expires_at: import("@sinclair/typebox").TInteger;
12
11
  nonce: import("@sinclair/typebox").TString;
13
12
  issued_at: import("@sinclair/typebox").TInteger;
@@ -18,7 +17,6 @@ export declare const CreationValidationResultSchema: import("@sinclair/typebox")
18
17
  creation_ref: import("@sinclair/typebox").TString;
19
18
  project_id: import("@sinclair/typebox").TString;
20
19
  installation_ref: import("@sinclair/typebox").TString;
21
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
22
20
  route_ref: import("@sinclair/typebox").TString;
23
21
  state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"started">, import("@sinclair/typebox").TLiteral<"succeeded">, import("@sinclair/typebox").TLiteral<"failed">, import("@sinclair/typebox").TLiteral<"unknown">]>;
24
22
  reason_code: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"validation_started">, import("@sinclair/typebox").TLiteral<"validation_succeeded">, import("@sinclair/typebox").TLiteral<"validation_route_unavailable">, import("@sinclair/typebox").TLiteral<"validation_http_rejected">, import("@sinclair/typebox").TLiteral<"validation_response_invalid">, import("@sinclair/typebox").TLiteral<"validation_transport_unknown">, import("@sinclair/typebox").TLiteral<"validation_interrupted">]>;
@@ -1,16 +1,15 @@
1
1
  import { Type } from "@sinclair/typebox";
2
2
  import { IdempotencyKeySchema, ProjectIdSchema, RelayAccountRefSchema } from "../domain/index.js";
3
- import { HostInstallationRefSchema, ManagedCreationRefSchema, ManagedTierSchema, } from "./project-authority.js";
3
+ import { HostInstallationRefSchema, ManagedCreationRefSchema } from "./project-authority.js";
4
4
  // A fixed platform-funded connectivity probe, never a general model/key capability.
5
5
  export const CreationValidationAuthoritySchema = Type.Object({
6
- version: Type.Literal(1),
6
+ version: Type.Literal(2),
7
7
  audience: Type.Literal("tutti-creation-validation"),
8
8
  issuer: Type.String({ minLength: 1, maxLength: 200 }),
9
9
  account_ref: RelayAccountRefSchema,
10
10
  creation_ref: ManagedCreationRefSchema,
11
11
  project_id: ProjectIdSchema,
12
12
  installation_ref: HostInstallationRefSchema,
13
- tier: ManagedTierSchema,
14
13
  creation_expires_at: Type.Integer({ minimum: 0 }),
15
14
  nonce: IdempotencyKeySchema,
16
15
  issued_at: Type.Integer({ minimum: 0 }),
@@ -20,7 +19,6 @@ export const CreationValidationResultSchema = Type.Object({
20
19
  creation_ref: ManagedCreationRefSchema,
21
20
  project_id: ProjectIdSchema,
22
21
  installation_ref: HostInstallationRefSchema,
23
- tier: ManagedTierSchema,
24
22
  route_ref: Type.String({ pattern: "^[a-z0-9][a-z0-9-]{1,60}$" }),
25
23
  state: Type.Union([
26
24
  Type.Literal("started"),
@@ -8,7 +8,6 @@ export declare const ManagedDelegationScopeFields: {
8
8
  };
9
9
  export declare const ManagedRuntimeAuthoritySchema: import("@sinclair/typebox").TObject<{
10
10
  funding_kind: import("@sinclair/typebox").TLiteral<"trial">;
11
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
12
11
  account_ref: import("@sinclair/typebox").TString;
13
12
  relay_project_ref: import("@sinclair/typebox").TString;
14
13
  delegation_ref: import("@sinclair/typebox").TString;
@@ -18,7 +17,7 @@ export declare const ManagedRuntimeAuthoritySchema: import("@sinclair/typebox").
18
17
  nonce: import("@sinclair/typebox").TString;
19
18
  issued_at: import("@sinclair/typebox").TInteger;
20
19
  expires_at: import("@sinclair/typebox").TInteger;
21
- version: import("@sinclair/typebox").TLiteral<2>;
20
+ version: import("@sinclair/typebox").TLiteral<3>;
22
21
  audience: import("@sinclair/typebox").TLiteral<"tutti-managed-runtime">;
23
22
  }>;
24
23
  export type ManagedRuntimeAuthority = Static<typeof ManagedRuntimeAuthoritySchema>;
@@ -41,7 +40,6 @@ export declare const NativeRuntimeAuthorizationSchema: import("@sinclair/typebox
41
40
  expires_at: import("@sinclair/typebox").TInteger;
42
41
  control_origin: import("@sinclair/typebox").TString;
43
42
  delegation_ref: import("@sinclair/typebox").TString;
44
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
45
43
  }>;
46
44
  export declare const ManagedRuntimeSessionRefSchema: import("@sinclair/typebox").TString;
47
45
  export declare const ManagedRuntimeCredentialRefSchema: import("@sinclair/typebox").TString;
@@ -53,7 +51,6 @@ export declare const ManagedProviderIdentitySchema: import("@sinclair/typebox").
53
51
  export declare const ManagedSessionResultSchema: import("@sinclair/typebox").TObject<{
54
52
  session_ref: import("@sinclair/typebox").TString;
55
53
  route_ref: import("@sinclair/typebox").TString;
56
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
57
54
  disposition: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"created">, import("@sinclair/typebox").TLiteral<"existing">]>;
58
55
  provider: import("@sinclair/typebox").TObject<{
59
56
  base_url: import("@sinclair/typebox").TString;
@@ -1,7 +1,7 @@
1
1
  import { Type } from "@sinclair/typebox";
2
2
  import { ID_PREFIXES, ULID_BODY_PATTERN } from "../../ids/index.js";
3
3
  import { RelayAccountRefSchema, RelayProjectRefSchema, IdempotencyKeySchema, } from "../domain/index.js";
4
- import { HostDelegationRefSchema, HostInstallationRefSchema, ProjectModelGrantRefSchema, ManagedTierSchema, } from "./project-authority.js";
4
+ import { HostDelegationRefSchema, HostInstallationRefSchema, ProjectModelGrantRefSchema, } from "./project-authority.js";
5
5
  export const ManagedDelegationScopeFields = {
6
6
  account_ref: RelayAccountRefSchema,
7
7
  relay_project_ref: RelayProjectRefSchema,
@@ -16,12 +16,11 @@ const CapabilityFields = {
16
16
  expires_at: Type.Integer({ minimum: 0 }),
17
17
  };
18
18
  export const ManagedRuntimeAuthoritySchema = Type.Object({
19
- version: Type.Literal(2),
19
+ version: Type.Literal(3),
20
20
  audience: Type.Literal("tutti-managed-runtime"),
21
21
  ...CapabilityFields,
22
22
  ...ManagedDelegationScopeFields,
23
23
  funding_kind: Type.Literal("trial"),
24
- tier: ManagedTierSchema,
25
24
  }, { additionalProperties: false });
26
25
  // Operator/service control only; never issued to native or browser callers.
27
26
  export const ManagedRevocationAuthoritySchema = Type.Object({
@@ -32,13 +31,12 @@ export const ManagedRevocationAuthoritySchema = Type.Object({
32
31
  }, { additionalProperties: false });
33
32
  export const NativeRuntimeAuthorizationSchema = Type.Object({
34
33
  authorization: Type.String({
35
- pattern: "^tma2\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{86}$",
34
+ pattern: "^tma3\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]{86}$",
36
35
  maxLength: 3500,
37
36
  }),
38
37
  expires_at: Type.Integer({ minimum: 0 }),
39
38
  control_origin: Type.String({ minLength: 1, maxLength: 500 }),
40
39
  delegation_ref: HostDelegationRefSchema,
41
- tier: ManagedTierSchema,
42
40
  }, { additionalProperties: false });
43
41
  const managedId = (prefix) => Type.String({ pattern: `^${prefix}${ULID_BODY_PATTERN}$` });
44
42
  export const ManagedRuntimeSessionRefSchema = managedId(ID_PREFIXES.managedSession);
@@ -51,7 +49,6 @@ export const ManagedProviderIdentitySchema = Type.Object({
51
49
  export const ManagedSessionResultSchema = Type.Object({
52
50
  session_ref: ManagedRuntimeSessionRefSchema,
53
51
  route_ref: ManagedRouteRefSchema,
54
- tier: ManagedTierSchema,
55
52
  disposition: Type.Union([Type.Literal("created"), Type.Literal("existing")]),
56
53
  provider: ManagedProviderIdentitySchema,
57
54
  }, { additionalProperties: false });
@@ -7,7 +7,6 @@ export declare const AuthoritySecretSchema: import("@sinclair/typebox").TString;
7
7
  export declare const AuthoritySecretHashSchema: import("@sinclair/typebox").TString;
8
8
  export declare const AuthorityTimestampSchema: import("@sinclair/typebox").TString;
9
9
  export declare function isAuthorityTimestamp(value: string): boolean;
10
- export declare const ManagedTierSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
11
10
  export declare const PROJECT_TRIAL_POLICY = "trial-project-v1";
12
11
  export declare const PrepareProjectAuthoritySchema: import("@sinclair/typebox").TObject<{
13
12
  request_ref: import("@sinclair/typebox").TString;
@@ -18,11 +17,26 @@ export declare const PrepareProjectAuthoritySchema: import("@sinclair/typebox").
18
17
  installation_secret_hash: import("@sinclair/typebox").TString;
19
18
  handoff_token_hash: import("@sinclair/typebox").TString;
20
19
  host_registration_secret_hash: import("@sinclair/typebox").TString;
21
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
22
20
  trial_consent: import("@sinclair/typebox").TLiteral<"trial-project-v1">;
23
21
  expires_before: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
24
22
  }>;
25
23
  export type PrepareProjectAuthority = Static<typeof PrepareProjectAuthoritySchema>;
24
+ export declare const ConsoleProjectAuthoritySchema: import("@sinclair/typebox").TObject<{
25
+ console_token: import("@sinclair/typebox").TString;
26
+ preparation: import("@sinclair/typebox").TObject<{
27
+ request_ref: import("@sinclair/typebox").TString;
28
+ project_id: import("@sinclair/typebox").TString;
29
+ surface: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"standalone">, import("@sinclair/typebox").TLiteral<"feishu">]>;
30
+ existing_relay_project_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
31
+ installation_ref: import("@sinclair/typebox").TString;
32
+ installation_secret_hash: import("@sinclair/typebox").TString;
33
+ handoff_token_hash: import("@sinclair/typebox").TString;
34
+ host_registration_secret_hash: import("@sinclair/typebox").TString;
35
+ trial_consent: import("@sinclair/typebox").TLiteral<"trial-project-v1">;
36
+ expires_before: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
37
+ }>;
38
+ }>;
39
+ export type ConsoleProjectAuthority = Static<typeof ConsoleProjectAuthoritySchema>;
26
40
  export declare const ManagedProjectBootstrapSchema: import("@sinclair/typebox").TObject<{
27
41
  kind: import("@sinclair/typebox").TLiteral<"managed_project_authority_v2">;
28
42
  creation_ref: import("@sinclair/typebox").TString;
@@ -45,7 +59,6 @@ export declare const HostDelegationProjectionSchema: import("@sinclair/typebox")
45
59
  grant_ref: import("@sinclair/typebox").TString;
46
60
  relay_project_ref: import("@sinclair/typebox").TString;
47
61
  installation_ref: import("@sinclair/typebox").TString;
48
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
49
62
  funding_kind: import("@sinclair/typebox").TLiteral<"trial">;
50
63
  expires_at: import("@sinclair/typebox").TNull;
51
64
  state: import("@sinclair/typebox").TLiteral<"active">;
@@ -57,7 +70,6 @@ export declare const ManagedCreationProjectionSchema: import("@sinclair/typebox"
57
70
  project_id: import("@sinclair/typebox").TString;
58
71
  surface: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"standalone">, import("@sinclair/typebox").TLiteral<"feishu">]>;
59
72
  installation_ref: import("@sinclair/typebox").TString;
60
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
61
73
  expires_at: import("@sinclair/typebox").TString;
62
74
  state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"prepared">, import("@sinclair/typebox").TLiteral<"activated">, import("@sinclair/typebox").TLiteral<"expired">, import("@sinclair/typebox").TLiteral<"revoked">]>;
63
75
  relay_project_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -80,7 +92,6 @@ export declare const NativeCreationStatusSchema: import("@sinclair/typebox").TOb
80
92
  project_id: import("@sinclair/typebox").TString;
81
93
  surface: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"standalone">, import("@sinclair/typebox").TLiteral<"feishu">]>;
82
94
  installation_ref: import("@sinclair/typebox").TString;
83
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
84
95
  expires_at: import("@sinclair/typebox").TString;
85
96
  state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"prepared">, import("@sinclair/typebox").TLiteral<"activated">, import("@sinclair/typebox").TLiteral<"expired">, import("@sinclair/typebox").TLiteral<"revoked">]>;
86
97
  relay_project_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -90,7 +101,6 @@ export declare const NativeCreationStatusSchema: import("@sinclair/typebox").TOb
90
101
  grant_ref: import("@sinclair/typebox").TString;
91
102
  relay_project_ref: import("@sinclair/typebox").TString;
92
103
  installation_ref: import("@sinclair/typebox").TString;
93
- tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"light">, import("@sinclair/typebox").TLiteral<"high">, import("@sinclair/typebox").TLiteral<"max">]>;
94
104
  funding_kind: import("@sinclair/typebox").TLiteral<"trial">;
95
105
  expires_at: import("@sinclair/typebox").TNull;
96
106
  state: import("@sinclair/typebox").TLiteral<"active">;
@@ -16,11 +16,6 @@ export function isAuthorityTimestamp(value) {
16
16
  const time = Date.parse(value);
17
17
  return Number.isFinite(time) && new Date(time).toISOString() === value;
18
18
  }
19
- export const ManagedTierSchema = Type.Union([
20
- Type.Literal("light"),
21
- Type.Literal("high"),
22
- Type.Literal("max"),
23
- ]);
24
19
  export const PROJECT_TRIAL_POLICY = "trial-project-v1";
25
20
  // Preparation creates no model credential or project truth. Native secrets never go to Web.
26
21
  export const PrepareProjectAuthoritySchema = Type.Object({
@@ -32,10 +27,13 @@ export const PrepareProjectAuthoritySchema = Type.Object({
32
27
  installation_secret_hash: AuthoritySecretHashSchema,
33
28
  handoff_token_hash: AuthoritySecretHashSchema,
34
29
  host_registration_secret_hash: AuthoritySecretHashSchema,
35
- tier: ManagedTierSchema,
36
30
  trial_consent: Type.Literal(PROJECT_TRIAL_POLICY),
37
31
  expires_before: Type.Optional(AuthorityTimestampSchema),
38
32
  }, { additionalProperties: false });
33
+ export const ConsoleProjectAuthoritySchema = Type.Object({
34
+ console_token: AuthoritySecretSchema,
35
+ preparation: PrepareProjectAuthoritySchema,
36
+ }, { additionalProperties: false });
39
37
  export const ManagedProjectBootstrapSchema = Type.Object({
40
38
  kind: Type.Literal("managed_project_authority_v2"),
41
39
  creation_ref: ManagedCreationRefSchema,
@@ -56,7 +54,6 @@ export const HostDelegationProjectionSchema = Type.Object({
56
54
  grant_ref: ProjectModelGrantRefSchema,
57
55
  relay_project_ref: RelayProjectRefSchema,
58
56
  installation_ref: HostInstallationRefSchema,
59
- tier: ManagedTierSchema,
60
57
  funding_kind: Type.Literal("trial"),
61
58
  expires_at: Type.Null(),
62
59
  state: Type.Literal("active"),
@@ -72,7 +69,6 @@ export const ManagedCreationProjectionSchema = Type.Object({
72
69
  project_id: ProjectIdSchema,
73
70
  surface: Type.Union([Type.Literal("standalone"), Type.Literal("feishu")]),
74
71
  installation_ref: HostInstallationRefSchema,
75
- tier: ManagedTierSchema,
76
72
  expires_at: AuthorityTimestampSchema,
77
73
  state: Type.Union([
78
74
  Type.Literal("prepared"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfey/tutti",
3
- "version": "0.1.120",
3
+ "version": "0.1.122",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",