@myagentroam/protocol 0.9.119 → 0.9.121

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.
@@ -1,7 +1,4 @@
1
1
  import { z } from 'zod';
2
- export declare const PERSONAL_GIT_NODE_VERSION = "0.9.63";
3
- /** The credential-bound commit identity payload is incompatible with the 0.9.63 runtime shape. */
4
- export declare const PERSONAL_GIT_IDENTITY_NODE_VERSION = "0.9.64";
5
2
  export declare const personalGitIdentitySchema: z.ZodEffects<z.ZodObject<{
6
3
  name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
7
4
  email: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
@@ -490,8 +487,8 @@ export declare const workspaceGitSettingsSchema: z.ZodObject<{
490
487
  }, {
491
488
  preserveGitConfig: boolean;
492
489
  }>;
493
- /** Converts the previous account-level identity record to per-credential identities on read. */
494
- export declare function migratePersonalGitRuntime(value: unknown): PersonalGitRuntime;
490
+ /** Reject unsupported persisted Git configuration shapes at the owning boundary. */
491
+ export declare function parsePersonalGitRuntime(value: unknown): PersonalGitRuntime;
495
492
  export declare function gitCredentialScopeKey(credential: Pick<GitCredential, 'protocol' | 'host' | 'port' | 'pathPrefix'>): string;
496
493
  export interface GitCredentialTarget {
497
494
  readonly protocol: 'HTTPS' | 'SSH';
@@ -500,6 +497,3 @@ export interface GitCredentialTarget {
500
497
  readonly path: string;
501
498
  }
502
499
  export declare function selectGitCredential<T extends Pick<GitCredential, 'protocol' | 'host' | 'port' | 'pathPrefix'>>(credentials: readonly T[], target: GitCredentialTarget): T | undefined;
503
- export declare function supportsPersonalGit(version: string | undefined): boolean;
504
- /** Gates forwarding of the credential-bound commit identity runtime payload. */
505
- export declare function supportsPersonalGitIdentity(version: string | undefined): boolean;
@@ -1,7 +1,4 @@
1
1
  import { z } from 'zod';
2
- export const PERSONAL_GIT_NODE_VERSION = '0.9.63';
3
- /** The credential-bound commit identity payload is incompatible with the 0.9.63 runtime shape. */
4
- export const PERSONAL_GIT_IDENTITY_NODE_VERSION = '0.9.64';
5
2
  const cleanLine = z
6
3
  .string()
7
4
  .trim()
@@ -246,41 +243,12 @@ export const personalGitSummarySchema = z
246
243
  })
247
244
  .strict();
248
245
  export const workspaceGitSettingsSchema = z.object({ preserveGitConfig: z.boolean() }).strict();
