@genspark/cli 1.15.4-beta.0 → 1.15.4

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.
Files changed (36) hide show
  1. package/README.md +87 -1
  2. package/dist/client.d.ts +11 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +29 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/commands/aidrive-contract.generated.d.ts.map +1 -1
  7. package/dist/commands/aidrive-contract.generated.js +41 -7
  8. package/dist/commands/aidrive-contract.generated.js.map +1 -1
  9. package/dist/commands/developer-input.d.ts +1 -1
  10. package/dist/commands/developer-input.d.ts.map +1 -1
  11. package/dist/commands/developer-input.js +14 -10
  12. package/dist/commands/developer-input.js.map +1 -1
  13. package/dist/commands/sb-box-session.d.ts +7 -6
  14. package/dist/commands/sb-box-session.d.ts.map +1 -1
  15. package/dist/commands/sb-box-session.js +21 -41
  16. package/dist/commands/sb-box-session.js.map +1 -1
  17. package/dist/commands/tts-stream.d.ts +68 -0
  18. package/dist/commands/tts-stream.d.ts.map +1 -0
  19. package/dist/commands/tts-stream.js +291 -0
  20. package/dist/commands/tts-stream.js.map +1 -0
  21. package/dist/index.js +81 -16
  22. package/dist/index.js.map +1 -1
  23. package/docs/skills.md +5 -4
  24. package/gated-skills/gsk-issue/SKILL.md +43 -0
  25. package/package.json +2 -1
  26. package/skills/gsk-aidrive/SKILL.md +36 -476
  27. package/skills/gsk-aidrive/command-reference.md +540 -0
  28. package/skills/gsk-connector/SKILL.md +5 -3
  29. package/skills/gsk-get-service-url/SKILL.md +1 -1
  30. package/skills/gsk-gmail/SKILL.md +17 -17
  31. package/skills/gsk-google-calendar/SKILL.md +3 -3
  32. package/skills/gsk-outlook-calendar/SKILL.md +1 -1
  33. package/skills/gsk-second-brain/SKILL.md +13 -14
  34. package/skills/gsk-shared/SKILL.md +1 -1
  35. package/skills/gsk-team-brain/SKILL.md +141 -0
  36. package/skills/gsk-video-generation/SKILL.md +2 -2
