gipity 1.1.27 → 1.1.29
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 +6 -2
- package/dist/api.js +3 -1
- package/dist/commands/account.js +80 -0
- package/dist/commands/ask.js +20 -3
- package/dist/commands/db.js +12 -1
- package/dist/commands/generate-async.js +262 -0
- package/dist/commands/generate.js +110 -8
- package/dist/commands/page-inspect.js +6 -6
- package/dist/commands/project-auth.js +221 -0
- package/dist/commands/project-users.js +130 -0
- package/dist/commands/project.js +4 -60
- package/dist/commands/records.js +7 -7
- package/dist/commands/sandbox.js +13 -2
- package/dist/commands/skill.js +23 -12
- package/dist/commands/workflow.js +16 -6
- package/dist/index.js +862 -222
- package/dist/knowledge.js +7 -5
- package/dist/provider-docs.js +2 -1
- package/dist/sync.js +48 -0
- package/dist/template-vars.js +0 -5
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
|
-
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
3
|
-
import { join } from 'path';
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
3
|
+
import { isAbsolute, join, resolve } from 'path';
|
|
4
4
|
import { get, post, put, del } from '../api.js';
|
|
5
5
|
import { getConfig, requireConfig, getProjectRoot } from '../config.js';
|
|
6
6
|
import { pushFile } from '../sync.js';
|
|
@@ -312,10 +312,20 @@ steps:
|
|
|
312
312
|
then return { summary, needs_attention } where needs_attention is a list of short strings.
|
|
313
313
|
tools: [memory, db_query]
|
|
314
314
|
`;
|
|
315
|
+
/** Read a workflow YAML from disk: an absolute path, a path from the cwd, or
|
|
316
|
+
* a project-relative one. The text is sent to the server, so the file need not
|
|
317
|
+
* be synced (a probe in tmp/ works). */
|
|
318
|
+
function readWorkflowYaml(from) {
|
|
319
|
+
const candidates = isAbsolute(from) ? [from] : [resolve(from), ...(getProjectRoot() ? [join(getProjectRoot(), from)] : [])];
|
|
320
|
+
const found = candidates.find((p) => existsSync(p));
|
|
321
|
+
if (!found)
|
|
322
|
+
throw new Error(`No workflow file at ${from}.`);
|
|
323
|
+
return readFileSync(found, 'utf-8');
|
|
324
|
+
}
|
|
315
325
|
workflowCommand
|
|
316
326
|
.command('create')
|
|
317
327
|
.description('Create a workflow from a YAML file in the project (e.g. workflows/foo.yaml)')
|
|
318
|
-
.option('--from <path>', '
|
|
328
|
+
.option('--from <path>', 'Workflow YAML file (any local path, e.g. workflows/foo.yaml)')
|
|
319
329
|
.option('--heartbeat', `Scaffold ${HEARTBEAT_PATH} (a daily check-in that keeps notes in project memory) and create it`)
|
|
320
330
|
.option('--name <name>', 'Override the name in the YAML')
|
|
321
331
|
.option('--json', 'Output as JSON')
|
|
@@ -339,7 +349,7 @@ workflowCommand
|
|
|
339
349
|
await pushFile(local);
|
|
340
350
|
}
|
|
341
351
|
const body = {
|
|
342
|
-
|
|
352
|
+
config_yaml: readWorkflowYaml(from),
|
|
343
353
|
project_guid: config.projectGuid,
|
|
344
354
|
};
|
|
345
355
|
if (opts.name)
|
|
@@ -352,14 +362,14 @@ workflowCommand
|
|
|
352
362
|
.command('edit <name>')
|
|
353
363
|
.alias('update')
|
|
354
364
|
.description('Update a workflow from a YAML file')
|
|
355
|
-
.requiredOption('--from <path>', '
|
|
365
|
+
.requiredOption('--from <path>', 'Workflow YAML file (any local path, e.g. workflows/foo.yaml)')
|
|
356
366
|
.option('--json', 'Output as JSON')
|
|
357
367
|
.action((name, _opts, cmd) => run('Edit', async () => {
|
|
358
368
|
const opts = mergedOpts(cmd);
|
|
359
369
|
const config = requireConfig();
|
|
360
370
|
const wf = await resolveWorkflow(name);
|
|
361
371
|
await put(`/workflows/${wf.short_guid}`, {
|
|
362
|
-
|
|
372
|
+
config_yaml: readWorkflowYaml(opts.from),
|
|
363
373
|
project_guid: config.projectGuid,
|
|
364
374
|
});
|
|
365
375
|
printResult(`Updated "${wf.name}" from ${opts.from}.`, opts, { updated: wf.name });
|