@genspark/cli 1.14.0 → 1.14.2
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/README.md +1 -0
- package/dist/commands/aidrive-contract.generated.d.ts +3 -0
- package/dist/commands/aidrive-contract.generated.d.ts.map +1 -0
- package/dist/commands/aidrive-contract.generated.js +536 -0
- package/dist/commands/aidrive-contract.generated.js.map +1 -0
- package/dist/commands/aidrive-operands.d.ts +2 -0
- package/dist/commands/aidrive-operands.d.ts.map +1 -1
- package/dist/commands/aidrive-operands.js +22 -26
- package/dist/commands/aidrive-operands.js.map +1 -1
- package/dist/commands/genteam-download.d.ts +3 -1
- package/dist/commands/genteam-download.d.ts.map +1 -1
- package/dist/commands/genteam-download.js +4 -1
- package/dist/commands/genteam-download.js.map +1 -1
- package/dist/commands/telephony-recording.d.ts +34 -0
- package/dist/commands/telephony-recording.d.ts.map +1 -0
- package/dist/commands/telephony-recording.js +75 -0
- package/dist/commands/telephony-recording.js.map +1 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/file-path-uploads.d.ts +4 -0
- package/dist/file-path-uploads.d.ts.map +1 -0
- package/dist/file-path-uploads.js +34 -0
- package/dist/file-path-uploads.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +139 -39
- package/dist/index.js.map +1 -1
- package/dist/serviceActions.d.ts +2 -0
- package/dist/serviceActions.d.ts.map +1 -1
- package/dist/serviceActions.js +13 -1
- package/dist/serviceActions.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/skills.md +3 -3
- package/package.json +1 -1
- package/skills/gsk-aidrive/SKILL.md +77 -121
- package/skills/gsk-analyze-media/SKILL.md +1 -0
- package/skills/gsk-audio-generation/SKILL.md +1 -0
- package/skills/gsk-audio-processing/SKILL.md +1 -0
- package/skills/gsk-audio-transcribe/SKILL.md +1 -0
- package/skills/gsk-batch-crawl-url-and-answer/SKILL.md +1 -0
- package/skills/gsk-batch-understand-videos/SKILL.md +1 -0
- package/skills/gsk-claw-share-link/SKILL.md +1 -0
- package/skills/gsk-connector/SKILL.md +23 -9
- package/skills/gsk-crawler/SKILL.md +1 -0
- package/skills/gsk-create-task/SKILL.md +6 -1
- package/skills/gsk-genteam/SKILL.md +2 -1
- package/skills/gsk-get-model-info/SKILL.md +1 -0
- package/skills/gsk-get-service-url/SKILL.md +1 -0
- package/skills/gsk-github/SKILL.md +1 -0
- package/skills/gsk-gmail/SKILL.md +5 -3
- package/skills/gsk-google-calendar/SKILL.md +1 -0
- package/skills/gsk-google-chat/SKILL.md +2 -1
- package/skills/gsk-google-contacts/SKILL.md +1 -0
- package/skills/gsk-google-docs/SKILL.md +1 -0
- package/skills/gsk-google-drive/SKILL.md +2 -1
- package/skills/gsk-google-sheets/SKILL.md +1 -0
- package/skills/gsk-google-slides/SKILL.md +1 -0
- package/skills/gsk-hub/SKILL.md +1 -0
- package/skills/gsk-image-generation/SKILL.md +1 -0
- package/skills/gsk-image-search/SKILL.md +1 -0
- package/skills/gsk-inbox-contacts/SKILL.md +1 -0
- package/skills/gsk-maps-search/SKILL.md +1 -0
- package/skills/gsk-meeting/SKILL.md +1 -0
- package/skills/gsk-microsoft-teams/SKILL.md +2 -1
- package/skills/gsk-notion/SKILL.md +1 -0
- package/skills/gsk-onedrive/SKILL.md +2 -1
- package/skills/gsk-outlook-calendar/SKILL.md +2 -1
- package/skills/gsk-outlook-contacts/SKILL.md +1 -0
- package/skills/gsk-outlook-email/SKILL.md +5 -3
- package/skills/gsk-phone-call/SKILL.md +138 -0
- package/skills/gsk-salesforce/SKILL.md +1 -0
- package/skills/gsk-sb-brain/SKILL.md +33 -21
- package/skills/gsk-scholar-search/SKILL.md +1 -0
- package/skills/gsk-second-brain/SKILL.md +43 -15
- package/skills/gsk-shared/SKILL.md +7 -1
- package/skills/gsk-sharepoint/SKILL.md +2 -1
- package/skills/gsk-sharepoint-upload/SKILL.md +2 -1
- package/skills/gsk-slack/SKILL.md +2 -1
- package/skills/gsk-social-instagram/SKILL.md +1 -0
- package/skills/gsk-social-reddit/SKILL.md +1 -0
- package/skills/gsk-social-twitter/SKILL.md +1 -0
- package/skills/gsk-stock-price/SKILL.md +1 -0
- package/skills/gsk-summarize-large-document/SKILL.md +1 -0
- package/skills/gsk-task-artifacts/SKILL.md +1 -0
- package/skills/gsk-task-continue/SKILL.md +1 -0
- package/skills/gsk-task-info/SKILL.md +1 -0
- package/skills/gsk-task-status/SKILL.md +1 -0
- package/skills/gsk-task-stop/SKILL.md +1 -0
- package/skills/gsk-understand-images/SKILL.md +1 -0
- package/skills/gsk-video-generation/SKILL.md +10 -3
- package/skills/gsk-vm-email-send/SKILL.md +1 -0
- package/skills/gsk-voice-cloning/SKILL.md +5 -4
- package/skills/gsk-web-search/SKILL.md +1 -0
- package/skills/gsk-youtube/SKILL.md +1 -0
|
@@ -29,6 +29,8 @@ export interface SavedAttachment {
|
|
|
29
29
|
* Stream a response body to `destPath`, hashing it on the way. Nothing is
|
|
30
30
|
* buffered: GenTeam attachments reach GiB scale, and the sha256 lets the
|
|
31
31
|
* caller compare against the value `gsk genteam read` already reports.
|
|
32
|
+
* `onProgress` sees the running byte count after each chunk (the recording
|
|
33
|
+
* download's progress line, #66245).
|
|
32
34
|
*/
|
|
33
|
-
export declare function saveBodyToFile(body: NonNullable<Response['body']>, destPath: string): Promise<SavedAttachment>;
|
|
35
|
+
export declare function saveBodyToFile(body: NonNullable<Response['body']>, destPath: string, onProgress?: (receivedBytes: number) => void): Promise<SavedAttachment>;
|
|
34
36
|
//# sourceMappingURL=genteam-download.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genteam-download.d.ts","sourceRoot":"","sources":["../../src/commands/genteam-download.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,wBAAwB,CAAA;AAEh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C,EACnC,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,GAC3C,OAAO,CAAC,eAAe,CAAC,CAiB1B"}
|
|
@@ -74,14 +74,17 @@ function isExistingDirectory(candidate) {
|
|
|
74
74
|
* Stream a response body to `destPath`, hashing it on the way. Nothing is
|
|
75
75
|
* buffered: GenTeam attachments reach GiB scale, and the sha256 lets the
|
|
76
76
|
* caller compare against the value `gsk genteam read` already reports.
|
|
77
|
+
* `onProgress` sees the running byte count after each chunk (the recording
|
|
78
|
+
* download's progress line, #66245).
|
|
77
79
|
*/
|
|
78
|
-
export async function saveBodyToFile(body, destPath) {
|
|
80
|
+
export async function saveBodyToFile(body, destPath, onProgress) {
|
|
79
81
|
const hash = createHash('sha256');
|
|
80
82
|
let sizeBytes = 0;
|
|
81
83
|
const tap = new Transform({
|
|
82
84
|
transform(chunk, _encoding, callback) {
|
|
83
85
|
hash.update(chunk);
|
|
84
86
|
sizeBytes += chunk.length;
|
|
87
|
+
onProgress?.(sizeBytes);
|
|
85
88
|
callback(null, chunk);
|
|
86
89
|
},
|
|
87
90
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genteam-download.js","sourceRoot":"","sources":["../../src/commands/genteam-download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,UAAU,MAAM,MAAM,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAA;AAEhE,MAAM,UAAU,yBAAyB,CACvC,SAAiB,EACjB,aAAqB;IAErB,MAAM,KAAK,GAAG,IAAI,eAAe,C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AAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC3E,OAAO;QACL,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC;QACxC,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;KAC3B,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `gsk telephony call recording <project_id> [local-path]` (#66245): the CLI
|
|
3
|
+
* streams the gsk-token recording route straight into a local file. The
|
|
4
|
+
* server-side `call_recording` tool answers metadata + download_url only and
|
|
5
|
+
* is what `--info` calls; the bytes never travel through a tool result.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CALL_RECORDING_ENDPOINT = "/telephony/call/recording";
|
|
8
|
+
export declare const RECORDING_CHANNEL_MODES: readonly ["stereo", "mono"];
|
|
9
|
+
export type RecordingChannels = (typeof RECORDING_CHANNEL_MODES)[number];
|
|
10
|
+
export declare const CALL_RECORDING_LOCAL_FILE_HELP: string;
|
|
11
|
+
export declare const CALL_RECORDING_INFO_HELP: string;
|
|
12
|
+
/**
|
|
13
|
+
* `--channels` as the route expects it: absent means the server default
|
|
14
|
+
* (stereo); anything but the two modes is refused before a request is made.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeRecordingChannels(value: unknown): RecordingChannels | undefined;
|
|
17
|
+
export declare function callRecordingEndpoint(projectId: string, channels: RecordingChannels | undefined): string;
|
|
18
|
+
/** Fallback file name when the server sends no Content-Disposition. */
|
|
19
|
+
export declare function defaultRecordingFileName(projectId: string, channels: RecordingChannels | undefined): string;
|
|
20
|
+
/**
|
|
21
|
+
* The bare operands after `<project_id>`: Commander hands the positional
|
|
22
|
+
* back as `primaryArgValue`, and everything else the user typed stays in
|
|
23
|
+
* `invokedCmd.args` — `[local-path]` is the first of those.
|
|
24
|
+
*/
|
|
25
|
+
export declare function recordingDestinationOperands(invokedArgs: readonly string[], primaryArgValue: unknown): string[];
|
|
26
|
+
export declare function formatBytes(bytes: number): string;
|
|
27
|
+
/** One stderr progress line; the percentage needs a known total. */
|
|
28
|
+
export declare function recordingProgressLine(fileName: string, receivedBytes: number, totalBytes: number | undefined): string;
|
|
29
|
+
/**
|
|
30
|
+
* Throttle for the progress callback: at most one line per `intervalMs`,
|
|
31
|
+
* so a fast download does not flood the terminal.
|
|
32
|
+
*/
|
|
33
|
+
export declare function progressThrottle(intervalMs: number, emit: (receivedBytes: number) => void, now?: () => number): (receivedBytes: number) => void;
|
|
34
|
+
//# sourceMappingURL=telephony-recording.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telephony-recording.d.ts","sourceRoot":"","sources":["../../src/commands/telephony-recording.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,8BAA8B,CAAA;AAElE,eAAO,MAAM,uBAAuB,6BAA8B,CAAA;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAA;AAExE,eAAO,MAAM,8BAA8B,QAEuB,CAAA;AAElE,eAAO,MAAM,wBAAwB,QAEJ,CAAA;AAEjC;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,GACb,iBAAiB,GAAG,SAAS,CAM/B;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,iBAAiB,GAAG,SAAS,GACtC,MAAM,CAIR;AAED,uEAAuE;AACvE,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,iBAAiB,GAAG,SAAS,GACtC,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,eAAe,EAAE,OAAO,GACvB,MAAM,EAAE,CAMV;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,oEAAoE;AACpE,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,MAAM,CAMR;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,EACrC,GAAG,GAAE,MAAM,MAAiB,GAC3B,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAQjC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `gsk telephony call recording <project_id> [local-path]` (#66245): the CLI
|
|
3
|
+
* streams the gsk-token recording route straight into a local file. The
|
|
4
|
+
* server-side `call_recording` tool answers metadata + download_url only and
|
|
5
|
+
* is what `--info` calls; the bytes never travel through a tool result.
|
|
6
|
+
*/
|
|
7
|
+
export const CALL_RECORDING_ENDPOINT = '/telephony/call/recording';
|
|
8
|
+
export const RECORDING_CHANNEL_MODES = ['stereo', 'mono'];
|
|
9
|
+
export const CALL_RECORDING_LOCAL_FILE_HELP = 'local destination path (same as the [local-path] operand; a directory ' +
|
|
10
|
+
'receives the server-reported file name; default ./<file_name>)';
|
|
11
|
+
export const CALL_RECORDING_INFO_HELP = 'Print metadata only (duration, channels, sample rate, estimated size, ' +
|
|
12
|
+
'ready flag); download nothing';
|
|
13
|
+
/**
|
|
14
|
+
* `--channels` as the route expects it: absent means the server default
|
|
15
|
+
* (stereo); anything but the two modes is refused before a request is made.
|
|
16
|
+
*/
|
|
17
|
+
export function normalizeRecordingChannels(value) {
|
|
18
|
+
if (value === undefined || value === null || value === '')
|
|
19
|
+
return undefined;
|
|
20
|
+
const mode = String(value).trim().toLowerCase();
|
|
21
|
+
return RECORDING_CHANNEL_MODES.includes(mode)
|
|
22
|
+
? mode
|
|
23
|
+
: undefined;
|
|
24
|
+
}
|
|
25
|
+
export function callRecordingEndpoint(projectId, channels) {
|
|
26
|
+
const query = new URLSearchParams({ project_id: projectId });
|
|
27
|
+
if (channels)
|
|
28
|
+
query.set('channels', channels);
|
|
29
|
+
return `${CALL_RECORDING_ENDPOINT}?${query.toString()}`;
|
|
30
|
+
}
|
|
31
|
+
/** Fallback file name when the server sends no Content-Disposition. */
|
|
32
|
+
export function defaultRecordingFileName(projectId, channels) {
|
|
33
|
+
return `call-${projectId.slice(0, 8)}-${channels ?? 'stereo'}.wav`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The bare operands after `<project_id>`: Commander hands the positional
|
|
37
|
+
* back as `primaryArgValue`, and everything else the user typed stays in
|
|
38
|
+
* `invokedCmd.args` — `[local-path]` is the first of those.
|
|
39
|
+
*/
|
|
40
|
+
export function recordingDestinationOperands(invokedArgs, primaryArgValue) {
|
|
41
|
+
const rest = primaryArgValue !== undefined && invokedArgs[0] === primaryArgValue
|
|
42
|
+
? invokedArgs.slice(1)
|
|
43
|
+
: [...invokedArgs];
|
|
44
|
+
return rest.filter(operand => operand.length > 0 && !operand.startsWith('-'));
|
|
45
|
+
}
|
|
46
|
+
export function formatBytes(bytes) {
|
|
47
|
+
if (bytes < 1024)
|
|
48
|
+
return `${bytes} B`;
|
|
49
|
+
if (bytes < 1024 * 1024)
|
|
50
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
51
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
52
|
+
}
|
|
53
|
+
/** One stderr progress line; the percentage needs a known total. */
|
|
54
|
+
export function recordingProgressLine(fileName, receivedBytes, totalBytes) {
|
|
55
|
+
if (totalBytes && totalBytes > 0) {
|
|
56
|
+
const pct = Math.min(100, Math.floor((receivedBytes / totalBytes) * 100));
|
|
57
|
+
return `Downloading ${fileName} ${formatBytes(receivedBytes)} / ${formatBytes(totalBytes)} (${pct}%)`;
|
|
58
|
+
}
|
|
59
|
+
return `Downloading ${fileName} ${formatBytes(receivedBytes)}`;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Throttle for the progress callback: at most one line per `intervalMs`,
|
|
63
|
+
* so a fast download does not flood the terminal.
|
|
64
|
+
*/
|
|
65
|
+
export function progressThrottle(intervalMs, emit, now = Date.now) {
|
|
66
|
+
let last = 0;
|
|
67
|
+
return receivedBytes => {
|
|
68
|
+
const tick = now();
|
|
69
|
+
if (tick - last < intervalMs)
|
|
70
|
+
return;
|
|
71
|
+
last = tick;
|
|
72
|
+
emit(receivedBytes);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=telephony-recording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telephony-recording.js","sourceRoot":"","sources":["../../src/commands/telephony-recording.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,2BAA2B,CAAA;AAElE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAU,CAAA;AAGlE,MAAM,CAAC,MAAM,8BAA8B,GACzC,wEAAwE;IACxE,gEAAgE,CAAA;AAElE,MAAM,CAAC,MAAM,wBAAwB,GACnC,wEAAwE;IACxE,+BAA+B,CAAA;AAEjC;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAc;IAEd,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,SAAS,CAAA;IAC3E,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAC/C,OAAQ,uBAA6C,CAAC,QAAQ,CAAC,IAAI,CAAC;QAClE,CAAC,CAAE,IAA0B;QAC7B,CAAC,CAAC,SAAS,CAAA;AACf,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,SAAiB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oEAAoE;AACpE,MAAM,UAAU,qBAAqB,CACnC,QAAgB,EAChB,aAAqB,EACrB,UAA8B;IAE9B,IAAI,UAAU,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACjC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;QACzE,OAAO,eAAe,QAAQ,KAAK,WAAW,CAAC,aAAa,CAAC,MAAM,WAAW,CAAC,UAAU,CAAC,KAAK,GAAG,IAAI,CAAA;IACxG,CAAC;IACD,OAAO,eAAe,QAAQ,KAAK,WAAW,CAAC,aAAa,CAAC,EAAE,CAAA;AACjE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAAkB,EAClB,IAAqC,EACrC,MAAoB,IAAI,CAAC,GAAG;IAE5B,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,OAAO,aAAa,CAAC,EAAE;QACrB,MAAM,IAAI,GAAG,GAAG,EAAE,CAAA;QAClB,IAAI,IAAI,GAAG,IAAI,GAAG,UAAU;YAAE,OAAM;QACpC,IAAI,GAAG,IAAI,CAAA;QACX,IAAI,CAAC,aAAa,CAAC,CAAA;IACrB,CAAC,CAAA;AACH,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface ConfigFile {
|
|
|
23
23
|
*/
|
|
24
24
|
vd_project_id?: string;
|
|
25
25
|
}
|
|
26
|
-
export declare const GSK_CLI_CAPS = "cli-groups-v2,cli-paths-v3,cli-actions-v4,cli-confirm-v1,cli-yes-only-v1,cli-local-source-v1";
|
|
26
|
+
export declare const GSK_CLI_CAPS = "cli-groups-v2,cli-paths-v3,cli-actions-v4,cli-confirm-v1,cli-yes-only-v1,cli-local-source-v1,cli-drive-actions-v1";
|
|
27
27
|
/**
|
|
28
28
|
* Set (or clear) the custom config path. Call this before any other
|
|
29
29
|
* function in this module so that subsequent reads/writes target the
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAuBD,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAuBD,eAAO,MAAM,YAAY,sHAC4F,CAAA;AAmCrH;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAEvE;AAYD;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAKtC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,UAAU,CAiC3C;AAmFD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAEvD;AAuBD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,EAC5B,UAAU,GAAE,CAAC,MAAM,UAAU,CAAC,EAAO,GACpC,IAAI,CASN;AAsCD,wBAAgB,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAEvE;AAaD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,GAAG,IAAI,CA0CnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAOtC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,UAAU,EAAE,EACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,IAAI,CAsBN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAIR"}
|
package/dist/config.js
CHANGED
|
@@ -31,7 +31,7 @@ import { randomUUID } from 'crypto';
|
|
|
31
31
|
// so their --skip_confirmation flags and args-file payloads keep parsing.
|
|
32
32
|
// Because the caps string is part of the cache filename, their cache and
|
|
33
33
|
// this binary's cache never mix.
|
|
34
|
-
export const GSK_CLI_CAPS = 'cli-groups-v2,cli-paths-v3,cli-actions-v4,cli-confirm-v1,cli-yes-only-v1,cli-local-source-v1';
|
|
34
|
+
export const GSK_CLI_CAPS = 'cli-groups-v2,cli-paths-v3,cli-actions-v4,cli-confirm-v1,cli-yes-only-v1,cli-local-source-v1,cli-drive-actions-v1';
|
|
35
35
|
const CONFIG_DIR = '.genspark-tool-cli';
|
|
36
36
|
const CONFIG_FILE = 'config.json';
|
|
37
37
|
// Pre-caps CLIs (e.g. the Genspark Desktop bundled binary) read this file
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAoBnC,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,0EAA0E;AAC1E,6EAA6E;AAC7E,6EAA6E;AAC7E,mEAAmE;AACnE,6EAA6E;AAC7E,4EAA4E;AAC5E,0BAA0B;AAC1B,EAAE;AACF,+DAA+D;AAC/D,0EAA0E;AAC1E,6DAA6D;AAC7D,2EAA2E;AAC3E,uDAAuD;AACvD,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,iCAAiC;AACjC,MAAM,CAAC,MAAM,YAAY,GACvB,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAoBnC,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,0EAA0E;AAC1E,6EAA6E;AAC7E,6EAA6E;AAC7E,mEAAmE;AACnE,6EAA6E;AAC7E,4EAA4E;AAC5E,0BAA0B;AAC1B,EAA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AI,CAAA;IACpE,OAAO,MAAM,IAAI,EAAE,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolParameter } from './types.js';
|
|
2
|
+
/** Upload schema-declared file sources before sending paths to the backend. */
|
|
3
|
+
export declare function resolveUploadFilePaths(args: Record<string, unknown>, parameters: Record<string, ToolParameter>, resolveFile: (source: string) => Promise<string>): Promise<Record<string, unknown>>;
|
|
4
|
+
//# sourceMappingURL=file-path-uploads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-path-uploads.d.ts","sourceRoot":"","sources":["../src/file-path-uploads.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,+EAA+E;AAC/E,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACzC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAC/C,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA6BlC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
/** Upload schema-declared file sources before sending paths to the backend. */
|
|
3
|
+
export async function resolveUploadFilePaths(args, parameters, resolveFile) {
|
|
4
|
+
const resolved = { ...args };
|
|
5
|
+
for (const [name, parameter] of Object.entries(parameters)) {
|
|
6
|
+
const uploadTargets = parameter['x-cli-upload'];
|
|
7
|
+
let target;
|
|
8
|
+
if (typeof uploadTargets === 'string') {
|
|
9
|
+
target = uploadTargets;
|
|
10
|
+
}
|
|
11
|
+
else if (typeof args.action === 'string') {
|
|
12
|
+
target = uploadTargets?.[args.action];
|
|
13
|
+
}
|
|
14
|
+
const source = resolved[name];
|
|
15
|
+
if (typeof target !== 'string' || !target || typeof source !== 'string' || !source)
|
|
16
|
+
continue;
|
|
17
|
+
// An explicit URL already takes precedence over file_path on Google Drive.
|
|
18
|
+
if (target !== name && typeof resolved[target] === 'string' && resolved[target]) {
|
|
19
|
+
delete resolved[name];
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const isDrivePath = ['aidrive://', '/aidrive/', '/mnt/aidrive/'].some(prefix => source.startsWith(prefix));
|
|
23
|
+
const uploaded = isDrivePath ? source : await resolveFile(source);
|
|
24
|
+
resolved[target] = uploaded;
|
|
25
|
+
if (target !== name)
|
|
26
|
+
delete resolved[name];
|
|
27
|
+
// Wrapper URLs carry opaque ids; retain the original local filename.
|
|
28
|
+
if (uploaded !== source && !resolved.file_name) {
|
|
29
|
+
resolved.file_name = path.basename(source);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return resolved;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=file-path-uploads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-path-uploads.js","sourceRoot":"","sources":["../src/file-path-uploads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAGjC,+EAA+E;AAC/E,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAA6B,EAC7B,UAAyC,EACzC,WAAgD;IAEhD,MAAM,QAAQ,GAAG,EAAE,GAAG,IAAI,EAAE,CAAA;IAC5B,KAAK,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3D,MAAM,aAAa,GAAG,SAAS,CAAC,cAAc,CAAC,CAAA;QAC/C,IAAI,MAA0B,CAAA;QAC9B,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;YACtC,MAAM,GAAG,aAAa,CAAA;QACxB,CAAC;aAAM,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,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kBG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;GAkBG;AAkhBH,KAAK,oBAAoB,GAAG,kBAAkB,GAAG,SAAS,GAAG,SAAS,CAAA;AAEtE,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,oBAAoB,CAAA;CAC3B;AAED,kFAAkF;AAClF,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EAAE,GACb,mBAAmB,EAAE,CAqBvB"}
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* Tool name: "web_search" -> Command: `gsk web_search`, Alias: `gsk search`
|
|
19
19
|
* Tool name: "crawler" -> Command: `gsk crawler`, Alias: `gsk crawl`
|
|
20
20
|
*/
|
|
21
|
+
import { resolveUploadFilePaths } from './file-path-uploads.js';
|
|
21
22
|
import { Command, CommanderError, InvalidArgumentError, Option, } from 'commander';
|
|
22
23
|
import { resolveProjectSelection } from './project-binding.js';
|
|
23
24
|
import { registerDeveloperCommands } from './commands/developer-project.js';
|
|
@@ -46,9 +47,10 @@ import { shimLegacyTaskInvocation } from './task-shim.js';
|
|
|
46
47
|
import { getSandboxRuntime } from './runtime.js';
|
|
47
48
|
import { registerDesignCommand } from './commands/design.js';
|
|
48
49
|
import { collectUploadFiles, aidriveUploadHeaders, buildAidriveUploadQuery, mergeShareIntoUpload, normalizeUploadDestination, resolveAidriveUploadOperands, shareArgsFromUpload, uploadConflictFromCli, uploadConflictProblem, uploadPathForDestination, uploadShareRefusal, } from './commands/aidrive-upload.js';
|
|
49
|
-
import { aidriveOperandArgs } from './commands/aidrive-operands.js';
|
|
50
|
+
import { aidriveOperandArgs, canonicalDriveAction, driveArgumentError } from './commands/aidrive-operands.js';
|
|
50
51
|
import { resolveAidriveDownloadOperands, normalizeDrivePath, extractReadableUrl, shouldResolveFileWrapperUrl, } from './commands/aidrive-download.js';
|
|
51
52
|
import { fileNameFromContentDisposition, genteamAttachmentEndpoint, resolveGenteamDownloadDestination, saveBodyToFile, } from './commands/genteam-download.js';
|
|
53
|
+
import { CALL_RECORDING_INFO_HELP, CALL_RECORDING_LOCAL_FILE_HELP, callRecordingEndpoint, defaultRecordingFileName, formatBytes, normalizeRecordingChannels, progressThrottle, RECORDING_CHANNEL_MODES, recordingDestinationOperands, recordingProgressLine, } from './commands/telephony-recording.js';
|
|
52
54
|
import { parseLastSeenIndex, eventStdoutLine } from './commands/chat-events.js';
|
|
53
55
|
import { defaultPiAgentDir, mergePiModelsConfig, mergePiSettingsConfig, readJsonIfExists, resolvePiAgentDir, writeJsonFile, } from './commands/pi-config.js';
|
|
54
56
|
import { mediaItemsKeyFor, mediaSummaryLines } from './mediaSummary.js';
|
|
@@ -792,6 +794,25 @@ function parseBooleanFlagValue(value) {
|
|
|
792
794
|
return false;
|
|
793
795
|
throw new InvalidArgumentError(`expected true/false. If '${value}' was meant as an argument, place it before the flag or pass an explicit value (--flag true ${value}).`);
|
|
794
796
|
}
|
|
797
|
+
function addAidriveLocalOptions(cmd, props, action) {
|
|
798
|
+
if (!Object.hasOwn(props, 'workspace')) {
|
|
799
|
+
cmd.option('--workspace <value>', 'AI Drive workspace: my_drive, shared_with_me, or shared_drive');
|
|
800
|
+
}
|
|
801
|
+
cmd.option('--local_file <path>', action === 'download'
|
|
802
|
+
? 'Local destination path; use --local_file with --id or --url. ' +
|
|
803
|
+
'Otherwise the second operand is the destination.'
|
|
804
|
+
: 'upload: local file path to upload to AI Drive (supports files >5 MB; ' +
|
|
805
|
+
'alternative to --file_content; same as the first operand of ' +
|
|
806
|
+
'`upload <local> <drive folder>/`). download: local destination path ' +
|
|
807
|
+
'(same as the second operand; default ./<basename of the drive path>)');
|
|
808
|
+
// An optional value, as schema booleans take: presence-only, the
|
|
809
|
+
// `false` in `--override false` was left over and the upload overwrote.
|
|
810
|
+
cmd.option('--override [value]', 'Overwrite an existing file at the destination path (used with --local_file)', parseBooleanFlagValue);
|
|
811
|
+
cmd.option('--on-conflict <mode>', 'upload: what to do when the destination name is taken — ' +
|
|
812
|
+
'error | rename | overwrite (default: rename, which lands ' +
|
|
813
|
+
'name(1).ext and reports the path actually written). Use error for ' +
|
|
814
|
+
'idempotent scripts that retry on failure.');
|
|
815
|
+
}
|
|
795
816
|
/**
|
|
796
817
|
* Register one schema parameter as a Commander option.
|
|
797
818
|
*
|
|
@@ -997,6 +1018,10 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
997
1018
|
// accepts its own and rejects wrong-action flags at parse time. Hidden
|
|
998
1019
|
// legacy forms keep the union view.
|
|
999
1020
|
const actionViews = cmdOpts?.deprecated ? null : serviceActionViews(tool);
|
|
1021
|
+
// Preserve pre-action flags for old Drive scripts; let subcommands parse
|
|
1022
|
+
// post-action flags themselves so scoped help and local operands both work.
|
|
1023
|
+
if (tool.name === 'aidrive' && actionViews)
|
|
1024
|
+
cmd.enablePositionalOptions();
|
|
1000
1025
|
// If primary_arg is set, make it a positional argument
|
|
1001
1026
|
if (tool.cli.primary_arg && props[tool.cli.primary_arg]) {
|
|
1002
1027
|
const param = props[tool.cli.primary_arg];
|
|
@@ -1021,7 +1046,7 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
1021
1046
|
// unknown action names still reach the server) and --args-file.
|
|
1022
1047
|
const aliases = tool.cli.parameter_aliases || {};
|
|
1023
1048
|
for (const [name, param] of Object.entries(props)) {
|
|
1024
|
-
if (actionViews)
|
|
1049
|
+
if (actionViews && tool.name !== 'aidrive')
|
|
1025
1050
|
break;
|
|
1026
1051
|
if (name === tool.cli.primary_arg)
|
|
1027
1052
|
continue;
|
|
@@ -1114,28 +1139,21 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
1114
1139
|
}
|
|
1115
1140
|
// For the aidrive tool, add client-side options used by the --local_file
|
|
1116
1141
|
// upload and by `download`'s local destination.
|
|
1117
|
-
if (tool.name === 'aidrive')
|
|
1118
|
-
|
|
1119
|
-
cmd.option('--workspace <value>', 'AI Drive workspace: my_drive, shared_with_me, or shared_drive');
|
|
1120
|
-
}
|
|
1121
|
-
cmd.option('--local_file <path>', 'upload: local file path to upload to AI Drive (supports files >5 MB; ' +
|
|
1122
|
-
'alternative to --file_content; same as the first operand of ' +
|
|
1123
|
-
'`upload <local> <drive folder>/`). download: local destination path ' +
|
|
1124
|
-
'(same as the second operand; default ./<basename of the drive path>)');
|
|
1125
|
-
// An optional value, as schema booleans take: presence-only, the
|
|
1126
|
-
// `false` in `--override false` was left over and the upload overwrote.
|
|
1127
|
-
cmd.option('--override [value]', 'Overwrite an existing file at the destination path (used with --local_file)', parseBooleanFlagValue);
|
|
1128
|
-
cmd.option('--on-conflict <mode>', 'upload: what to do when the destination name is taken — ' +
|
|
1129
|
-
'error | rename | overwrite (default: rename, which lands ' +
|
|
1130
|
-
'name(1).ext and reports the path actually written). Use error for ' +
|
|
1131
|
-
'idempotent scripts that retry on failure.');
|
|
1132
|
-
}
|
|
1142
|
+
if (tool.name === 'aidrive')
|
|
1143
|
+
addAidriveLocalOptions(cmd, props);
|
|
1133
1144
|
// genteam download saves the attachment to local disk (client-side: only
|
|
1134
1145
|
// this process can write the local filesystem). The union view takes the
|
|
1135
1146
|
// flag here; the per-action `download` subcommand registers it below.
|
|
1136
1147
|
if (tool.name === 'genteam' && !actionViews) {
|
|
1137
1148
|
cmd.option('--local_file <path>', GENTEAM_DOWNLOAD_LOCAL_FILE_HELP);
|
|
1138
1149
|
}
|
|
1150
|
+
// telephony call recording (#66245): the WAV streams straight to local
|
|
1151
|
+
// disk, so the destination and the metadata-only switch are CLI-side;
|
|
1152
|
+
// `--channels` comes from the server schema like any other parameter.
|
|
1153
|
+
if (tool.name === 'call_recording') {
|
|
1154
|
+
cmd.option('--local_file <path>', CALL_RECORDING_LOCAL_FILE_HELP);
|
|
1155
|
+
cmd.option('--info', CALL_RECORDING_INFO_HELP, false);
|
|
1156
|
+
}
|
|
1139
1157
|
// For sb-git: `--execute [dest]` turns `clone-url` from a snippet-print
|
|
1140
1158
|
// into an actual `git clone`. Client-side because the backend `clone-url`
|
|
1141
1159
|
// adaptor returns shell placeholders rather than embedding secrets in
|
|
@@ -1177,6 +1195,9 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
1177
1195
|
opts = primaryArgValue;
|
|
1178
1196
|
primaryArgValue = undefined;
|
|
1179
1197
|
}
|
|
1198
|
+
if (tool.name === 'aidrive' && invokedCmd !== cmd) {
|
|
1199
|
+
opts = { ...cmd.opts(), ...opts };
|
|
1200
|
+
}
|
|
1180
1201
|
// Global flags written after the tool name arrive here as the
|
|
1181
1202
|
// subcommand's own options: record them for getGlobalOptions and keep
|
|
1182
1203
|
// them out of the tool arguments (they are not server parameters).
|
|
@@ -1469,29 +1490,34 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
1469
1490
|
let aidriveOperands = [];
|
|
1470
1491
|
if (tool.name === 'aidrive' && typeof args.action === 'string') {
|
|
1471
1492
|
const actionNames = props.action?.enum;
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
// "rm" would have removed a path named "ls".
|
|
1493
|
+
const primaryAction = primaryArgValue === undefined
|
|
1494
|
+
? undefined : canonicalDriveAction(primaryArgValue);
|
|
1495
|
+
const action = canonicalDriveAction(args.action);
|
|
1496
|
+
args.action = action;
|
|
1497
|
+
if (primaryAction !== undefined && primaryAction !== action &&
|
|
1498
|
+
(invokedCmd !== cmd || (Array.isArray(actionNames) && actionNames.includes(primaryAction)))) {
|
|
1479
1499
|
logError(`The command line names the action ${primaryArgValue} and ` +
|
|
1480
1500
|
`--args-file names ${args.action}; pass one. Nothing was sent.`);
|
|
1481
1501
|
process.exit(1);
|
|
1482
1502
|
}
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1503
|
+
if (Array.isArray(actionNames) && !actionNames.includes(action)) {
|
|
1504
|
+
logError(`Unknown AI Drive action: ${args.action}. Run gsk drive --help for available actions. Nothing was sent.`);
|
|
1505
|
+
process.exit(1);
|
|
1506
|
+
}
|
|
1507
|
+
aidriveOperands = invokedCmd !== cmd ? invokedCmd.args
|
|
1508
|
+
: primaryAction !== undefined && primaryAction === action
|
|
1509
|
+
? invokedCmd.args.slice(1) : invokedCmd.args;
|
|
1510
|
+
const mapped = aidriveOperandArgs(action, aidriveOperands, args);
|
|
1490
1511
|
if (mapped.error) {
|
|
1491
1512
|
logError(mapped.error);
|
|
1492
1513
|
process.exit(1);
|
|
1493
1514
|
}
|
|
1494
1515
|
Object.assign(args, mapped.filled);
|
|
1516
|
+
const argumentError = driveArgumentError(action, args);
|
|
1517
|
+
if (argumentError) {
|
|
1518
|
+
logError(argumentError + ' Nothing was sent.');
|
|
1519
|
+
process.exit(1);
|
|
1520
|
+
}
|
|
1495
1521
|
}
|
|
1496
1522
|
// Pre-call confirmation (confirm.ts): when the cached /tools
|
|
1497
1523
|
// payload advertised interactive_confirm AND the schema marks this
|
|
@@ -1533,6 +1559,12 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
1533
1559
|
if (tool.name === 'genteam') {
|
|
1534
1560
|
delete args.local_file;
|
|
1535
1561
|
}
|
|
1562
|
+
// call_recording: --local_file / --info steer the client-side
|
|
1563
|
+
// download below; the server tool knows neither.
|
|
1564
|
+
if (tool.name === 'call_recording') {
|
|
1565
|
+
delete args.local_file;
|
|
1566
|
+
delete args.info;
|
|
1567
|
+
}
|
|
1536
1568
|
// sb-git --execute is client-side only; never forward.
|
|
1537
1569
|
let sbGitExecuteDest;
|
|
1538
1570
|
let sbGitExecuteRequested = false;
|
|
@@ -1690,10 +1722,7 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
1690
1722
|
// Never forwarded to the server, which answers a CLI too old to
|
|
1691
1723
|
// intercept it with the two-call equivalent.
|
|
1692
1724
|
if (tool.name === 'aidrive' && args.action === 'download') {
|
|
1693
|
-
const
|
|
1694
|
-
? invokedCmd.args.slice(1)
|
|
1695
|
-
: invokedCmd.args;
|
|
1696
|
-
const { drivePath: sourceOperand, localPath: operandDest } = resolveAidriveDownloadOperands(operandCandidates, typeof args.path === 'string' ? args.path : undefined);
|
|
1725
|
+
const { drivePath: sourceOperand, localPath: operandDest } = resolveAidriveDownloadOperands(aidriveOperands, typeof args.path === 'string' ? args.path : undefined);
|
|
1697
1726
|
const hasDownloadLocator = !!(args.id || args.url || args.source || args.share);
|
|
1698
1727
|
if (!sourceOperand && !hasDownloadLocator) {
|
|
1699
1728
|
logError('download needs the AI-Drive path: gsk aidrive download ' +
|
|
@@ -1798,6 +1827,58 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
1798
1827
|
});
|
|
1799
1828
|
return;
|
|
1800
1829
|
}
|
|
1830
|
+
// Save a Call-For-Me recording to local disk (#66245). Client-side
|
|
1831
|
+
// for the same reason as genteam download: only this process can
|
|
1832
|
+
// write the local filesystem, so the CLI streams the gsk-token
|
|
1833
|
+
// recording route straight into the file. `--info` keeps the
|
|
1834
|
+
// metadata-only server tool call (falls through below).
|
|
1835
|
+
if (tool.name === 'call_recording' && opts.info !== true) {
|
|
1836
|
+
const projectId = typeof args.project_id === 'string' ? args.project_id.trim() : '';
|
|
1837
|
+
if (!projectId) {
|
|
1838
|
+
logError('recording needs <project_id> (from a `dial` result or a ' +
|
|
1839
|
+
'`gsk telephony call log` entry)');
|
|
1840
|
+
process.exit(1);
|
|
1841
|
+
}
|
|
1842
|
+
const channels = normalizeRecordingChannels(args.channels);
|
|
1843
|
+
if (args.channels !== undefined && channels === undefined) {
|
|
1844
|
+
logError(`--channels must be one of: ${RECORDING_CHANNEL_MODES.join(', ')}`);
|
|
1845
|
+
process.exit(1);
|
|
1846
|
+
}
|
|
1847
|
+
const operands = recordingDestinationOperands(invokedCmd.args, primaryArgValue);
|
|
1848
|
+
let response;
|
|
1849
|
+
try {
|
|
1850
|
+
response = await client.fetchBinary(callRecordingEndpoint(projectId, channels));
|
|
1851
|
+
}
|
|
1852
|
+
catch (err) {
|
|
1853
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
1854
|
+
logError(`call recording download failed: ${reason}`);
|
|
1855
|
+
process.exit(1);
|
|
1856
|
+
}
|
|
1857
|
+
if (!response.body) {
|
|
1858
|
+
logError('call recording download failed: empty response body');
|
|
1859
|
+
process.exit(1);
|
|
1860
|
+
}
|
|
1861
|
+
const fileName = fileNameFromContentDisposition(response.headers.get('content-disposition')) ?? defaultRecordingFileName(projectId, channels);
|
|
1862
|
+
const destPath = resolveGenteamDownloadDestination(operands, typeof opts.local_file === 'string' ? opts.local_file : undefined, fileName);
|
|
1863
|
+
const totalBytes = Number(response.headers.get('content-length')) || undefined;
|
|
1864
|
+
// Progress goes to stderr only while a human watches a terminal
|
|
1865
|
+
// (logger.progress); in a sandbox stdout stays exactly one JSON.
|
|
1866
|
+
const saved = await saveBodyToFile(response.body, destPath, progressThrottle(500, received => progress(recordingProgressLine(fileName, received, totalBytes))));
|
|
1867
|
+
progress(`Downloaded ${formatBytes(saved.size_bytes)} → ${saved.local_path}`);
|
|
1868
|
+
output({
|
|
1869
|
+
status: 'ok',
|
|
1870
|
+
message: 'Call recording downloaded to local disk',
|
|
1871
|
+
data: {
|
|
1872
|
+
project_id: projectId,
|
|
1873
|
+
channels: channels ?? 'stereo',
|
|
1874
|
+
channel_map: response.headers.get('x-audio-channel-map') ?? null,
|
|
1875
|
+
file_name: fileName,
|
|
1876
|
+
content_type: response.headers.get('content-type') ?? 'audio/wav',
|
|
1877
|
+
...saved,
|
|
1878
|
+
},
|
|
1879
|
+
});
|
|
1880
|
+
return;
|
|
1881
|
+
}
|
|
1801
1882
|
// `download_file` saves an external URL INTO the drive and cannot copy
|
|
1802
1883
|
// one out, yet it is the obvious spelling for "download a drive file"
|
|
1803
1884
|
// and both attempts used to fail silently: its handler never consumes
|
|
@@ -2023,7 +2104,8 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
2023
2104
|
}
|
|
2024
2105
|
// Resolve local file paths to uploaded URLs
|
|
2025
2106
|
// The drive's --url is the Drive link an entry is addressed by.
|
|
2026
|
-
const
|
|
2107
|
+
const uploadArgs = await resolveUploadFilePaths(args, tool.parameters.properties, source => resolveFileArg(source, client));
|
|
2108
|
+
const resolvedArgs = await resolveLocalFiles(uploadArgs, client, tool.name === 'aidrive' ? new Set(['url']) : undefined);
|
|
2027
2109
|
// The server owns the async-first default: create_task /
|
|
2028
2110
|
// task_continue return a submit stub ({status: "submitted",
|
|
2029
2111
|
// run_id, stream_url}) unless `--wait true` was passed. --attach
|
|
@@ -2284,12 +2366,19 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
2284
2366
|
const allActionNames = actionViews.map(view => view.name);
|
|
2285
2367
|
for (const view of actionViews) {
|
|
2286
2368
|
const sub = cmd.command(view.name).description(view.description);
|
|
2287
|
-
|
|
2369
|
+
if (tool.name === 'aidrive') {
|
|
2370
|
+
sub.aliases(view.aliases);
|
|
2371
|
+
if (view.example)
|
|
2372
|
+
sub.addHelpText('after', `\nExample: ${view.example}`);
|
|
2373
|
+
}
|
|
2374
|
+
const parameterNames = tool.name === 'aidrive'
|
|
2375
|
+
? Object.keys(props).filter(name => name !== tool.cli.primary_arg) : view.parameters;
|
|
2376
|
+
for (const paramName of parameterNames) {
|
|
2288
2377
|
addSchemaOption(sub, paramName, props[paramName], {
|
|
2289
2378
|
// Same relaxation as the union path: with --args-file on the
|
|
2290
2379
|
// command line, required params may live in the file, which
|
|
2291
2380
|
// Commander cannot see at parse time.
|
|
2292
|
-
isRequired: argsFileInvoked
|
|
2381
|
+
isRequired: argsFileInvoked || tool.name === 'aidrive'
|
|
2293
2382
|
? false
|
|
2294
2383
|
: view.required.includes(paramName),
|
|
2295
2384
|
shortAlias: aliases[paramName],
|
|
@@ -2299,6 +2388,17 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
2299
2388
|
description: actionScopedDescription(props[paramName].description || paramName, view.name, allActionNames),
|
|
2300
2389
|
});
|
|
2301
2390
|
}
|
|
2391
|
+
if (tool.name === 'aidrive') {
|
|
2392
|
+
addAidriveLocalOptions(sub, props, view.name);
|
|
2393
|
+
const localFlags = view.name === 'upload'
|
|
2394
|
+
? ['local_file', 'override', 'on-conflict']
|
|
2395
|
+
: view.name === 'download' ? ['local_file'] : [];
|
|
2396
|
+
for (const option of sub.options) {
|
|
2397
|
+
const name = option.long?.slice(2) ?? '';
|
|
2398
|
+
if (!view.parameters.includes(name) && !localFlags.includes(name))
|
|
2399
|
+
option.hideHelp();
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2302
2402
|
const actionInfo = tool.actions?.[view.name];
|
|
2303
2403
|
if (actionInfo?.requires_confirmation === true) {
|
|
2304
2404
|
addHiddenLegacySkipOptions(sub, props);
|