package/dist/index.js CHANGED
@@ -56,11 +56,12 @@ import { resolveAidriveDownloadOperands, normalizeDrivePath, extractReadableUrl,
56
56
  import { fileNameFromContentDisposition, genteamAttachmentEndpoint, resolveGenteamDownloadDestination, saveBodyToFile, } from './commands/genteam-download.js';
57
57
  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';
58
58
  import { parseLastSeenIndex, eventStdoutLine } from './commands/chat-events.js';
59
+ import { registerTtsCommand } from './commands/tts-stream.js';
59
60
  import { defaultPiAgentDir, mergePiModelsConfig, mergePiSettingsConfig, readJsonIfExists, resolvePiAgentDir, writeJsonFile, } from './commands/pi-config.js';
60
61
  import { mediaItemsKeyFor, mediaProgressLines, mediaSummaryLines, } from './mediaSummary.js';
61
62
  import { registerMeshCommand, getMeshInvocation, runMesh, } from './commands/mesh.js';
62
63
  import { executeCloneUrl, normalizeCloneUrlForGit, } from './commands/sb-git-clone.js';
63
- import { afterSessionCall, bindSession, defaultTemplate, resolveSessionKey, SANDBOX_ACTIONS, SessionError, SessionStore, SESSION_ENV, } from './commands/sb-box-session.js';
64
+ import { afterSessionCall, bindSession, resolveSessionKey, SANDBOX_ACTIONS, SessionError, SessionStore, SESSION_ENV, } from './commands/sb-box-session.js';
64
65
  import { actionScopedDescription, serviceActionViews, } from './serviceActions.js';
65
66
  const require = createRequire(import.meta.url);
66
67
  const { version: VERSION } = require('../package.json');
@@ -599,7 +600,8 @@ async function downloadToFile(url, savePath, client) {
599
600
  downloadUrl = result.data.download_url;
600
601
  }
601
602
  const { developerInputDownload } = await import('./commands/developer-input.js');
602
- const download = developerInputDownload(downloadUrl, getGlobalOptions().baseUrl, getGlobalOptions().apiKey || '');
603
+ const { baseUrl, apiKey, projectId } = getGlobalOptions();
604
+ const download = developerInputDownload(downloadUrl, baseUrl, apiKey || '', projectId);
603
605
  const resp = await fetch(download.url, download.init);
604
606
  if (!resp.ok)
605
607
  throw new Error(`Download failed: HTTP ${resp.status}`);
@@ -2204,20 +2206,13 @@ function registerToolCommand(parentProgram, tool, clientFactory, vdProjectIdDefa
2204
2206
  else if (key && SANDBOX_ACTIONS.has(action) && !hasSandboxId) {
2205
2207
  sbBoxSession = key;
2206
2208
  }
2207
- // create without --template: newest ready public base (CLI-side).
2209
+ // create without --template: the server picks the public `base`
2210
+ // of the placement lever's region (gen-spark#79863) — never a
2211
+ // client-side "newest catalog row" that ignores the region.
2208
2212
  if (action === 'create' &&
2209
2213
  !(typeof args.template === 'string' && args.template.trim())) {
2210
- try {
2211
- args.template = await defaultTemplate(callArgs => client.executeTool('sb-box', callArgs));
2212
- info(`create: no --template given, using the public base ${args.template}`);
2213
- }
2214
- catch (err) {
2215
- if (err instanceof SessionError) {
2216
- sessionErrorEnvelope(err);
2217
- return;
2218
- }
2219
- throw err;
2220
- }
2214
+ delete args.template;
2215
+ info('create: no --template given, using the public base of the default region');
2221
2216
  }
2222
2217
  if (sbBoxSession) {
2223
2218
  sbBoxStore = SessionStore.forConfig(getConfigPath(), getGlobalOptions().baseUrl);
@@ -2708,7 +2703,8 @@ program
2708
2703
  // If save path specified, download using the already-fetched URL
2709
2704
  if (opts.save) {
2710
2705
  const { developerInputDownload } = await import('./commands/developer-input.js');
2711
- const download = developerInputDownload(result.data.download_url, getGlobalOptions().baseUrl, getGlobalOptions().apiKey || '');
2706
+ const { baseUrl, apiKey, projectId } = getGlobalOptions();
2707
+ const download = developerInputDownload(result.data.download_url, baseUrl, apiKey || '', projectId);
2712
2708
  let sizeBytes;
2713
2709
  try {
2714
2710
  const resp = await fetch(download.url, download.init);
@@ -3043,6 +3039,7 @@ program
3043
3039
  fs.copyFileSync(srcPath, destPath);
3044
3040
  }
3045
3041
  }
3042
+ await _syncGatedSkills(cliDir, destDir);
3046
3043
  const skillDirs = fs
3047
3044
  .readdirSync(destDir)
3048
3045
  .filter(d => fs.statSync(pathModule.join(destDir, d)).isDirectory());
@@ -3128,6 +3125,53 @@ program
3128
3125
  process.exit(1);
3129
3126
  }
3130
3127
  });
