@genspark/cli 1.14.0 → 1.14.1
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/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/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 +69 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/skills.md +2 -2
- package/package.json +1 -1
- package/skills/gsk-aidrive/SKILL.md +66 -116
- 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-crawler/SKILL.md +1 -0
- package/skills/gsk-create-task/SKILL.md +6 -1
- package/skills/gsk-genteam/SKILL.md +1 -0
- 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 +4 -2
- 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 +1 -0
- package/skills/gsk-outlook-contacts/SKILL.md +1 -0
- package/skills/gsk-outlook-email/SKILL.md +4 -2
- package/skills/gsk-phone-call/SKILL.md +138 -0
- package/skills/gsk-salesforce/SKILL.md +1 -0
- package/skills/gsk-sb-brain/SKILL.md +1 -0
- package/skills/gsk-scholar-search/SKILL.md +1 -0
- package/skills/gsk-second-brain/SKILL.md +1 -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 +4 -1
- 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
package/README.md
CHANGED
|
@@ -1381,6 +1381,7 @@ gsk mesh forward -L 8080:localhost:80 workstation # browse its local web app a
|
|
|
1381
1381
|
| `elevenlabs/voice-clone` | Clone a voice from audio samples. Returns voice ID for use in TTS generation |
|
|
1382
1382
|
| `elevenlabs/voice-changer` | Transform audio from one voice to another. Requires source audio and target voice ID |
|
|
1383
1383
|
| `fal-ai/minimax/voice-clone` | Clone a voice from a sample audio and generate speech from text prompts (gated feature) |
|
|
1384
|
+
| `google/gemini-voice-clone` | Gemini voice replication. Requires a 10-30s reference clip (`params.voice_files`) AND a consent clip of the same speaker (`params.consent_audio_file`). Returns a `voice_...` / `voicekey_...` id for use with `google/gemini-3.8-flash-tts` |
|
|
1384
1385
|
|
|
1385
1386
|
</details>
|
|
1386
1387
|
|
|
@@ -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;AAEhE,wBAAgB,yBAAyB,CACvC,SAA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AChB,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,CAAC;QAChC,UAAU,EAAE,SAAS;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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,EACjB,QAAuC;IAEvC,MAAM,K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AAqB,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"}
|
|
@@ -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,CAAC;YAC3C,MAAM,GAAG,aAAa,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACvC,CAAC;QACD,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC7B,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM;YAAE,SAAQ;QAC5F,2EAA2E;QAC3E,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAChF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAA;YACrB,SAAQ;QACV,CAAC;QACD,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAC7E,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAC1B,CAAA;QACD,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,WAAW,CAAC,MAAM,CAAC,CAAA;QACjE,QAAQ,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAA;QAC3B,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC1C,qEAAqE;QACrE,IAAI,QAAQ,KAAK,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YAC/C,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
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';
|
|
@@ -49,6 +50,7 @@ import { collectUploadFiles, aidriveUploadHeaders, buildAidriveUploadQuery, merg
|
|
|
49
50
|
import { aidriveOperandArgs } 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';
|
|
@@ -1136,6 +1138,13 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
1136
1138
|
if (tool.name === 'genteam' && !actionViews) {
|
|
1137
1139
|
cmd.option('--local_file <path>', GENTEAM_DOWNLOAD_LOCAL_FILE_HELP);
|
|
1138
1140
|
}
|
|
1141
|
+
// telephony call recording (#66245): the WAV streams straight to local
|
|
1142
|
+
// disk, so the destination and the metadata-only switch are CLI-side;
|
|
1143
|
+
// `--channels` comes from the server schema like any other parameter.
|
|
1144
|
+
if (tool.name === 'call_recording') {
|
|
1145
|
+
cmd.option('--local_file <path>', CALL_RECORDING_LOCAL_FILE_HELP);
|
|
1146
|
+
cmd.option('--info', CALL_RECORDING_INFO_HELP, false);
|
|
1147
|
+
}
|
|
1139
1148
|
// For sb-git: `--execute [dest]` turns `clone-url` from a snippet-print
|
|
1140
1149
|
// into an actual `git clone`. Client-side because the backend `clone-url`
|
|
1141
1150
|
// adaptor returns shell placeholders rather than embedding secrets in
|
|
@@ -1533,6 +1542,12 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
1533
1542
|
if (tool.name === 'genteam') {
|
|
1534
1543
|
delete args.local_file;
|
|
1535
1544
|
}
|
|
1545
|
+
// call_recording: --local_file / --info steer the client-side
|
|
1546
|
+
// download below; the server tool knows neither.
|
|
1547
|
+
if (tool.name === 'call_recording') {
|
|
1548
|
+
delete args.local_file;
|
|
1549
|
+
delete args.info;
|
|
1550
|
+
}
|
|
1536
1551
|
// sb-git --execute is client-side only; never forward.
|
|
1537
1552
|
let sbGitExecuteDest;
|
|
1538
1553
|
let sbGitExecuteRequested = false;
|
|
@@ -1798,6 +1813,58 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
1798
1813
|
});
|
|
1799
1814
|
return;
|
|
1800
1815
|
}
|
|
1816
|
+
// Save a Call-For-Me recording to local disk (#66245). Client-side
|
|
1817
|
+
// for the same reason as genteam download: only this process can
|
|
1818
|
+
// write the local filesystem, so the CLI streams the gsk-token
|
|
1819
|
+
// recording route straight into the file. `--info` keeps the
|
|
1820
|
+
// metadata-only server tool call (falls through below).
|
|
1821
|
+
if (tool.name === 'call_recording' && opts.info !== true) {
|
|
1822
|
+
const projectId = typeof args.project_id === 'string' ? args.project_id.trim() : '';
|
|
1823
|
+
if (!projectId) {
|
|
1824
|
+
logError('recording needs <project_id> (from a `dial` result or a ' +
|
|
1825
|
+
'`gsk telephony call log` entry)');
|
|
1826
|
+
process.exit(1);
|
|
1827
|
+
}
|
|
1828
|
+
const channels = normalizeRecordingChannels(args.channels);
|
|
1829
|
+
if (args.channels !== undefined && channels === undefined) {
|
|
1830
|
+
logError(`--channels must be one of: ${RECORDING_CHANNEL_MODES.join(', ')}`);
|
|
1831
|
+
process.exit(1);
|
|
1832
|
+
}
|
|
1833
|
+
const operands = recordingDestinationOperands(invokedCmd.args, primaryArgValue);
|
|
1834
|
+
let response;
|
|
1835
|
+
try {
|
|
1836
|
+
response = await client.fetchBinary(callRecordingEndpoint(projectId, channels));
|
|
1837
|
+
}
|
|
1838
|
+
catch (err) {
|
|
1839
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
1840
|
+
logError(`call recording download failed: ${reason}`);
|
|
1841
|
+
process.exit(1);
|
|
1842
|
+
}
|
|
1843
|
+
if (!response.body) {
|
|
1844
|
+
logError('call recording download failed: empty response body');
|
|
1845
|
+
process.exit(1);
|
|
1846
|
+
}
|
|
1847
|
+
const fileName = fileNameFromContentDisposition(response.headers.get('content-disposition')) ?? defaultRecordingFileName(projectId, channels);
|
|
1848
|
+
const destPath = resolveGenteamDownloadDestination(operands, typeof opts.local_file === 'string' ? opts.local_file : undefined, fileName);
|
|
1849
|
+
const totalBytes = Number(response.headers.get('content-length')) || undefined;
|
|
1850
|
+
// Progress goes to stderr only while a human watches a terminal
|
|
1851
|
+
// (logger.progress); in a sandbox stdout stays exactly one JSON.
|
|
1852
|
+
const saved = await saveBodyToFile(response.body, destPath, progressThrottle(500, received => progress(recordingProgressLine(fileName, received, totalBytes))));
|
|
1853
|
+
progress(`Downloaded ${formatBytes(saved.size_bytes)} → ${saved.local_path}`);
|
|
1854
|
+
output({
|
|
1855
|
+
status: 'ok',
|
|
1856
|
+
message: 'Call recording downloaded to local disk',
|
|
1857
|
+
data: {
|
|
1858
|
+
project_id: projectId,
|
|
1859
|
+
channels: channels ?? 'stereo',
|
|
1860
|
+
channel_map: response.headers.get('x-audio-channel-map') ?? null,
|
|
1861
|
+
file_name: fileName,
|
|
1862
|
+
content_type: response.headers.get('content-type') ?? 'audio/wav',
|
|
1863
|
+
...saved,
|
|
1864
|
+
},
|
|
1865
|
+
});
|
|
1866
|
+
return;
|
|
1867
|
+
}
|
|
1801
1868
|
// `download_file` saves an external URL INTO the drive and cannot copy
|
|
1802
1869
|
// one out, yet it is the obvious spelling for "download a drive file"
|
|
1803
1870
|
// and both attempts used to fail silently: its handler never consumes
|
|
@@ -2023,7 +2090,8 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
|
|
|
2023
2090
|
}
|
|
2024
2091
|
// Resolve local file paths to uploaded URLs
|
|
2025
2092
|
// The drive's --url is the Drive link an entry is addressed by.
|
|
2026
|
-
const
|
|
2093
|
+
const uploadArgs = await resolveUploadFilePaths(args, tool.parameters.properties, source => resolveFileArg(source, client));
|
|
2094
|
+
const resolvedArgs = await resolveLocalFiles(uploadArgs, client, tool.name === 'aidrive' ? new Set(['url']) : undefined);
|
|
2027
2095
|
// The server owns the async-first default: create_task /
|
|
2028
2096
|
// task_continue return a submit stub ({status: "submitted",
|
|
2029
2097
|
// run_id, stream_url}) unless `--wait true` was passed. --attach
|