249
- const legacyGitCredentialSchema = z
250
- .object({
251
- name: cleanLine.refine((value) => value.length > 0),
252
- protocol: z.enum(['HTTPS', 'SSH']),
253
- host: hostSchema,
254
- port: z.number().int().min(1).max(65_535),
255
- pathPrefix: pathSchema,
256
- username: cleanLine.refine((value) => value.length > 0),
257
- id: z.string().min(1).max(128),
258
- secret: secretSchema,
259
- passphrase: passphraseSchema.optional()
260
- })
261
- .strict()
262
- .superRefine(credentialIssues);
263
- const legacyPersonalGitRuntimeSchema = z
264
- .object({
265
- identity: personalGitIdentitySchema,
266
- credentials: z.array(legacyGitCredentialSchema).max(64)
267
- })
268
- .strict();
269
- /** Converts the previous account-level identity record to per-credential identities on read. */
270
- export function migratePersonalGitRuntime(value) {
246
+ /** Reject unsupported persisted Git configuration shapes at the owning boundary. */
247
+ export function parsePersonalGitRuntime(value) {
271
248
  const current = personalGitRuntimeSchema.safeParse(value);
272
249
  if (current.success)
273
250
  return current.data;
274
- const legacy = legacyPersonalGitRuntimeSchema.safeParse(value);
275
- if (!legacy.success)
276
- throw new Error('GIT_CONFIGURATION_INVALID');
277
- return personalGitRuntimeSchema.parse({
278
- credentials: legacy.data.credentials.map((credential) => ({
279
- ...credential,
280
- commitName: legacy.data.identity.name,
281
- commitEmail: legacy.data.identity.email
282
- }))
283
- });
251
+ throw new Error('GIT_CONFIGURATION_INVALID');
284
252
  }
285
253
  export function gitCredentialScopeKey(credential) {
286
254
  return JSON.stringify([
@@ -307,25 +275,3 @@ export function selectGitCredential(credentials, target) {
307
275
  (entry.pathPrefix === '' || path === entry.pathPrefix))
308
276
  .sort((left, right) => right.pathPrefix.length - left.pathPrefix.length)[0];
309
277
  }
310
- export function supportsPersonalGit(version) {
311
- return supportsVersion(version, PERSONAL_GIT_NODE_VERSION);
312
- }
313
- /** Gates forwarding of the credential-bound commit identity runtime payload. */
314
- export function supportsPersonalGitIdentity(version) {
315
- return supportsVersion(version, PERSONAL_GIT_IDENTITY_NODE_VERSION);
316
- }
317
- function supportsVersion(version, minimum) {
318
- if (version === undefined || !/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u.test(version))
319
- return false;
320
- const parts = version.split('.').map(Number);
321
- if (!parts.every(Number.isSafeInteger))
322
- return false;
323
- const baseline = minimum.split('.').map(Number);
324
- for (let i = 0; i < 3; i++) {
325
- if (parts[i] > baseline[i])
326
- return true;
327
- if (parts[i] < baseline[i])
328
- return false;
329
- }
330
- return true;
331
- }
package/dist/index.d.ts CHANGED
@@ -15,7 +15,8 @@ export declare const healthStatusSchema: z.ZodObject<{
15
15
  }>;
16
16
  export type HealthStatus = z.infer<typeof healthStatusSchema>;
17
17
  /** The only wire protocol version understood by this build. */
18
- export declare const NODE_PROTOCOL_VERSION = 2;
18
+ /** Breaking required wire fields or semantics requires a new version and coordinated peers. */
19
+ export declare const NODE_PROTOCOL_VERSION = 3;
19
20
  export declare const WORKBENCH_PROTOCOL_VERSION = 1;
20
21
  export declare const nodePlatformSchema: z.ZodEnum<["windows", "linux", "macos"]>;
21
22
  export declare const runnerAvailabilitySchema: z.ZodObject<{
@@ -25304,7 +25305,7 @@ export type WorkspaceGitWorktreeSummary = z.infer<typeof workspaceGitWorktreeSum
25304
25305
  export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<{
25305
25306
  repositoryPath: z.ZodString;
25306
25307
  repositoryName: z.ZodString;
25307
- source: z.ZodOptional<z.ZodEnum<["ROOT", "SUBMODULE", "WORKTREE"]>>;
25308
+ source: z.ZodEnum<["ROOT", "SUBMODULE", "WORKTREE"]>;
25308
25309
  worktreePath: z.ZodOptional<z.ZodString>;
25309
25310
  physicalPath: z.ZodOptional<z.ZodString>;
25310
25311
  current: z.ZodOptional<z.ZodBoolean>;
@@ -25366,6 +25367,7 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25366
25367
  diffAvailable: boolean;
25367
25368
  binary: boolean;
25368
25369
  }[];
25370
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25369
25371
  repositoryName: string;
25370
25372
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25371
25373
  worktreePath?: string | undefined;
@@ -25376,7 +25378,6 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25376
25378
  details?: string | undefined;
25377
25379
  parameters?: Record<string, string | number> | undefined;
25378
25380
  } | undefined;
25379
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25380
25381
  current?: boolean | undefined;
25381
25382
  locked?: boolean | undefined;
25382
25383
  prunable?: boolean | undefined;
@@ -25393,6 +25394,7 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25393
25394
  diffAvailable: boolean;
25394
25395
  binary: boolean;
25395
25396
  }[];
25397
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25396
25398
  repositoryName: string;
25397
25399
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25398
25400
  worktreePath?: string | undefined;
@@ -25403,7 +25405,6 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25403
25405
  details?: string | undefined;
25404
25406
  parameters?: Record<string, string | number> | undefined;
25405
25407
  } | undefined;
25406
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25407
25408
  current?: boolean | undefined;
25408
25409
  locked?: boolean | undefined;
25409
25410
  prunable?: boolean | undefined;
@@ -25420,6 +25421,7 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25420
25421
  diffAvailable: boolean;
25421
25422
  binary: boolean;
25422
25423
  }[];
25424
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25423
25425
  repositoryName: string;
25424
25426
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25425
25427
  worktreePath?: string | undefined;
@@ -25430,7 +25432,6 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25430
25432
  details?: string | undefined;
25431
25433
  parameters?: Record<string, string | number> | undefined;
25432
25434
  } | undefined;
25433
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25434
25435
  current?: boolean | undefined;
25435
25436
  locked?: boolean | undefined;
25436
25437
  prunable?: boolean | undefined;
@@ -25447,6 +25448,7 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25447
25448
  diffAvailable: boolean;
25448
25449
  binary: boolean;
25449
25450
  }[];
25451
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25450
25452
  repositoryName: string;
25451
25453
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25452
25454
  worktreePath?: string | undefined;
@@ -25457,7 +25459,6 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25457
25459
  details?: string | undefined;