3128
+ /**
3129
+ * Skills for gatekeeper-gated command groups, keyed by the group the server
3130
+ * must list for the caller. They ship in `gated-skills/`, outside the
3131
+ * `skills/` tree that other installers (OpenClaw VM cron, sandbox mirrors)
3132
+ * copy wholesale, and only `init-skills` hands them out.
3133
+ */
3134
+ const GATED_SKILLS = {
3135
+ // GenDesk issues (gk_gendesk_issue_cli). The doc tells the agent that
3136
+ // "my issues" means GenDesk, which is wrong for anyone without it.
3137
+ 'gsk-issue': 'issue',
3138
+ };
3139
+ /**
3140
+ * Copy each gated skill the caller may use and remove an earlier copy of one
3141
+ * they may not. The server omits gated tools from the manifest, so a group
3142
+ * is listed exactly when the gate admits the caller. Only a fresh manifest
3143
+ * decides either way: the tools cache can lag a gate flip by a day, so
3144
+ * without one (no API key, failed fetch) nothing is copied or removed.
3145
+ */
3146
+ async function _syncGatedSkills(cliDir, destDir) {
3147
+ const globalOpts = getGlobalOptions();
3148
+ if (!globalOpts.apiKey)
3149
+ return;
3150
+ let groups;
3151
+ try {
3152
+ const { tools } = await new ApiClient(globalOpts).listTools();
3153
+ groups = new Set(tools.map(tool => tool.cli?.group).filter((g) => !!g));
3154
+ }
3155
+ catch {
3156
+ debug('Could not fetch the tool list; gated skills left as they are');
3157
+ return;
3158
+ }
3159
+ const gatedDir = pathModule.join(cliDir, 'gated-skills');
3160
+ for (const [skill, group] of Object.entries(GATED_SKILLS)) {
3161
+ const srcPath = pathModule.join(gatedDir, skill);
3162
+ const destPath = pathModule.join(destDir, skill);
3163
+ if (groups.has(group)) {
3164
+ if (fs.existsSync(srcPath))
3165
+ _copyDirRecursive(srcPath, destPath);
3166
+ continue;
3167
+ }
3168
+ const skillMd = pathModule.join(destPath, 'SKILL.md');
3169
+ if (fs.existsSync(skillMd) &&
3170
+ fs.readFileSync(skillMd, 'utf-8').startsWith(`---\nname: ${skill}\n`)) {
3171
+ fs.rmSync(destPath, { recursive: true, force: true });
3172
+ }
3173
+ }
3174
+ }
3131
3175
  /** Recursively copy a directory */
3132
3176
  function _copyDirRecursive(src, dest) {
3133
3177
  fs.mkdirSync(dest, { recursive: true });
@@ -3476,6 +3520,21 @@ addPhoneCallOptions(phoneCallCmd
3476
3520
  // Seed the dynamic-group map so server-registered phone-call tools become
3477
3521
  // subcommands of this static parent instead of a duplicate top-level group.
3478
3522
  _groupCommands.set('phone-call', phoneCallCmd);
3523
+ // Realtime streaming TTS (`gsk tts stream` / `gsk tts models`). Static: the
3524
+ // audio is raw bytes piped to stdout or a file as it is synthesized, which
3525
+ // the generic NDJSON tool handler cannot carry. Seeded into _groupCommands so
3526
+ // a future server-registered `tts` verb attaches here instead of colliding.
3527
+ _groupCommands.set('tts', registerTtsCommand(program, () => {
3528
+ const client = createClient();
3529
+ return {
3530
+ postStream: (endpoint, body) => client.postBinaryStream(endpoint, body),
3531
+ getModels: () => client.getJson('/tts/models'),
3532
+ output,
3533
+ progress,
3534
+ logError,
3535
+ exit: (code) => process.exit(code),
3536
+ };
3537
+ }));
3479
3538
  // The task command tree. Verbs are server-registered (create / status /
3480
3539
  // info / ask / answer / messages / wait / stop / delete / rename attach as
3481
3540
  // dynamic subcommands via the seeded group); this static parent gives the
@@ -3777,7 +3836,13 @@ async function main() {
3777
3836
  're-authenticate.');
3778
3837
  }
3779
3838
  else {
3780
- debug(`Failed to fetch tools: ${err.message}`);
3839
+ // Just as loud as the auth case: a script's log otherwise shows
3840
+ // only "unknown command" for every server-provided command.
3841
+ warn(`Could not load the server command list (${err.message}) — ` +
3842
+ (staleFallbackTools
3843
+ ? 'using the previously cached commands.'
3844
+ : 'server-provided commands were NOT loaded; only built-in ' +
3845
+ 'commands work. Retry, or run with --refresh --debug.'));
3781
3846
  }
3782
3847
  // Continue without dynamic commands - built-in commands still work
3783
3848
  }