@genspark/cli 1.12.0 → 1.13.0
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 +128 -2
- package/dist/client.d.ts +63 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +321 -3
- package/dist/client.js.map +1 -1
- package/dist/commands/developer-preflight.d.ts +17 -0
- package/dist/commands/developer-preflight.d.ts.map +1 -0
- package/dist/commands/developer-preflight.js +131 -0
- package/dist/commands/developer-preflight.js.map +1 -0
- package/dist/commands/developer-project.d.ts +5 -0
- package/dist/commands/developer-project.d.ts.map +1 -0
- package/dist/commands/developer-project.js +140 -0
- package/dist/commands/developer-project.js.map +1 -0
- package/dist/commands/genspark-code-skills.d.ts +23 -0
- package/dist/commands/genspark-code-skills.d.ts.map +1 -0
- package/dist/commands/genspark-code-skills.js +49 -0
- package/dist/commands/genspark-code-skills.js.map +1 -0
- package/dist/commands/hosted-local.d.ts +10 -0
- package/dist/commands/hosted-local.d.ts.map +1 -0
- package/dist/commands/hosted-local.js +116 -0
- package/dist/commands/hosted-local.js.map +1 -0
- package/dist/commands/local-command-routing.d.ts +8 -0
- package/dist/commands/local-command-routing.d.ts.map +1 -0
- package/dist/commands/local-command-routing.js +33 -0
- package/dist/commands/local-command-routing.js.map +1 -0
- package/dist/commands/local-preview.d.ts +5 -0
- package/dist/commands/local-preview.d.ts.map +1 -0
- package/dist/commands/local-preview.js +35 -0
- package/dist/commands/local-preview.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/developer-contract.d.ts +24 -0
- package/dist/developer-contract.d.ts.map +1 -0
- package/dist/developer-contract.js +64 -0
- package/dist/developer-contract.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +92 -12
- package/dist/index.js.map +1 -1
- package/dist/local-source.d.ts +22 -0
- package/dist/local-source.d.ts.map +1 -0
- package/dist/local-source.js +204 -0
- package/dist/local-source.js.map +1 -0
- package/dist/project-binding.d.ts +31 -0
- package/dist/project-binding.d.ts.map +1 -0
- package/dist/project-binding.js +141 -0
- package/dist/project-binding.js.map +1 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -2
- package/skills/gsk-aidrive/SKILL.md +19 -15
- package/skills/gsk-audio-generation/SKILL.md +1 -1
- package/skills/gsk-claw-share-link/SKILL.md +1 -1
- package/skills/gsk-google-calendar/SKILL.md +2 -1
- package/skills/gsk-outlook-calendar/SKILL.md +2 -1
- package/skills/gsk-sb-brain/SKILL.md +13 -82
- package/skills/gsk-second-brain/SKILL.md +158 -0
- package/skills/gsk-shared/SKILL.md +18 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as promises from 'node:fs/promises';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import * as os from 'node:os';
|
|
5
|
+
import { createHash } from 'node:crypto';
|
|
6
|
+
import { Transform } from 'node:stream';
|
|
7
|
+
import { pipeline } from 'node:stream/promises';
|
|
8
|
+
import { ZipFile } from 'yazl';
|
|
9
|
+
import { getConfigPath } from './config.js';
|
|
10
|
+
export const SOURCE_LIMITS = {
|
|
11
|
+
entries: 20000,
|
|
12
|
+
compressed: 250 * 1024 * 1024,
|
|
13
|
+
expanded: 500 * 1024 * 1024,
|
|
14
|
+
};
|
|
15
|
+
const excludedNames = new Set([
|
|
16
|
+
'.git',
|
|
17
|
+
'node_modules',
|
|
18
|
+
'.wrangler',
|
|
19
|
+
'.gsk',
|
|
20
|
+
'.genspark-code',
|
|
21
|
+
'.genspark-tool-cli',
|
|
22
|
+
'.meta',
|
|
23
|
+
'.gsk_hosted_deploy',
|
|
24
|
+
'__pycache__',
|
|
25
|
+
'.ssh',
|
|
26
|
+
'.aws',
|
|
27
|
+
'.azure',
|
|
28
|
+
'.config',
|
|
29
|
+
'.npmrc',
|
|
30
|
+
'.netrc',
|
|
31
|
+
'.pypirc',
|
|
32
|
+
'.docker',
|
|
33
|
+
'.dev.vars',
|
|
34
|
+
'credentials',
|
|
35
|
+
'credentials.json',
|
|
36
|
+
'service-account.json',
|
|
37
|
+
'id_rsa',
|
|
38
|
+
'id_ed25519',
|
|
39
|
+
'proc',
|
|
40
|
+
'sys',
|
|
41
|
+
]);
|
|
42
|
+
/** Exclude dependencies and credential-bearing paths at every depth. */
|
|
43
|
+
export function excludedSourcePath(name) {
|
|
44
|
+
return name.split('/').some(part => {
|
|
45
|
+
const lower = part.toLowerCase();
|
|
46
|
+
return (excludedNames.has(lower) ||
|
|
47
|
+
lower.startsWith('.env') ||
|
|
48
|
+
lower.startsWith('.dev.vars.') ||
|
|
49
|
+
/\.(pem|key|p12|pfx|log|pyc)$/.test(lower));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/** Reject traversal and ambiguous archive paths rather than silently rewriting names. */
|
|
53
|
+
export function validateSourcePath(name) {
|
|
54
|
+
if (!name ||
|
|
55
|
+
Buffer.byteLength(name) > 1024 ||
|
|
56
|
+
/[\\:\x00-\x1f\x7f]/.test(name) ||
|
|
57
|
+
name
|
|
58
|
+
.split('/')
|
|
59
|
+
.some(part => !part || part === '.' || part === '..' || /[. ]$/.test(part))) {
|
|
60
|
+
throw new Error(`Unsafe source path: ${JSON.stringify(name)}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async function collectSource(root, limits) {
|
|
64
|
+
const entries = [];
|
|
65
|
+
const paths = new Set();
|
|
66
|
+
let expanded = 0;
|
|
67
|
+
let visited = 0;
|
|
68
|
+
const configPath = path.resolve(getConfigPath());
|
|
69
|
+
async function walk(directory, prefix) {
|
|
70
|
+
if ((await promises.realpath(directory)) !== directory) {
|
|
71
|
+
throw new Error(`Source directory changed or is symlinked: ${directory}`);
|
|
72
|
+
}
|
|
73
|
+
const iterator = await promises.opendir(directory);
|
|
74
|
+
for await (const entry of iterator) {
|
|
75
|
+
const filename = path.join(directory, entry.name);
|
|
76
|
+
const name = prefix + entry.name;
|
|
77
|
+
const stat = await promises.lstat(filename);
|
|
78
|
+
if (stat.isSymbolicLink()) {
|
|
79
|
+
throw new Error(`Symlink source entry is not allowed: ${name}`);
|
|
80
|
+
}
|
|
81
|
+
if (filename === configPath)
|
|
82
|
+
continue;
|
|
83
|
+
if (excludedSourcePath(name))
|
|
84
|
+
continue;
|
|
85
|
+
validateSourcePath(name);
|
|
86
|
+
if (++visited > limits.entries) {
|
|
87
|
+
throw new Error(`Source exceeds ${limits.entries} entries`);
|
|
88
|
+
}
|
|
89
|
+
const key = name.normalize('NFC').toLowerCase();
|
|
90
|
+
if (paths.has(key))
|
|
91
|
+
throw new Error(`Source path collision: ${name}`);
|
|
92
|
+
paths.add(key);
|
|
93
|
+
if (stat.isDirectory()) {
|
|
94
|
+
await walk(filename, name + '/');
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (!stat.isFile())
|
|
98
|
+
throw new Error(`Non-regular source entry: ${name}`);
|
|
99
|
+
expanded += stat.size;
|
|
100
|
+
if (expanded > limits.expanded) {
|
|
101
|
+
throw new Error(`Source exceeds ${limits.expanded} expanded bytes`);
|
|
102
|
+
}
|
|
103
|
+
entries.push({ filename, name, stat });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
await walk(root, '');
|
|
107
|
+
if (!entries.length) {
|
|
108
|
+
throw new Error('No source files remain after exclusions');
|
|
109
|
+
}
|
|
110
|
+
return entries;
|
|
111
|
+
}
|
|
112
|
+
async function openSnapshotEntry(entry) {
|
|
113
|
+
if ((await promises.realpath(path.dirname(entry.filename))) !==
|
|
114
|
+
path.dirname(entry.filename)) {
|
|
115
|
+
throw new Error(`Source directory changed: ${entry.name}`);
|
|
116
|
+
}
|
|
117
|
+
const handle = await promises.open(entry.filename, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW);
|
|
118
|
+
try {
|
|
119
|
+
const stat = await handle.stat();
|
|
120
|
+
if (!stat.isFile() ||
|
|
121
|
+
stat.ino !== entry.stat.ino ||
|
|
122
|
+
stat.dev !== entry.stat.dev ||
|
|
123
|
+
stat.size !== entry.stat.size ||
|
|
124
|
+
stat.mtimeMs !== entry.stat.mtimeMs) {
|
|
125
|
+
throw new Error(`Source changed while packaging: ${entry.name}. Run again after edits finish.`);
|
|
126
|
+
}
|
|
127
|
+
return handle.createReadStream();
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
await handle.close();
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/** Stream source into a private bounded ZIP snapshot; never run shell archive tools. */
|
|
135
|
+
export async function packageLocalSource(source, limits = SOURCE_LIMITS) {
|
|
136
|
+
const requested = path.resolve(source);
|
|
137
|
+
const stat = await promises.lstat(requested);
|
|
138
|
+
if (stat.isSymbolicLink() || !stat.isDirectory()) {
|
|
139
|
+
throw new Error('Source must be a real directory, not a symlink');
|
|
140
|
+
}
|
|
141
|
+
const entries = await collectSource(await promises.realpath(requested), limits);
|
|
142
|
+
const temporary = await promises.mkdtemp(path.join(os.tmpdir(), 'gsk-source-'));
|
|
143
|
+
const filename = path.join(temporary, 'source.zip');
|
|
144
|
+
const cleanup = () => promises.rm(temporary, { recursive: true, force: true });
|
|
145
|
+
const zip = new ZipFile();
|
|
146
|
+
const active = new Set();
|
|
147
|
+
const hash = createHash('sha256');
|
|
148
|
+
let compressed = 0;
|
|
149
|
+
let expanded = 0;
|
|
150
|
+
let failed = false;
|
|
151
|
+
const meter = new Transform({
|
|
152
|
+
transform(chunk, _encoding, callback) {
|
|
153
|
+
compressed += chunk.length;
|
|
154
|
+
if (compressed > limits.compressed) {
|
|
155
|
+
callback(new Error(`Source ZIP exceeds ${limits.compressed} compressed bytes`));
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
hash.update(chunk);
|
|
159
|
+
callback(null, chunk);
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
zip.on('error', (error) => meter.destroy(error));
|
|
163
|
+
try {
|
|
164
|
+
for (const entry of entries) {
|
|
165
|
+
zip.addReadStreamLazy(entry.name, { size: entry.stat.size, mode: 0o100644, mtime: entry.stat.mtime }, callback => {
|
|
166
|
+
void openSnapshotEntry(entry)
|
|
167
|
+
.then(stream => {
|
|
168
|
+
if (failed) {
|
|
169
|
+
stream.destroy();
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
active.add(stream);
|
|
173
|
+
stream.once('close', () => active.delete(stream));
|
|
174
|
+
stream.on('data', (chunk) => {
|
|
175
|
+
expanded += Buffer.byteLength(chunk);
|
|
176
|
+
if (expanded > limits.expanded) {
|
|
177
|
+
stream.destroy(new Error(`Source exceeds ${limits.expanded} expanded bytes`));
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
callback(null, stream);
|
|
181
|
+
})
|
|
182
|
+
.catch((error) => meter.destroy(error instanceof Error ? error : new Error(String(error))));
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
zip.end();
|
|
186
|
+
await pipeline(zip.outputStream, meter, fs.createWriteStream(filename, { flags: 'wx', mode: 0o600 }));
|
|
187
|
+
return {
|
|
188
|
+
filename,
|
|
189
|
+
sha256: hash.digest('hex'),
|
|
190
|
+
size_bytes: compressed,
|
|
191
|
+
expanded_bytes: expanded,
|
|
192
|
+
file_count: entries.length,
|
|
193
|
+
cleanup,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
failed = true;
|
|
198
|
+
for (const stream of active)
|
|
199
|
+
stream.destroy();
|
|
200
|
+
await cleanup();
|
|
201
|
+
throw error;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=local-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-source.js","sourceRoot":"","sources":["../src/local-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;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f,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface ProjectBinding {
|
|
2
|
+
version: 1;
|
|
3
|
+
project_id: string;
|
|
4
|
+
kind: string;
|
|
5
|
+
base_url: string;
|
|
6
|
+
}
|
|
7
|
+
export interface LocatedBinding {
|
|
8
|
+
root: string;
|
|
9
|
+
binding: ProjectBinding;
|
|
10
|
+
}
|
|
11
|
+
/** Canonicalize a server address without allowing embedded credentials. */
|
|
12
|
+
export declare function bindingBaseUrl(value: string): string;
|
|
13
|
+
/** Validate persisted data strictly; a binding never contains credentials. */
|
|
14
|
+
export declare function parseBinding(value: unknown): ProjectBinding;
|
|
15
|
+
/** Find the nearest binding, rejecting malformed or symlinked local state. */
|
|
16
|
+
export declare function findProjectBinding(cwd?: string): LocatedBinding | undefined;
|
|
17
|
+
/** Resolve project selection and reject a checkout bound to another server. */
|
|
18
|
+
export declare function resolveProjectSelection(options: {
|
|
19
|
+
baseUrl: string;
|
|
20
|
+
explicit?: string;
|
|
21
|
+
environment?: string;
|
|
22
|
+
legacy?: string;
|
|
23
|
+
cwd?: string;
|
|
24
|
+
}): string | undefined;
|
|
25
|
+
/** Create private local state without following a .gsk symlink. */
|
|
26
|
+
export declare function projectStateDirectory(root: string): string;
|
|
27
|
+
/** Atomically publish a new JSON file, never overwriting a concurrent writer. */
|
|
28
|
+
export declare function writeNewProjectState(root: string, name: string, value: unknown): string;
|
|
29
|
+
/** Bind the checkout once; a different existing or inherited binding needs manual resolution. */
|
|
30
|
+
export declare function writeProjectBinding(value: ProjectBinding, cwd?: string): string;
|
|
31
|
+
//# sourceMappingURL=project-binding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-binding.d.ts","sourceRoot":"","sources":["../src/project-binding.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CAAC,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,cAAc,CAAA;CACxB;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAcpD;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAyB3D;AAkBD,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAChC,GAAG,SAAgB,GAClB,cAAc,GAAG,SAAS,CAgC5B;AAED,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,MAAM,GAAG,SAAS,CAcrB;AAED,mEAAmE;AACnE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ1D;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,MAAM,CAkBR;AAED,iGAAiG;AACjG,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,cAAc,EACrB,GAAG,SAAgB,GAClB,MAAM,CAaR"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
/** Canonicalize a server address without allowing embedded credentials. */
|
|
5
|
+
export function bindingBaseUrl(value) {
|
|
6
|
+
const url = new URL(value);
|
|
7
|
+
if (!['http:', 'https:'].includes(url.protocol) ||
|
|
8
|
+
url.username ||
|
|
9
|
+
url.password ||
|
|
10
|
+
url.search ||
|
|
11
|
+
url.hash) {
|
|
12
|
+
throw new Error('base_url must be an HTTP(S) URL without credentials, query, or fragment');
|
|
13
|
+
}
|
|
14
|
+
return url.href.replace(/\/+$/, '');
|
|
15
|
+
}
|
|
16
|
+
/** Validate persisted data strictly; a binding never contains credentials. */
|
|
17
|
+
export function parseBinding(value) {
|
|
18
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
19
|
+
throw new Error('Invalid .gsk/project.json: expected an object');
|
|
20
|
+
}
|
|
21
|
+
const fields = value; // narrowed JSON object
|
|
22
|
+
if (Object.keys(fields).sort().join(',') !==
|
|
23
|
+
'base_url,kind,project_id,version' ||
|
|
24
|
+
fields.version !== 1 ||
|
|
25
|
+
typeof fields.project_id !== 'string' ||
|
|
26
|
+
!/^[A-Za-z0-9_-]{1,200}$/.test(fields.project_id) ||
|
|
27
|
+
typeof fields.kind !== 'string' ||
|
|
28
|
+
!/^[a-z][a-z0-9_-]{0,63}$/.test(fields.kind) ||
|
|
29
|
+
typeof fields.base_url !== 'string') {
|
|
30
|
+
throw new Error('Invalid .gsk/project.json: only version=1, project_id, kind, base_url are allowed');
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
version: 1,
|
|
34
|
+
project_id: fields.project_id,
|
|
35
|
+
kind: fields.kind,
|
|
36
|
+
base_url: bindingBaseUrl(fields.base_url),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function lstatOptional(target) {
|
|
40
|
+
try {
|
|
41
|
+
return fs.lstatSync(target);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (error &&
|
|
45
|
+
typeof error === 'object' &&
|
|
46
|
+
'code' in error &&
|
|
47
|
+
error.code === 'ENOENT') {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Find the nearest binding, rejecting malformed or symlinked local state. */
|
|
54
|
+
export function findProjectBinding(cwd = process.cwd()) {
|
|
55
|
+
let root = fs.realpathSync(cwd);
|
|
56
|
+
while (true) {
|
|
57
|
+
const directory = path.join(root, '.gsk');
|
|
58
|
+
const directoryStat = lstatOptional(directory);
|
|
59
|
+
if (directoryStat &&
|
|
60
|
+
(!directoryStat.isDirectory() || directoryStat.isSymbolicLink())) {
|
|
61
|
+
throw new Error(`Unsafe project state directory: ${directory}`);
|
|
62
|
+
}
|
|
63
|
+
const filename = path.join(directory, 'project.json');
|
|
64
|
+
const stat = lstatOptional(filename);
|
|
65
|
+
if (stat) {
|
|
66
|
+
if (!stat.isFile() || stat.isSymbolicLink() || stat.size > 4096) {
|
|
67
|
+
throw new Error(`Unsafe project binding: ${filename}`);
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
return {
|
|
71
|
+
root,
|
|
72
|
+
binding: parseBinding(JSON.parse(fs.readFileSync(filename, 'utf8'))),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
throw new Error(`Cannot read ${filename}: ${error instanceof Error ? error.message : String(error)}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const parent = path.dirname(root);
|
|
80
|
+
if (parent === root)
|
|
81
|
+
return;
|
|
82
|
+
root = parent;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** Resolve project selection and reject a checkout bound to another server. */
|
|
86
|
+
export function resolveProjectSelection(options) {
|
|
87
|
+
const located = findProjectBinding(options.cwd);
|
|
88
|
+
if (located && located.binding.base_url !== bindingBaseUrl(options.baseUrl)) {
|
|
89
|
+
throw new Error(`Project binding targets ${located.binding.base_url}, not ${options.baseUrl}. ` +
|
|
90
|
+
'Select the matching --base-url or use a different checkout before cloud operations.');
|
|
91
|
+
}
|
|
92
|
+
return (options.explicit ||
|
|
93
|
+
options.environment ||
|
|
94
|
+
located?.binding.project_id ||
|
|
95
|
+
options.legacy);
|
|
96
|
+
}
|
|
97
|
+
/** Create private local state without following a .gsk symlink. */
|
|
98
|
+
export function projectStateDirectory(root) {
|
|
99
|
+
const directory = path.join(fs.realpathSync(root), '.gsk');
|
|
100
|
+
fs.mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
101
|
+
const stat = fs.lstatSync(directory);
|
|
102
|
+
if (!stat.isDirectory() || stat.isSymbolicLink()) {
|
|
103
|
+
throw new Error(`Unsafe state directory: ${directory}`);
|
|
104
|
+
}
|
|
105
|
+
return directory;
|
|
106
|
+
}
|
|
107
|
+
/** Atomically publish a new JSON file, never overwriting a concurrent writer. */
|
|
108
|
+
export function writeNewProjectState(root, name, value) {
|
|
109
|
+
if (!/^[a-z0-9.-]+\.json$/.test(name)) {
|
|
110
|
+
throw new Error('Invalid project state filename');
|
|
111
|
+
}
|
|
112
|
+
const directory = projectStateDirectory(root);
|
|
113
|
+
const target = path.join(directory, name);
|
|
114
|
+
const temporary = path.join(directory, `.${randomUUID()}.tmp`);
|
|
115
|
+
const descriptor = fs.openSync(temporary, 'wx', 0o600);
|
|
116
|
+
try {
|
|
117
|
+
fs.writeFileSync(descriptor, JSON.stringify(value, null, 2) + '\n');
|
|
118
|
+
fs.fsyncSync(descriptor);
|
|
119
|
+
// link is atomic create-if-absent; rename would overwrite a concurrent bind.
|
|
120
|
+
fs.linkSync(temporary, target);
|
|
121
|
+
}
|
|
122
|
+
finally {
|
|
123
|
+
fs.closeSync(descriptor);
|
|
124
|
+
fs.unlinkSync(temporary);
|
|
125
|
+
}
|
|
126
|
+
return target;
|
|
127
|
+
}
|
|
128
|
+
/** Bind the checkout once; a different existing or inherited binding needs manual resolution. */
|
|
129
|
+
export function writeProjectBinding(value, cwd = process.cwd()) {
|
|
130
|
+
const binding = parseBinding(value);
|
|
131
|
+
const existing = findProjectBinding(cwd);
|
|
132
|
+
if (existing) {
|
|
133
|
+
if (JSON.stringify(existing.binding) === JSON.stringify(binding)) {
|
|
134
|
+
return path.join(existing.root, '.gsk', 'project.json');
|
|
135
|
+
}
|
|
136
|
+
throw new Error(`Checkout already bound to ${existing.binding.project_id} at ${existing.root}. ` +
|
|
137
|
+
'Use a different checkout or explicitly remove the old binding before binding another project.');
|
|
138
|
+
}
|
|
139
|
+
return writeNewProjectState(cwd, 'project.json', binding);
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=project-binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-binding.js","sourceRoot":"","sources":["../src/project-binding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAcxC,2EAA2E;AAC3E,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;IAC1B,IACE,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC3C,GAAG,CAAC,QAAQ;QACZ,GAAG,CAAC,QAAQ;QACZ,GAAG,CAAC,MAAM;QACV,GAAG,CAAC,IAAI,EACR,CAAC;QACD,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AACrC,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;IAClE,CAAC;IACD,MAAM,MAAM,GAAG,KAAgC,CAAA,CAAC,uBAAuB;IACvE,IACE,MAAM,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,CAAC,IAAI,IAAI;YAC9E,+FAA+F,CAClG,CAAA;IACH,CAAC;IACD,OAAO,oBAAoB,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;AAC3D,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ export interface ApiResponse<T = unknown> {
|
|
|
23
23
|
data: T | null;
|
|
24
24
|
session_state?: Record<string, unknown> | null;
|
|
25
25
|
http_status?: number;
|
|
26
|
+
error_code?: string;
|
|
27
|
+
retry_after?: number;
|
|
28
|
+
instruction_for_agent?: string;
|
|
26
29
|
}
|
|
27
30
|
export interface ToolParameter {
|
|
28
31
|
type: string | string[];
|
|
@@ -104,4 +107,15 @@ export interface FileDownloadResponse {
|
|
|
104
107
|
content_type?: string;
|
|
105
108
|
original_url: string;
|
|
106
109
|
}
|
|
110
|
+
export interface CodeSkillFile {
|
|
111
|
+
path: string;
|
|
112
|
+
content: string;
|
|
113
|
+
}
|
|
114
|
+
export interface CodeSkill {
|
|
115
|
+
name: string;
|
|
116
|
+
files: CodeSkillFile[];
|
|
117
|
+
}
|
|
118
|
+
export interface GensparkCodeSkillsResponse {
|
|
119
|
+
skills: CodeSkill[];
|
|
120
|
+
}
|
|
107
121
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,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AE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,aAAa,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,SAAS,EAAE,CAAA;CACpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genspark/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "CLI tool for Genspark Tool API - search, crawl, analyze images, generate media",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -52,11 +52,13 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"commander": "^12.1.0",
|
|
55
|
-
"ws": "^8.20.1"
|
|
55
|
+
"ws": "^8.20.1",
|
|
56
|
+
"yazl": "^3.3.1"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@types/node": "^20.11.0",
|
|
59
60
|
"@types/ws": "^8.18.1",
|
|
61
|
+
"@types/yazl": "^3.3.0",
|
|
60
62
|
"typescript": "^5.3.3"
|
|
61
63
|
},
|
|
62
64
|
"engines": {
|
|
@@ -13,7 +13,9 @@ description: 'AI-Drive file storage and management, plus the generic web downloa
|
|
|
13
13
|
LinkNode row returns `link_workspace_id`; reuse it as `--source` to mount the live
|
|
14
14
|
source entry. `download <ai-drive-path> [local-path]` copies a drive file OUT to
|
|
15
15
|
local disk (the path may be spelled `aidrive://...`); `download_file --file_url
|
|
16
|
-
<url>` goes the opposite direction, saving an external URL INTO the drive.
|
|
16
|
+
<url>` goes the opposite direction, saving an external URL INTO the drive. share
|
|
17
|
+
/ access / link replies carry `url`, the entry''s share link — hand that to the
|
|
18
|
+
user; `readable_url` is a one-hour bytes URL for tools.'
|
|
17
19
|
metadata:
|
|
18
20
|
category: general
|
|
19
21
|
requires:
|
|
@@ -26,7 +28,9 @@ metadata:
|
|
|
26
28
|
|
|
27
29
|
**PREREQUISITE:** Read `../gsk-shared/SKILL.md` for auth, global flags, and security rules.
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
**THEN READ:** `../gsk-second-brain/SKILL.md` — it says what this command is part of and when to reach for it. This file keeps the flags.
|
|
32
|
+
|
|
33
|
+
AI-Drive file storage and management, plus the generic web downloader: download_video / download_audio / download_file fetch a URL (YouTube, social media, direct file links) server-side into the drive and return a download link. Canonical actions: ls, find, mkdir, rm, move, get_readable_url, download, download_video, download_audio, download_file, compress, decompress, share, unshare, access, link, unlink, upload, list_trash, restore. `rm` moves native entries to recoverable trash and unlinks delegated aliases without touching their source. `ls` reads one directory; use indexed `find` to locate names across the drive. `shared_with_me` is a view across source containers; ls it first and reuse a returned `source_id`. A delegated LinkNode row returns `link_workspace_id`; reuse it as `--source` to mount the live source entry. `download <ai-drive-path> [local-path]` copies a drive file OUT to local disk (the path may be spelled `aidrive://...`); `download_file --file_url <url>` goes the opposite direction, saving an external URL INTO the drive. share / access / link replies carry `url`, the entry's share link — hand that to the user; `readable_url` is a one-hour bytes URL for tools.
|
|
30
34
|
|
|
31
35
|
## Usage
|
|
32
36
|
|
|
@@ -36,20 +40,13 @@ gsk drive [options]
|
|
|
36
40
|
|
|
37
41
|
**Aliases:** `drive`
|
|
38
42
|
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
GenTeam channel and DM drives are flat native containers. `mkdir`, directory
|
|
42
|
-
upload, and moving/restoring native entries into subfolders are rejected with
|
|
43
|
-
`GENTEAM_DRIVE_FLAT_LAYOUT`, including calls using an ID or browser URL. Admin
|
|
44
|
-
access does not override this layout. Channel members with content-edit access
|
|
45
|
-
can upload files at the root; moving, renaming, or deleting native files requires
|
|
46
|
-
conversation administrator access. Removing a shared alias uses its existing
|
|
47
|
-
sharing authorization and never removes its source.
|
|
43
|
+
## What this command reaches
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
`gsk drive` opens the **Drive** half of the user's Second Brain — My Drive,
|
|
46
|
+
Team Drive, and the Shared-with-me view. What lives where, how to address an
|
|
47
|
+
entry, how GenTeam channel drives differ (flat layout, root-only uploads),
|
|
48
|
+
how shortcuts resolve, and which link to hand a person are all in
|
|
49
|
+
`../gsk-second-brain/SKILL.md`; read it first. This file keeps the flags.
|
|
53
50
|
|
|
54
51
|
## Flags
|
|
55
52
|
|
|
@@ -98,6 +95,13 @@ and removed for recovery, but cannot receive new files or be restored.
|
|
|
98
95
|
- Upload a file or directory with `gsk drive upload --local_file <local-path> --upload_path /destination` (add `--override` to replace existing files). For shared locations, also pass `--workspace shared_with_me|shared_drive --source <source_id>`. The source drive owns the uploaded bytes and quota.
|
|
99
96
|
- Download to this machine with `gsk drive download <drive-path> [local-path]`; this is distinct from `download_file`, which saves an external URL into Drive.
|
|
100
97
|
|
|
98
|
+
## Which link to hand the user
|
|
99
|
+
|
|
100
|
+
- `share`, `access`, and `link` replies carry `url`: the entry's share link (`/aidrive/s/<drive>/<entry>`, or `/second-brain/s/…` where the Second Brain drive is rolled out). It carries no access of its own — the server decides per visitor — so paste THAT into chat, email, or a card.
|
|
101
|
+
- `upload`, `download_*`, `compress`, and `decompress` replies carry a browse-location link to the folder in the user's own drive.
|
|
102
|
+
- `ls`/`find` rows for shared shortcuts show their open link in the Type cell (`link:file → <url>`).
|
|
103
|
+
- `get_readable_url` is a one-hour bytes URL for tools (`curl`, media analysis). Never hand it to a person as "the link": it expires, and it opens for whoever holds it.
|
|
104
|
+
|
|
101
105
|
## YouTube Downloads
|
|
102
106
|
|
|
103
107
|
`download_video` / `download_audio` with a YouTube URL bill 1 credit per MB of the delivered file (min 1 credit); requests estimated over 1 GB are rejected up front. Time-range clipping is not supported for YouTube — provider clip downloads are broken, so download the full video and trim it locally.
|
|
@@ -30,7 +30,7 @@ gsk audio [options]
|
|
|
30
30
|
| Flag | Required | Description |
|
|
31
31
|
|------|----------|-------------|
|
|
32
32
|
| `<prompt>` (positional) | No | What to generate: narration text for TTS (model-specific format — see the model's prompting guide), or a description for music / sound effects. For voice-clone models this text is narrated with the cloned voice. (string) |
|
|
33
|
-
| `-m`, `--model` | No | Model id. Query get_model_info with it before generating. (string, one of: CassetteAI/music-generator, alibaba/qwen-audio-3-tts, bytedance/seed-audio-1.0, elevenlabs/music, elevenlabs/sound-effects, elevenlabs/v3-tts, elevenlabs/voice-changer, elevenlabs/voice-clone, fal-ai/elevenlabs/sound-effects, fal-ai/elevenlabs/tts/multilingual-v2, fal-ai/minimax/speech-2.8-hd, fal-ai/minimax/voice-clone, fal-ai/vibevoice/7b, google/gemini-3.1-flash-tts-preview, google/lyria-music, minimax/music-3.0, mureka
|
|
33
|
+
| `-m`, `--model` | No | Model id. Query get_model_info with it before generating. (string, one of: CassetteAI/music-generator, alibaba/qwen-audio-3-tts, bytedance/seed-audio-1.0, elevenlabs/music, elevenlabs/sound-effects, elevenlabs/v3-tts, elevenlabs/voice-changer, elevenlabs/voice-clone, fal-ai/elevenlabs/sound-effects, fal-ai/elevenlabs/tts/multilingual-v2, fal-ai/minimax/speech-2.8-hd, fal-ai/minimax/voice-clone, fal-ai/vibevoice/7b, google/gemini-3.1-flash-tts-preview, google/lyria-music, minimax/music-3.0, mureka, nova-sr) |
|
|
34
34
|
| `-p`, `--params` | No | Model-specific parameters (speakers, speed/pitch/volume, duration, voice_files, lyrics, composition_plan, output_format, ...). MUST follow the `params_schema` that get_model_info returns for the chosen model. (object) |
|
|
35
35
|
| `-f`, `--file_name` | No | Name for the generated audio. (string, default: `audio`) |
|
|
36
36
|
| `--audio_type` | No | (string, one of: speech, music, sound_effect, default: `speech`) |
|
|
@@ -30,7 +30,7 @@ gsk claw share_link [options]
|
|
|
30
30
|
| Flag | Required | Description |
|
|
31
31
|
|------|----------|-------------|
|
|
32
32
|
| `-n`, `--vm_name` | Yes | Name of the VM that hosts the file. (string) |
|
|
33
|
-
| `<path>` (positional) | Yes | Absolute file path on the VM (e.g. /home/
|
|
33
|
+
| `<path>` (positional) | Yes | Absolute file path on the VM under /home/work or /tmp (e.g. /home/work/.openclaw/workspace/report.pdf). Hidden files and paths outside those roots cannot be shared. (string) |
|
|
34
34
|
| `-e`, `--expires_minutes` | No | Link validity in minutes, 1–1440. Default 10. (integer) |
|
|
35
35
|
| `-p`, `--password` | No | Optional password to protect the share link. Recipients must enter this password to view the file. Must be at least 8 characters with letters, digits, and special characters (e.g. 'xK9#mP2q'). Do NOT use simple dictionary words. (string) |
|
|
36
36
|
|
|
@@ -34,7 +34,8 @@ gsk google_calendar [options]
|
|
|
34
34
|
| `--time_min` | No | [list] Optional. Start time of the search range (RFC3339 timestamp) (string) |
|
|
35
35
|
| `--time_max` | No | [list] Optional. End time of the search range (RFC3339 timestamp) (string) |
|
|
36
36
|
| `--from_account` | No | [list] Optional: Email address of the Gmail account to use. Use this when the user has multiple Gmail accounts connected. If not specified, uses the default Gmail account. \| [create] Optional: Email address of the Gmail account to use. Use this when the user has multiple Gmail accounts connected. If not specified, uses the default Gmail account. \| [respond] Optional: Email address of the Gmail account to use. Defaults to the user's primary Gmail account. \| [modify] Optional: Email address of the Gmail account to use. \| [delete] Optional: Email address of the Gmail account to use. Use this when the user has multiple Gmail accounts connected. If not specified, uses the default Gmail account. (string) |
|
|
37
|
-
| `--
|
|
37
|
+
| `--full_description` | No | [list] Return complete readable descriptions instead of 500-character previews. Defaults to false. When true, limit defaults to 5 and must be at most 5; narrow filter_query and time_min/time_max to the desired event. (boolean, default: `False`) |
|
|
38
|
+
| `--limit` | No | [list] Optional. Maximum number of events to return. Defaults to 20 (5 with full_description=true). (integer) |
|
|
38
39
|
| `--start_time` | No | [free_busy] Window start, RFC3339 (e.g. '2026-07-20T09:00:00+08:00' or '2026-07-20T01:00:00Z'). \| [create] Start time of the event in ISO 8601 format, must include correct timezone offset (e.g., 'yyyy-mm-ddThh:mm:ss+hh:mm') \| [modify] New start time (ISO 8601 with timezone offset, e.g. '2026-05-20T10:00:00-07:00'). Pass with --end_time when rescheduling. (string) |
|
|
39
40
|
| `--end_time` | No | [free_busy] Window end, RFC3339. \| [create] End time of the event in ISO 8601 format, must include correct timezone offset (e.g., 'yyyy-mm-ddThh:mm:ss-hh:mm') \| [modify] New end time (ISO 8601 with timezone offset). Required if start_time is given. (string) |
|
|
40
41
|
| `--calendars` | No | [free_busy] Calendar IDs to check — 'primary' or email addresses. Default: ['primary']. (array) |
|
|
@@ -34,7 +34,8 @@ gsk outlook_calendar [options]
|
|
|
34
34
|
| `--time_min` | No | [list] Optional. Start time for the calendar view (ISO 8601 timestamp). Defaults to 30 days ago. (string) |
|
|
35
35
|
| `--time_max` | No | [list] Optional. End time for the calendar view (ISO 8601 timestamp). Defaults to 60 days from now. (string) |
|
|
36
36
|
| `--from_account` | No | [list] Optional: Email address of the Outlook account to use. Use this when the user has multiple Outlook accounts connected. If not specified, uses the default Outlook account. \| [create] Optional: Email address of the Outlook account to use. Use this when the user has multiple Outlook accounts connected. If not specified, uses the default Outlook account. \| [respond] Optional: Email address of the Outlook account to use. Defaults to the user's primary Outlook account. \| [modify] Optional: Email address of the Outlook account to use. \| [delete] Optional: Email address of the Outlook account to use. Use this when the user has multiple Outlook accounts connected. If not specified, uses the default Outlook account. (string) |
|
|
37
|
-
| `--
|
|
37
|
+
| `--full_description` | No | [list] Return complete readable descriptions instead of 500-character previews. Defaults to false. When true, limit defaults to 5 and must be at most 5; narrow filter_query and time_min/time_max to the desired event. (boolean, default: `False`) |
|
|
38
|
+
| `--limit` | No | [list] Optional. Maximum number of events to return. Defaults to 20 (5 with full_description=true). (integer) |
|
|
38
39
|
| `--start_time` | No | [free_busy] Window start, ISO 8601 date-time WITHOUT offset (e.g. '2026-07-20T09:00:00') — interpreted in 'timezone'. \| [create] Start time of the event in ISO 8601 format, must include correct timezone offset (e.g., 'yyyy-mm-ddThh:mm:ss+hh:mm') \| [modify] New start time (ISO 8601 with timezone offset). Pass with --end_time when rescheduling. (string) |
|
|
39
40
|
| `--end_time` | No | [free_busy] Window end, ISO 8601 (same rule). \| [create] End time of the event in ISO 8601 format, must include correct timezone offset (e.g., 'yyyy-mm-ddThh:mm:ss-hh:mm') \| [modify] New end time (ISO 8601 with timezone offset). Required if start_time is given. (string) |
|
|
40
41
|
| `--schedules` | No | [free_busy] Email addresses to check. Default: the signed-in user's own address. (array) |
|