@myagentroam/protocol 0.9.120 → 0.9.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.
@@ -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
@@ -25304,7 +25304,7 @@ export type WorkspaceGitWorktreeSummary = z.infer<typeof workspaceGitWorktreeSum
25304
25304
  export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<{
25305
25305
  repositoryPath: z.ZodString;
25306
25306
  repositoryName: z.ZodString;
25307
- source: z.ZodOptional<z.ZodEnum<["ROOT", "SUBMODULE", "WORKTREE"]>>;
25307
+ source: z.ZodEnum<["ROOT", "SUBMODULE", "WORKTREE"]>;
25308
25308
  worktreePath: z.ZodOptional<z.ZodString>;
25309
25309
  physicalPath: z.ZodOptional<z.ZodString>;
25310
25310
  current: z.ZodOptional<z.ZodBoolean>;
@@ -25366,6 +25366,7 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25366
25366
  diffAvailable: boolean;
25367
25367
  binary: boolean;
25368
25368
  }[];
25369
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25369
25370
  repositoryName: string;
25370
25371
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25371
25372
  worktreePath?: string | undefined;
@@ -25376,7 +25377,6 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25376
25377
  details?: string | undefined;
25377
25378
  parameters?: Record<string, string | number> | undefined;
25378
25379
  } | undefined;
25379
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25380
25380
  current?: boolean | undefined;
25381
25381
  locked?: boolean | undefined;
25382
25382
  prunable?: boolean | undefined;
@@ -25393,6 +25393,7 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25393
25393
  diffAvailable: boolean;
25394
25394
  binary: boolean;
25395
25395
  }[];
25396
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25396
25397
  repositoryName: string;
25397
25398
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25398
25399
  worktreePath?: string | undefined;
@@ -25403,7 +25404,6 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25403
25404
  details?: string | undefined;
25404
25405
  parameters?: Record<string, string | number> | undefined;
25405
25406
  } | undefined;
25406
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25407
25407
  current?: boolean | undefined;
25408
25408
  locked?: boolean | undefined;
25409
25409
  prunable?: boolean | undefined;
@@ -25420,6 +25420,7 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25420
25420
  diffAvailable: boolean;
25421
25421
  binary: boolean;
25422
25422
  }[];
25423
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25423
25424
  repositoryName: string;
25424
25425
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25425
25426
  worktreePath?: string | undefined;
@@ -25430,7 +25431,6 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25430
25431
  details?: string | undefined;
25431
25432
  parameters?: Record<string, string | number> | undefined;
25432
25433
  } | undefined;
25433
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25434
25434
  current?: boolean | undefined;
25435
25435
  locked?: boolean | undefined;
25436
25436
  prunable?: boolean | undefined;
@@ -25447,6 +25447,7 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25447
25447
  diffAvailable: boolean;
25448
25448
  binary: boolean;
25449
25449
  }[];
25450
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25450
25451
  repositoryName: string;
25451
25452
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25452
25453
  worktreePath?: string | undefined;
@@ -25457,7 +25458,6 @@ export declare const workspaceChangesRepositorySchema: z.ZodEffects<z.ZodObject<
25457
25458
  details?: string | undefined;
25458
25459
  parameters?: Record<string, string | number> | undefined;
25459
25460
  } | undefined;
25460
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25461
25461
  current?: boolean | undefined;
25462
25462
  locked?: boolean | undefined;
25463
25463
  prunable?: boolean | undefined;
@@ -25494,7 +25494,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25494
25494
  repositories: z.ZodArray<z.ZodEffects<z.ZodObject<{
25495
25495
  repositoryPath: z.ZodString;
25496
25496
  repositoryName: z.ZodString;
25497
- source: z.ZodOptional<z.ZodEnum<["ROOT", "SUBMODULE", "WORKTREE"]>>;
25497
+ source: z.ZodEnum<["ROOT", "SUBMODULE", "WORKTREE"]>;
25498
25498
  worktreePath: z.ZodOptional<z.ZodString>;
25499
25499
  physicalPath: z.ZodOptional<z.ZodString>;
25500
25500
  current: z.ZodOptional<z.ZodBoolean>;
@@ -25556,6 +25556,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25556
25556
  diffAvailable: boolean;
25557
25557
  binary: boolean;
25558
25558
  }[];
25559
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25559
25560
  repositoryName: string;
25560
25561
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25561
25562
  worktreePath?: string | undefined;
@@ -25566,7 +25567,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25566
25567
  details?: string | undefined;
25567
25568
  parameters?: Record<string, string | number> | undefined;
25568
25569
  } | undefined;
25569
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25570
25570
  current?: boolean | undefined;
25571
25571
  locked?: boolean | undefined;
25572
25572
  prunable?: boolean | undefined;
@@ -25583,6 +25583,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25583
25583
  diffAvailable: boolean;
25584
25584
  binary: boolean;
25585
25585
  }[];
25586
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25586
25587
  repositoryName: string;
25587
25588
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25588
25589
  worktreePath?: string | undefined;
@@ -25593,7 +25594,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25593
25594
  details?: string | undefined;
25594
25595
  parameters?: Record<string, string | number> | undefined;
25595
25596
  } | undefined;
25596
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25597
25597
  current?: boolean | undefined;
25598
25598
  locked?: boolean | undefined;
25599
25599
  prunable?: boolean | undefined;
@@ -25610,6 +25610,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25610
25610
  diffAvailable: boolean;
25611
25611
  binary: boolean;
25612
25612
  }[];
25613
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25613
25614
  repositoryName: string;