25458
25460
  parameters?: Record<string, string | number> | undefined;
25459
25461
  } | undefined;
25460
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25461
25462
  current?: boolean | undefined;
25462
25463
  locked?: boolean | undefined;
25463
25464
  prunable?: boolean | undefined;
@@ -25494,7 +25495,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25494
25495
  repositories: z.ZodArray<z.ZodEffects<z.ZodObject<{
25495
25496
  repositoryPath: z.ZodString;
25496
25497
  repositoryName: z.ZodString;
25497
- source: z.ZodOptional<z.ZodEnum<["ROOT", "SUBMODULE", "WORKTREE"]>>;
25498
+ source: z.ZodEnum<["ROOT", "SUBMODULE", "WORKTREE"]>;
25498
25499
  worktreePath: z.ZodOptional<z.ZodString>;
25499
25500
  physicalPath: z.ZodOptional<z.ZodString>;
25500
25501
  current: z.ZodOptional<z.ZodBoolean>;
@@ -25556,6 +25557,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25556
25557
  diffAvailable: boolean;
25557
25558
  binary: boolean;
25558
25559
  }[];
25560
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25559
25561
  repositoryName: string;
25560
25562
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25561
25563
  worktreePath?: string | undefined;
@@ -25566,7 +25568,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25566
25568
  details?: string | undefined;
25567
25569
  parameters?: Record<string, string | number> | undefined;
25568
25570
  } | undefined;
25569
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25570
25571
  current?: boolean | undefined;
25571
25572
  locked?: boolean | undefined;
25572
25573
  prunable?: boolean | undefined;
@@ -25583,6 +25584,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25583
25584
  diffAvailable: boolean;
25584
25585
  binary: boolean;
25585
25586
  }[];
25587
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25586
25588
  repositoryName: string;
25587
25589
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25588
25590
  worktreePath?: string | undefined;
@@ -25593,7 +25595,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25593
25595
  details?: string | undefined;
25594
25596
  parameters?: Record<string, string | number> | undefined;
25595
25597
  } | undefined;
25596
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25597
25598
  current?: boolean | undefined;
25598
25599
  locked?: boolean | undefined;
25599
25600
  prunable?: boolean | undefined;
@@ -25610,6 +25611,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25610
25611
  diffAvailable: boolean;
25611
25612
  binary: boolean;
25612
25613
  }[];
25614
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25613
25615
  repositoryName: string;
25614
25616
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25615
25617
  worktreePath?: string | undefined;
@@ -25620,7 +25622,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25620
25622
  details?: string | undefined;
25621
25623
  parameters?: Record<string, string | number> | undefined;
25622
25624
  } | undefined;
25623
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25624
25625
  current?: boolean | undefined;
25625
25626
  locked?: boolean | undefined;
25626
25627
  prunable?: boolean | undefined;
@@ -25637,6 +25638,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25637
25638
  diffAvailable: boolean;
25638
25639
  binary: boolean;
25639
25640
  }[];
25641
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25640
25642
  repositoryName: string;
25641
25643
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25642
25644
  worktreePath?: string | undefined;
@@ -25647,7 +25649,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25647
25649
  details?: string | undefined;
25648
25650
  parameters?: Record<string, string | number> | undefined;
25649
25651
  } | undefined;
25650
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25651
25652
  current?: boolean | undefined;
25652
25653
  locked?: boolean | undefined;
25653
25654
  prunable?: boolean | undefined;
@@ -25719,6 +25720,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25719
25720
  diffAvailable: boolean;
25720
25721
  binary: boolean;
25721
25722
  }[];
25723
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25722
25724
  repositoryName: string;
25723
25725
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25724
25726
  worktreePath?: string | undefined;
@@ -25729,7 +25731,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25729
25731
  details?: string | undefined;
25730
25732
  parameters?: Record<string, string | number> | undefined;
25731
25733
  } | undefined;
25732
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25733
25734
  current?: boolean | undefined;
25734
25735
  locked?: boolean | undefined;
25735
25736
  prunable?: boolean | undefined;
@@ -25775,6 +25776,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25775
25776
  diffAvailable: boolean;
25776
25777
  binary: boolean;
25777
25778
  }[];
25779
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25778
25780
  repositoryName: string;
25779
25781
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25780
25782
  worktreePath?: string | undefined;
@@ -25785,7 +25787,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25785
25787
  details?: string | undefined;
25786
25788
  parameters?: Record<string, string | number> | undefined;
25787
25789
  } | undefined;
25788
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25789
25790
  current?: boolean | undefined;
25790
25791
  locked?: boolean | undefined;
25791
25792
  prunable?: boolean | undefined;
@@ -25877,7 +25878,7 @@ export type WorkbenchNodeOperation = z.infer<typeof workbenchNodeOperationSchema
25877
25878
  * and makes it safe to reject future message kinds without guessing payloads.
