@mycadet/cli 0.13.0-dev.202611141833.f5bfff5 → 0.13.0-dev.202611141959.760a53b
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/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/src/rpc.ts +33 -3
- package/node_modules/@mycadet/avatar-manifest/package.json +1 -1
- package/node_modules/@mycadet/ipc-server-utils/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/avatar-manifest/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/ipc-server-utils/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/service-contracts/src/rpc.ts +33 -3
- package/node_modules/@mycadet/local-mode/node_modules/@mycadet/shared/package.json +1 -1
- package/node_modules/@mycadet/local-mode/package.json +1 -1
- package/node_modules/@mycadet/local-mode/src/__tests__/remotes-local-pair.test.ts +3 -1
- package/node_modules/@mycadet/local-mode/src/operations/pair.ts +8 -1
- package/node_modules/@mycadet/local-mode/src/remotes/local/common.ts +0 -4
- package/node_modules/@mycadet/service-contracts/package.json +1 -1
- package/node_modules/@mycadet/service-contracts/src/rpc.ts +33 -3
- package/node_modules/@mycadet/shared/package.json +1 -1
- package/package.json +1 -1
package/node_modules/@mycadet/assistant-api/node_modules/@mycadet/service-contracts/src/rpc.ts
CHANGED
|
@@ -55,6 +55,8 @@ export const CesRpcMethod = {
|
|
|
55
55
|
ListCredentialRecords: "list_credential_records",
|
|
56
56
|
/** Bulk-import credential records. */
|
|
57
57
|
BulkSetCredentialRecords: "bulk_set_credential_records",
|
|
58
|
+
/** Collect CES's own log files for a diagnostic export (tar.gz, base64). */
|
|
59
|
+
ExportLogs: "export_logs",
|
|
58
60
|
} as const;
|
|
59
61
|
|
|
60
62
|
export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
|
|
@@ -72,9 +74,7 @@ export const UpdateCloudCredentialSchema = z.object({
|
|
|
72
74
|
*/
|
|
73
75
|
assistantId: z.string().optional(),
|
|
74
76
|
});
|
|
75
|
-
export type UpdateCloudCredential = z.infer<
|
|
76
|
-
typeof UpdateCloudCredentialSchema
|
|
77
|
-
>;
|
|
77
|
+
export type UpdateCloudCredential = z.infer<typeof UpdateCloudCredentialSchema>;
|
|
78
78
|
|
|
79
79
|
export const UpdateCloudCredentialResponseSchema = z.object({
|
|
80
80
|
/** Whether the cloud credential was successfully updated. */
|
|
@@ -302,6 +302,28 @@ export type BulkSetCredentialRecordsResponse = z.infer<
|
|
|
302
302
|
typeof BulkSetCredentialRecordsResponseSchema
|
|
303
303
|
>;
|
|
304
304
|
|
|
305
|
+
// ---------------------------------------------------------------------------
|
|
306
|
+
// export_logs
|
|
307
|
+
// ---------------------------------------------------------------------------
|
|
308
|
+
|
|
309
|
+
export const ExportLogsSchema = z.object({
|
|
310
|
+
/** Inclusive range start (epoch ms); log files entirely before it are skipped. */
|
|
311
|
+
startTime: z.number().optional(),
|
|
312
|
+
/** Inclusive range end (epoch ms); log files entirely after it are skipped. */
|
|
313
|
+
endTime: z.number().optional(),
|
|
314
|
+
});
|
|
315
|
+
export type ExportLogs = z.infer<typeof ExportLogsSchema>;
|
|
316
|
+
|
|
317
|
+
export const ExportLogsResponseSchema = z.object({
|
|
318
|
+
/** tar.gz of the collected log files plus a manifest, base64-encoded. */
|
|
319
|
+
archiveBase64: z.string(),
|
|
320
|
+
/** Number of log files included in the archive. */
|
|
321
|
+
filesCollected: z.number(),
|
|
322
|
+
/** Cumulative size of the collected log files, before archiving. */
|
|
323
|
+
totalBytes: z.number(),
|
|
324
|
+
});
|
|
325
|
+
export type ExportLogsResponse = z.infer<typeof ExportLogsResponseSchema>;
|
|
326
|
+
|
|
305
327
|
// ---------------------------------------------------------------------------
|
|
306
328
|
// Full RPC contract type map
|
|
307
329
|
// ---------------------------------------------------------------------------
|
|
@@ -355,6 +377,10 @@ export interface CesRpcContract {
|
|
|
355
377
|
request: BulkSetCredentialRecords;
|
|
356
378
|
response: BulkSetCredentialRecordsResponse;
|
|
357
379
|
};
|
|
380
|
+
[CesRpcMethod.ExportLogs]: {
|
|
381
|
+
request: ExportLogs;
|
|
382
|
+
response: ExportLogsResponse;
|
|
383
|
+
};
|
|
358
384
|
}
|
|
359
385
|
|
|
360
386
|
/**
|
|
@@ -405,4 +431,8 @@ export const CesRpcSchemas = {
|
|
|
405
431
|
request: BulkSetCredentialRecordsSchema,
|
|
406
432
|
response: BulkSetCredentialRecordsResponseSchema,
|
|
407
433
|
},
|
|
434
|
+
[CesRpcMethod.ExportLogs]: {
|
|
435
|
+
request: ExportLogsSchema,
|
|
436
|
+
response: ExportLogsResponseSchema,
|
|
437
|
+
},
|
|
408
438
|
} as const;
|
|
@@ -55,6 +55,8 @@ export const CesRpcMethod = {
|
|
|
55
55
|
ListCredentialRecords: "list_credential_records",
|
|
56
56
|
/** Bulk-import credential records. */
|
|
57
57
|
BulkSetCredentialRecords: "bulk_set_credential_records",
|
|
58
|
+
/** Collect CES's own log files for a diagnostic export (tar.gz, base64). */
|
|
59
|
+
ExportLogs: "export_logs",
|
|
58
60
|
} as const;
|
|
59
61
|
|
|
60
62
|
export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
|
|
@@ -72,9 +74,7 @@ export const UpdateCloudCredentialSchema = z.object({
|
|
|
72
74
|
*/
|
|
73
75
|
assistantId: z.string().optional(),
|
|
74
76
|
});
|
|
75
|
-
export type UpdateCloudCredential = z.infer<
|
|
76
|
-
typeof UpdateCloudCredentialSchema
|
|
77
|
-
>;
|
|
77
|
+
export type UpdateCloudCredential = z.infer<typeof UpdateCloudCredentialSchema>;
|
|
78
78
|
|
|
79
79
|
export const UpdateCloudCredentialResponseSchema = z.object({
|
|
80
80
|
/** Whether the cloud credential was successfully updated. */
|
|
@@ -302,6 +302,28 @@ export type BulkSetCredentialRecordsResponse = z.infer<
|
|
|
302
302
|
typeof BulkSetCredentialRecordsResponseSchema
|
|
303
303
|
>;
|
|
304
304
|
|
|
305
|
+
// ---------------------------------------------------------------------------
|
|
306
|
+
// export_logs
|
|
307
|
+
// ---------------------------------------------------------------------------
|
|
308
|
+
|
|
309
|
+
export const ExportLogsSchema = z.object({
|
|
310
|
+
/** Inclusive range start (epoch ms); log files entirely before it are skipped. */
|
|
311
|
+
startTime: z.number().optional(),
|
|
312
|
+
/** Inclusive range end (epoch ms); log files entirely after it are skipped. */
|
|
313
|
+
endTime: z.number().optional(),
|
|
314
|
+
});
|
|
315
|
+
export type ExportLogs = z.infer<typeof ExportLogsSchema>;
|
|
316
|
+
|
|
317
|
+
export const ExportLogsResponseSchema = z.object({
|
|
318
|
+
/** tar.gz of the collected log files plus a manifest, base64-encoded. */
|
|
319
|
+
archiveBase64: z.string(),
|
|
320
|
+
/** Number of log files included in the archive. */
|
|
321
|
+
filesCollected: z.number(),
|
|
322
|
+
/** Cumulative size of the collected log files, before archiving. */
|
|
323
|
+
totalBytes: z.number(),
|
|
324
|
+
});
|
|
325
|
+
export type ExportLogsResponse = z.infer<typeof ExportLogsResponseSchema>;
|
|
326
|
+
|
|
305
327
|
// ---------------------------------------------------------------------------
|
|
306
328
|
// Full RPC contract type map
|
|
307
329
|
// ---------------------------------------------------------------------------
|
|
@@ -355,6 +377,10 @@ export interface CesRpcContract {
|
|
|
355
377
|
request: BulkSetCredentialRecords;
|
|
356
378
|
response: BulkSetCredentialRecordsResponse;
|
|
357
379
|
};
|
|
380
|
+
[CesRpcMethod.ExportLogs]: {
|
|
381
|
+
request: ExportLogs;
|
|
382
|
+
response: ExportLogsResponse;
|
|
383
|
+
};
|
|
358
384
|
}
|
|
359
385
|
|
|
360
386
|
/**
|
|
@@ -405,4 +431,8 @@ export const CesRpcSchemas = {
|
|
|
405
431
|
request: BulkSetCredentialRecordsSchema,
|
|
406
432
|
response: BulkSetCredentialRecordsResponseSchema,
|
|
407
433
|
},
|
|
434
|
+
[CesRpcMethod.ExportLogs]: {
|
|
435
|
+
request: ExportLogsSchema,
|
|
436
|
+
response: ExportLogsResponseSchema,
|
|
437
|
+
},
|
|
408
438
|
} as const;
|
|
@@ -118,7 +118,9 @@ describe("pairLocal — running the gateway's own CLI is the local presence proo
|
|
|
118
118
|
expect(result.ok).toBe(false);
|
|
119
119
|
if (result.ok) throw new Error("expected refusal");
|
|
120
120
|
expect(result.status).toBe(0);
|
|
121
|
-
expect(result.error).toBe(
|
|
121
|
+
expect(result.error).toBe(
|
|
122
|
+
"could not parse the gateway's pair output (stdout tail: not json at all)",
|
|
123
|
+
);
|
|
122
124
|
});
|
|
123
125
|
|
|
124
126
|
test("an exec failure (gateway down) comes back structured", async () => {
|
|
@@ -30,10 +30,17 @@ export function pairCliStdoutToResult(stdout: string): PairOperationResult {
|
|
|
30
30
|
try {
|
|
31
31
|
return { ok: true, response: JSON.parse(lastLine) };
|
|
32
32
|
} catch {
|
|
33
|
+
// The output is the only diagnostic for a failed lease — surface a
|
|
34
|
+
// bounded tail of it (the payload line never parsed, so it is not a
|
|
35
|
+
// live credential; earlier lines may still carry secrets, so keep the
|
|
36
|
+
// tail, not the whole stdout).
|
|
37
|
+
const tail = stdout.trimEnd().slice(-300);
|
|
33
38
|
return {
|
|
34
39
|
ok: false,
|
|
35
40
|
status: 0,
|
|
36
|
-
error:
|
|
41
|
+
error: `could not parse the gateway's pair output${
|
|
42
|
+
tail ? ` (stdout tail: ${tail})` : " (stdout was empty)"
|
|
43
|
+
}`,
|
|
37
44
|
};
|
|
38
45
|
}
|
|
39
46
|
}
|
|
@@ -1150,10 +1150,6 @@ export async function startCes(
|
|
|
1150
1150
|
writeFileSync(cesPidFile, String(ces.pid), "utf-8");
|
|
1151
1151
|
}
|
|
1152
1152
|
|
|
1153
|
-
// No blocking wait for the socket here: the assistant's overall health
|
|
1154
|
-
// check owns CES readiness (it probes live and nudges the single-flight
|
|
1155
|
-
// connect), and the daemon's own discovery retries absorb the bind window.
|
|
1156
|
-
// Hatch proceeds as soon as the sibling is spawned.
|
|
1157
1153
|
startupLog("✅ credential-executor started\n");
|
|
1158
1154
|
}
|
|
1159
1155
|
|
|
@@ -55,6 +55,8 @@ export const CesRpcMethod = {
|
|
|
55
55
|
ListCredentialRecords: "list_credential_records",
|
|
56
56
|
/** Bulk-import credential records. */
|
|
57
57
|
BulkSetCredentialRecords: "bulk_set_credential_records",
|
|
58
|
+
/** Collect CES's own log files for a diagnostic export (tar.gz, base64). */
|
|
59
|
+
ExportLogs: "export_logs",
|
|
58
60
|
} as const;
|
|
59
61
|
|
|
60
62
|
export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
|
|
@@ -72,9 +74,7 @@ export const UpdateCloudCredentialSchema = z.object({
|
|
|
72
74
|
*/
|
|
73
75
|
assistantId: z.string().optional(),
|
|
74
76
|
});
|
|
75
|
-
export type UpdateCloudCredential = z.infer<
|
|
76
|
-
typeof UpdateCloudCredentialSchema
|
|
77
|
-
>;
|
|
77
|
+
export type UpdateCloudCredential = z.infer<typeof UpdateCloudCredentialSchema>;
|
|
78
78
|
|
|
79
79
|
export const UpdateCloudCredentialResponseSchema = z.object({
|
|
80
80
|
/** Whether the cloud credential was successfully updated. */
|
|
@@ -302,6 +302,28 @@ export type BulkSetCredentialRecordsResponse = z.infer<
|
|
|
302
302
|
typeof BulkSetCredentialRecordsResponseSchema
|
|
303
303
|
>;
|
|
304
304
|
|
|
305
|
+
// ---------------------------------------------------------------------------
|
|
306
|
+
// export_logs
|
|
307
|
+
// ---------------------------------------------------------------------------
|
|
308
|
+
|
|
309
|
+
export const ExportLogsSchema = z.object({
|
|
310
|
+
/** Inclusive range start (epoch ms); log files entirely before it are skipped. */
|
|
311
|
+
startTime: z.number().optional(),
|
|
312
|
+
/** Inclusive range end (epoch ms); log files entirely after it are skipped. */
|
|
313
|
+
endTime: z.number().optional(),
|
|
314
|
+
});
|
|
315
|
+
export type ExportLogs = z.infer<typeof ExportLogsSchema>;
|
|
316
|
+
|
|
317
|
+
export const ExportLogsResponseSchema = z.object({
|
|
318
|
+
/** tar.gz of the collected log files plus a manifest, base64-encoded. */
|
|
319
|
+
archiveBase64: z.string(),
|
|
320
|
+
/** Number of log files included in the archive. */
|
|
321
|
+
filesCollected: z.number(),
|
|
322
|
+
/** Cumulative size of the collected log files, before archiving. */
|
|
323
|
+
totalBytes: z.number(),
|
|
324
|
+
});
|
|
325
|
+
export type ExportLogsResponse = z.infer<typeof ExportLogsResponseSchema>;
|
|
326
|
+
|
|
305
327
|
// ---------------------------------------------------------------------------
|
|
306
328
|
// Full RPC contract type map
|
|
307
329
|
// ---------------------------------------------------------------------------
|
|
@@ -355,6 +377,10 @@ export interface CesRpcContract {
|
|
|
355
377
|
request: BulkSetCredentialRecords;
|
|
356
378
|
response: BulkSetCredentialRecordsResponse;
|
|
357
379
|
};
|
|
380
|
+
[CesRpcMethod.ExportLogs]: {
|
|
381
|
+
request: ExportLogs;
|
|
382
|
+
response: ExportLogsResponse;
|
|
383
|
+
};
|
|
358
384
|
}
|
|
359
385
|
|
|
360
386
|
/**
|
|
@@ -405,4 +431,8 @@ export const CesRpcSchemas = {
|
|
|
405
431
|
request: BulkSetCredentialRecordsSchema,
|
|
406
432
|
response: BulkSetCredentialRecordsResponseSchema,
|
|
407
433
|
},
|
|
434
|
+
[CesRpcMethod.ExportLogs]: {
|
|
435
|
+
request: ExportLogsSchema,
|
|
436
|
+
response: ExportLogsResponseSchema,
|
|
437
|
+
},
|
|
408
438
|
} as const;
|