25614
25615
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25615
25616
  worktreePath?: string | undefined;
@@ -25620,7 +25621,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25620
25621
  details?: string | undefined;
25621
25622
  parameters?: Record<string, string | number> | undefined;
25622
25623
  } | undefined;
25623
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25624
25624
  current?: boolean | undefined;
25625
25625
  locked?: boolean | undefined;
25626
25626
  prunable?: boolean | undefined;
@@ -25637,6 +25637,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25637
25637
  diffAvailable: boolean;
25638
25638
  binary: boolean;
25639
25639
  }[];
25640
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25640
25641
  repositoryName: string;
25641
25642
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25642
25643
  worktreePath?: string | undefined;
@@ -25647,7 +25648,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25647
25648
  details?: string | undefined;
25648
25649
  parameters?: Record<string, string | number> | undefined;
25649
25650
  } | undefined;
25650
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25651
25651
  current?: boolean | undefined;
25652
25652
  locked?: boolean | undefined;
25653
25653
  prunable?: boolean | undefined;
@@ -25719,6 +25719,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25719
25719
  diffAvailable: boolean;
25720
25720
  binary: boolean;
25721
25721
  }[];
25722
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25722
25723
  repositoryName: string;
25723
25724
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25724
25725
  worktreePath?: string | undefined;
@@ -25729,7 +25730,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25729
25730
  details?: string | undefined;
25730
25731
  parameters?: Record<string, string | number> | undefined;
25731
25732
  } | undefined;
25732
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25733
25733
  current?: boolean | undefined;
25734
25734
  locked?: boolean | undefined;
25735
25735
  prunable?: boolean | undefined;
@@ -25775,6 +25775,7 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25775
25775
  diffAvailable: boolean;
25776
25776
  binary: boolean;
25777
25777
  }[];
25778
+ source: "ROOT" | "SUBMODULE" | "WORKTREE";
25778
25779
  repositoryName: string;
25779
25780
  status?: "UNAVAILABLE" | "CLEAN" | "DIRTY" | undefined;
25780
25781
  worktreePath?: string | undefined;
@@ -25785,7 +25786,6 @@ export declare const workspaceChangesSummarySchema: z.ZodObject<{
25785
25786
  details?: string | undefined;
25786
25787
  parameters?: Record<string, string | number> | undefined;
25787
25788
  } | undefined;
25788
- source?: "ROOT" | "SUBMODULE" | "WORKTREE" | undefined;
25789
25789
  current?: boolean | undefined;
25790
25790
  locked?: boolean | undefined;
25791
25791
  prunable?: boolean | undefined;
@@ -25915,17 +25915,17 @@ export declare const publicErrorSchema: z.ZodObject<{
25915
25915
  export type PublicError = z.infer<typeof publicErrorSchema>;
25916
25916
  export declare const nodeResponseErrorPayloadSchema: z.ZodObject<{
25917
25917
  error: z.ZodString;
25918
- message: z.ZodOptional<z.ZodString>;
25918
+ message: z.ZodString;
25919
25919
  details: z.ZodOptional<z.ZodString>;
25920
25920
  parameters: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>, Record<string, string | number>, Record<string, string | number>>>;
25921
25921
  }, "strict", z.ZodTypeAny, {
25922
+ message: string;
25922
25923
  error: string;
25923
- message?: string | undefined;
25924
25924
  details?: string | undefined;
25925
25925
  parameters?: Record<string, string | number> | undefined;
25926
25926
  }, {
25927
+ message: string;
25927
25928
  error: string;
25928
- message?: string | undefined;
25929
25929
  details?: string | undefined;
25930
25930
  parameters?: Record<string, string | number> | undefined;
25931
25931
  }>;
package/dist/index.js CHANGED
@@ -2507,7 +2507,7 @@ export const workspaceChangesRepositorySchema = z
2507
2507
  .object({
2508
2508
  repositoryPath: z.string().max(4096),
2509
2509
  repositoryName: z.string().min(1).max(512),
2510
- source: z.enum(['ROOT', 'SUBMODULE', 'WORKTREE']).optional(),
2510
+ source: z.enum(['ROOT', 'SUBMODULE', 'WORKTREE']),
2511
2511
  worktreePath: z.string().min(1).max(4096).optional(),
2512
2512
  physicalPath: z.string().min(1).max(4096).optional(),
2513
2513
  current: z.boolean().optional(),
@@ -2523,8 +2523,6 @@ export const workspaceChangesRepositorySchema = z
2523
2523
  changes: z.array(workspaceChangeSchema)
2524
2524
  })
2525
2525
  .superRefine((repository, context) => {
2526
- if (repository.source === undefined)
2527
- return;
2528
2526
  if (repository.source === 'SUBMODULE') {
2529
2527
  if (repository.repositoryPath.length === 0 || repository.worktreePath !== undefined)
2530
2528
  context.addIssue({ code: 'custom', message: 'Invalid submodule repository target' });
@@ -2719,7 +2717,7 @@ export const publicErrorSchema = z
2719
2717
  export const nodeResponseErrorPayloadSchema = z
2720
2718
  .object({
2721
2719
  error: z.string().regex(PUBLIC_ERROR_CODE),
2722
- message: publicErrorTextSchema.optional(),
2720
+ message: publicErrorTextSchema,
2723
2721
  details: publicErrorTextSchema.optional(),
2724
2722
  parameters: publicErrorParametersSchema.optional()
2725
2723
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/protocol",
3
- "version": "0.9.120",
3
+ "version": "0.9.122",
4
4
  "description": "Shared runtime protocol schemas for MyAgentRoam.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",