25878
25879
  */
25879
25880
  export declare const nodeEnvelopeSchema: z.ZodObject<{
25880
- version: z.ZodLiteral<2>;
25881
+ version: z.ZodLiteral<3>;
25881
25882
  id: z.ZodString;
25882
25883
  type: z.ZodString;
25883
25884
  replyTo: z.ZodOptional<z.ZodString>;
@@ -25885,13 +25886,13 @@ export declare const nodeEnvelopeSchema: z.ZodObject<{
25885
25886
  }, "strip", z.ZodTypeAny, {
25886
25887
  type: string;
25887
25888
  id: string;
25888
- version: 2;
25889
+ version: 3;
25889
25890
  payload?: unknown;
25890
25891
  replyTo?: string | undefined;
25891
25892
  }, {
25892
25893
  type: string;
25893
25894
  id: string;
25894
- version: 2;
25895
+ version: 3;
25895
25896
  payload?: unknown;
25896
25897
  replyTo?: string | undefined;
25897
25898
  }>;
@@ -25915,17 +25916,17 @@ export declare const publicErrorSchema: z.ZodObject<{
25915
25916
  export type PublicError = z.infer<typeof publicErrorSchema>;
25916
25917
  export declare const nodeResponseErrorPayloadSchema: z.ZodObject<{
25917
25918
  error: z.ZodString;
25918
- message: z.ZodOptional<z.ZodString>;
25919
+ message: z.ZodString;
25919
25920
  details: z.ZodOptional<z.ZodString>;
25920
25921
  parameters: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>, Record<string, string | number>, Record<string, string | number>>>;
25921
25922
  }, "strict", z.ZodTypeAny, {
25923
+ message: string;
25922
25924
  error: string;
25923
- message?: string | undefined;
25924
25925
  details?: string | undefined;
25925
25926
  parameters?: Record<string, string | number> | undefined;
25926
25927
  }, {
25928
+ message: string;
25927
25929
  error: string;
25928
- message?: string | undefined;
25929
25930
  details?: string | undefined;
25930
25931
  parameters?: Record<string, string | number> | undefined;
25931
25932
  }>;
package/dist/index.js CHANGED
@@ -12,7 +12,8 @@ export const healthStatusSchema = z.object({
12
12
  status: z.literal('ok')
13
13
  });
14
14
  /** The only wire protocol version understood by this build. */
15
- export const NODE_PROTOCOL_VERSION = 2;
15
+ /** Breaking required wire fields or semantics requires a new version and coordinated peers. */
16
+ export const NODE_PROTOCOL_VERSION = 3;
16
17
  export const WORKBENCH_PROTOCOL_VERSION = 1;
17
18
  export const nodePlatformSchema = z.enum(['windows', 'linux', 'macos']);
18
19
  export const runnerAvailabilitySchema = z.object({
@@ -2507,7 +2508,7 @@ export const workspaceChangesRepositorySchema = z
2507
2508
  .object({
2508
2509
  repositoryPath: z.string().max(4096),
2509
2510
  repositoryName: z.string().min(1).max(512),
2510
- source: z.enum(['ROOT', 'SUBMODULE', 'WORKTREE']).optional(),
2511
+ source: z.enum(['ROOT', 'SUBMODULE', 'WORKTREE']),
2511
2512
  worktreePath: z.string().min(1).max(4096).optional(),
2512
2513
  physicalPath: z.string().min(1).max(4096).optional(),
2513
2514
  current: z.boolean().optional(),
@@ -2523,8 +2524,6 @@ export const workspaceChangesRepositorySchema = z
2523
2524
  changes: z.array(workspaceChangeSchema)
2524
2525
  })
2525
2526
  .superRefine((repository, context) => {
2526
- if (repository.source === undefined)
2527
- return;
2528
2527
  if (repository.source === 'SUBMODULE') {
2529
2528
  if (repository.repositoryPath.length === 0 || repository.worktreePath !== undefined)
2530
2529
  context.addIssue({ code: 'custom', message: 'Invalid submodule repository target' });
@@ -2719,7 +2718,7 @@ export const publicErrorSchema = z
2719
2718
  export const nodeResponseErrorPayloadSchema = z
2720
2719
  .object({
2721
2720
  error: z.string().regex(PUBLIC_ERROR_CODE),
2722
- message: publicErrorTextSchema.optional(),
2721
+ message: publicErrorTextSchema,
2723
2722
  details: publicErrorTextSchema.optional(),
2724
2723
  parameters: publicErrorParametersSchema.optional()
2725
2724
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/protocol",
3
- "version": "0.9.119",
3
+ "version": "0.9.121",
4
4
  "description": "Shared runtime protocol schemas for MyAgentRoam.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",