@sente-labs/cli 0.11.0 → 0.14.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 +73 -46
- package/dist/client.js +12 -3
- package/dist/client.js.map +1 -1
- package/dist/commands/inbox.js +30 -4
- package/dist/commands/inbox.js.map +1 -1
- package/dist/commands/registration.js +211 -0
- package/dist/commands/registration.js.map +1 -0
- package/dist/config.js +0 -27
- package/dist/config.js.map +1 -1
- package/dist/index.js +5 -27
- package/dist/index.js.map +1 -1
- package/dist/{skill/autoupdate.js → update.js} +10 -47
- package/dist/update.js.map +1 -0
- package/package.json +3 -3
- package/dist/commands/appGraph.js +0 -110
- package/dist/commands/appGraph.js.map +0 -1
- package/dist/commands/auth.js +0 -54
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/deployWebhook.js +0 -94
- package/dist/commands/deployWebhook.js.map +0 -1
- package/dist/commands/init.js +0 -209
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/project.js +0 -283
- package/dist/commands/project.js.map +0 -1
- package/dist/commands/schedule.js +0 -188
- package/dist/commands/schedule.js.map +0 -1
- package/dist/commands/secret.js +0 -245
- package/dist/commands/secret.js.map +0 -1
- package/dist/commands/task.js +0 -425
- package/dist/commands/task.js.map +0 -1
- package/dist/commands/workflow.js +0 -69
- package/dist/commands/workflow.js.map +0 -1
- package/dist/skill/SKILL.md +0 -93
- package/dist/skill/autoupdate.js.map +0 -1
- package/dist/skill/template.js +0 -68
- package/dist/skill/template.js.map +0 -1
package/dist/commands/init.js
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.registerInitCommand = registerInitCommand;
|
|
37
|
-
exports.registerInstallSkillCommand = registerInstallSkillCommand;
|
|
38
|
-
const fs = __importStar(require("fs"));
|
|
39
|
-
const os = __importStar(require("os"));
|
|
40
|
-
const path = __importStar(require("path"));
|
|
41
|
-
const readline = __importStar(require("readline"));
|
|
42
|
-
const child_process_1 = require("child_process");
|
|
43
|
-
const client_1 = require("../client");
|
|
44
|
-
const credentials_1 = require("../credentials");
|
|
45
|
-
const login_1 = require("./login");
|
|
46
|
-
const output_1 = require("../output");
|
|
47
|
-
const template_1 = require("../skill/template");
|
|
48
|
-
const GITIGNORE_BLOCK_MARKER = '# Sente CLI -- per-developer state';
|
|
49
|
-
const LAST_CHECKED_LINE = '.sente/last-checked.json';
|
|
50
|
-
function registerInitCommand(program, globalOpts) {
|
|
51
|
-
program
|
|
52
|
-
.command('init')
|
|
53
|
-
.description('Create a Sente project for this repo and install the Claude Code skill')
|
|
54
|
-
.option('--name <name>', 'Project name (defaults to the repo directory name)')
|
|
55
|
-
.option('--staging-url <url>', 'Public staging URL of the deployed app')
|
|
56
|
-
.option('--workflow <name>', 'Default workflow name', 'Smoke tests')
|
|
57
|
-
.option('--skip-skill', 'Do not install the Claude Code skill')
|
|
58
|
-
.option('--non-interactive', 'Fail rather than prompt')
|
|
59
|
-
.action(async (cmdOpts) => {
|
|
60
|
-
const opts = globalOpts();
|
|
61
|
-
try {
|
|
62
|
-
const cwd = process.cwd();
|
|
63
|
-
if (fs.existsSync(path.join(cwd, '.sente', 'config.json'))) {
|
|
64
|
-
throw new Error('A Sente project already exists in this repo (.sente/config.json found). Use `sente sync` to refresh tasks, or delete .sente/ first.');
|
|
65
|
-
}
|
|
66
|
-
// Resolve inputs. Interactive prompts only when TTY + not --non-interactive
|
|
67
|
-
// and missing values. CC always invokes with flags + --non-interactive.
|
|
68
|
-
const interactive = !cmdOpts.nonInteractive && !(0, output_1.isJson)(opts) && process.stdin.isTTY;
|
|
69
|
-
// If we have no stored credentials, run the login flow inline before
|
|
70
|
-
// asking the user for project name/URL. Otherwise a fresh user hits
|
|
71
|
-
// "Not logged in" only AFTER answering both prompts, which is bad UX.
|
|
72
|
-
if (!(0, credentials_1.loadCredentials)()) {
|
|
73
|
-
await (0, login_1.runLoginFlow)({ nonInteractive: !interactive });
|
|
74
|
-
}
|
|
75
|
-
const defaultName = deriveDefaultProjectName(cwd);
|
|
76
|
-
const projectName = cmdOpts.name ?? (interactive ? await prompt('Project name', defaultName) : defaultName);
|
|
77
|
-
const stagingUrl = cmdOpts.stagingUrl ?? (interactive ? await prompt('Staging URL (https://...)', '') : '');
|
|
78
|
-
if (!stagingUrl) {
|
|
79
|
-
throw new Error('Staging URL is required. Pass --staging-url <url>, or run interactively. Sente only runs against publicly-reachable URLs.');
|
|
80
|
-
}
|
|
81
|
-
if (!/^https?:\/\//.test(stagingUrl)) {
|
|
82
|
-
throw new Error('Staging URL must start with http:// or https://');
|
|
83
|
-
}
|
|
84
|
-
const workflowName = cmdOpts.workflow ?? 'Smoke tests';
|
|
85
|
-
const client = new client_1.GatewayClient();
|
|
86
|
-
// 1. Create the project.
|
|
87
|
-
const projectRes = await client.request('/api/projects', {
|
|
88
|
-
method: 'POST',
|
|
89
|
-
body: { name: projectName, baseUrl: stagingUrl },
|
|
90
|
-
});
|
|
91
|
-
const project = projectRes.project;
|
|
92
|
-
// 2. Create the default workflow inside the new project.
|
|
93
|
-
const workflowRes = await client.request(`/api/projects/${project.id}/workflows`, { method: 'POST', body: { name: workflowName } });
|
|
94
|
-
const workflow = workflowRes.workflow;
|
|
95
|
-
// 3. Write repo-local files. Atomic order: ensure .sente exists first.
|
|
96
|
-
const senteDir = path.join(cwd, '.sente');
|
|
97
|
-
fs.mkdirSync(senteDir, { recursive: true });
|
|
98
|
-
const config = {
|
|
99
|
-
projectId: project.id,
|
|
100
|
-
gatewayUrl: defaultGatewayBase(),
|
|
101
|
-
baseUrl: stagingUrl,
|
|
102
|
-
workflowId: workflow.id,
|
|
103
|
-
};
|
|
104
|
-
const tasks = { projectId: project.id, tasks: [] };
|
|
105
|
-
fs.writeFileSync(path.join(senteDir, 'config.json'), JSON.stringify(config, null, 2) + '\n');
|
|
106
|
-
fs.writeFileSync(path.join(senteDir, 'tasks.json'), JSON.stringify(tasks, null, 2) + '\n');
|
|
107
|
-
// 4. Add per-developer state files to .gitignore (idempotent).
|
|
108
|
-
ensureGitignoreEntry(cwd);
|
|
109
|
-
// 5. Install the Claude Code skill (unless explicitly skipped).
|
|
110
|
-
let skillPath = null;
|
|
111
|
-
if (!cmdOpts.skipSkill) {
|
|
112
|
-
skillPath = installSkill();
|
|
113
|
-
}
|
|
114
|
-
(0, output_1.printSuccess)({
|
|
115
|
-
project,
|
|
116
|
-
workflow,
|
|
117
|
-
configPath: path.join('.sente', 'config.json'),
|
|
118
|
-
tasksPath: path.join('.sente', 'tasks.json'),
|
|
119
|
-
skillPath,
|
|
120
|
-
}, () => {
|
|
121
|
-
process.stdout.write(`Created project: ${project.name} (${project.id})\n`);
|
|
122
|
-
process.stdout.write(`Created workflow: ${workflow.name} (${workflow.id})\n`);
|
|
123
|
-
process.stdout.write(`Wrote .sente/config.json and .sente/tasks.json\n`);
|
|
124
|
-
if (skillPath) {
|
|
125
|
-
process.stdout.write(`Installed Claude Code skill at ${skillPath}\n`);
|
|
126
|
-
}
|
|
127
|
-
process.stdout.write(`\nNext: open Claude Code in this repo and ask it to draft a Sente test for one of your flows.\n`);
|
|
128
|
-
}, opts);
|
|
129
|
-
}
|
|
130
|
-
catch (err) {
|
|
131
|
-
if (err instanceof client_1.ApiError && err.status === 0) {
|
|
132
|
-
// Surfaces gateway-unreachable cleanly.
|
|
133
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
134
|
-
}
|
|
135
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
function registerInstallSkillCommand(program, globalOpts) {
|
|
140
|
-
program
|
|
141
|
-
.command('install-skill')
|
|
142
|
-
.description('Install or update the Claude Code skill at ~/.claude/skills/sente/SKILL.md')
|
|
143
|
-
.action(() => {
|
|
144
|
-
const opts = globalOpts();
|
|
145
|
-
try {
|
|
146
|
-
const skillPath = installSkill();
|
|
147
|
-
(0, output_1.printSuccess)({ skillPath }, `Installed Claude Code skill at ${skillPath}`, opts);
|
|
148
|
-
}
|
|
149
|
-
catch (err) {
|
|
150
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Write the bundled SKILL.md to the standard Claude Code skill path.
|
|
156
|
-
* Returns the absolute path.
|
|
157
|
-
*/
|
|
158
|
-
function installSkill() {
|
|
159
|
-
const dest = (0, template_1.skillInstallPath)(os.homedir());
|
|
160
|
-
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
161
|
-
fs.writeFileSync(dest, template_1.SKILL_MD);
|
|
162
|
-
return dest;
|
|
163
|
-
}
|
|
164
|
-
function deriveDefaultProjectName(cwd) {
|
|
165
|
-
// Prefer the git repo's top-level directory name; fall back to cwd's basename.
|
|
166
|
-
try {
|
|
167
|
-
const top = (0, child_process_1.execSync)('git rev-parse --show-toplevel', {
|
|
168
|
-
cwd,
|
|
169
|
-
stdio: ['ignore', 'pipe', 'ignore'],
|
|
170
|
-
})
|
|
171
|
-
.toString()
|
|
172
|
-
.trim();
|
|
173
|
-
if (top)
|
|
174
|
-
return path.basename(top);
|
|
175
|
-
}
|
|
176
|
-
catch {
|
|
177
|
-
// not a git repo
|
|
178
|
-
}
|
|
179
|
-
return path.basename(cwd);
|
|
180
|
-
}
|
|
181
|
-
function defaultGatewayBase() {
|
|
182
|
-
return process.env.SENTE_GATEWAY_URL || 'https://api.sente.run';
|
|
183
|
-
}
|
|
184
|
-
function ensureGitignoreEntry(cwd) {
|
|
185
|
-
const gitignorePath = path.join(cwd, '.gitignore');
|
|
186
|
-
let existing = '';
|
|
187
|
-
try {
|
|
188
|
-
existing = fs.readFileSync(gitignorePath, 'utf8');
|
|
189
|
-
}
|
|
190
|
-
catch {
|
|
191
|
-
// file doesn't exist yet
|
|
192
|
-
}
|
|
193
|
-
if (existing.includes(LAST_CHECKED_LINE))
|
|
194
|
-
return;
|
|
195
|
-
const block = `\n${GITIGNORE_BLOCK_MARKER}\n${LAST_CHECKED_LINE}\n`;
|
|
196
|
-
// Append; do not rewrite the file structure.
|
|
197
|
-
fs.writeFileSync(gitignorePath, existing.endsWith('\n') || existing.length === 0 ? existing + block : existing + '\n' + block);
|
|
198
|
-
}
|
|
199
|
-
function prompt(question, fallback) {
|
|
200
|
-
return new Promise((resolve) => {
|
|
201
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
202
|
-
const suffix = fallback ? ` [${fallback}]` : '';
|
|
203
|
-
rl.question(`${question}${suffix}: `, (answer) => {
|
|
204
|
-
rl.close();
|
|
205
|
-
resolve(answer.trim() || fallback);
|
|
206
|
-
});
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
//# sourceMappingURL=init.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,kDA8GC;AAED,kEAiBC;AA9KD,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,mDAAqC;AACrC,iDAAyC;AAEzC,sCAAoD;AACpD,gDAAiD;AACjD,mCAAuC;AACvC,sCAAyE;AACzE,gDAA+D;AAgC/D,MAAM,sBAAsB,GAAG,oCAAoC,CAAC;AACpE,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAErD,SAAgB,mBAAmB,CAAC,OAAgB,EAAE,UAA4B;IAChF,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,wEAAwE,CAAC;SACrF,MAAM,CAAC,eAAe,EAAE,oDAAoD,CAAC;SAC7E,MAAM,CAAC,qBAAqB,EAAE,wCAAwC,CAAC;SACvE,MAAM,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,aAAa,CAAC;SACnE,MAAM,CAAC,cAAc,EAAE,sCAAsC,CAAC;SAC9D,MAAM,CAAC,mBAAmB,EAAE,yBAAyB,CAAC;SACtD,MAAM,CAAC,KAAK,EAAE,OAAoB,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;QAC1B,IAAI,CAAC;YACH,MAAM,GAAG,GAA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AAM,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,EAAE,CAAC,QAAQ,CAAC,GAAG,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE;YAC/C,EAAE,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,QAAQ,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/commands/project.js
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.registerProjectCommands = registerProjectCommands;
|
|
37
|
-
exports.registerSyncCommand = registerSyncCommand;
|
|
38
|
-
const fs = __importStar(require("fs"));
|
|
39
|
-
const path = __importStar(require("path"));
|
|
40
|
-
const client_1 = require("../client");
|
|
41
|
-
const output_1 = require("../output");
|
|
42
|
-
const workflow_1 = require("./workflow");
|
|
43
|
-
/**
|
|
44
|
-
* Read the local .sente/config.json (written by `sente init` in M4).
|
|
45
|
-
* Walks up from the cwd looking for it -- same pattern as git/node_modules.
|
|
46
|
-
*/
|
|
47
|
-
function readLocalProjectId() {
|
|
48
|
-
let dir = process.cwd();
|
|
49
|
-
while (true) {
|
|
50
|
-
const candidate = path.join(dir, '.sente', 'config.json');
|
|
51
|
-
if (fs.existsSync(candidate)) {
|
|
52
|
-
try {
|
|
53
|
-
const parsed = JSON.parse(fs.readFileSync(candidate, 'utf8'));
|
|
54
|
-
if (typeof parsed.projectId === 'string')
|
|
55
|
-
return parsed.projectId;
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const parent = path.dirname(dir);
|
|
62
|
-
if (parent === dir)
|
|
63
|
-
return null;
|
|
64
|
-
dir = parent;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function registerProjectCommands(program, globalOpts) {
|
|
68
|
-
const project = program.command('project').description('Project commands');
|
|
69
|
-
project
|
|
70
|
-
.command('list')
|
|
71
|
-
.description('List all projects in the current organization')
|
|
72
|
-
.action(async () => {
|
|
73
|
-
const opts = globalOpts();
|
|
74
|
-
try {
|
|
75
|
-
const client = new client_1.GatewayClient();
|
|
76
|
-
const res = await client.request('/api/projects');
|
|
77
|
-
(0, output_1.printSuccess)(
|
|
78
|
-
// Match the sibling list commands' --json shape (strip the envelope).
|
|
79
|
-
{ projects: res.projects }, () => {
|
|
80
|
-
if (!res.projects.length) {
|
|
81
|
-
process.stdout.write('No projects.\n');
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
for (const p of res.projects) {
|
|
85
|
-
const def = p.isDefault ? ' [default]' : '';
|
|
86
|
-
const url = p.baseUrl ? ` ${p.baseUrl}` : '';
|
|
87
|
-
process.stdout.write(`${p.id} ${p.name}${def}${url}\n`);
|
|
88
|
-
}
|
|
89
|
-
}, opts);
|
|
90
|
-
}
|
|
91
|
-
catch (err) {
|
|
92
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
project
|
|
96
|
-
.command('set')
|
|
97
|
-
.description('Update the project server-side (e.g. its staging base URL); also syncs .sente/config.json')
|
|
98
|
-
.option('--id <projectId>', 'Project id (overrides .sente/config.json)')
|
|
99
|
-
.option('--url <baseUrl>', 'New staging base URL — where runs AND `sente auth login` seeding navigate')
|
|
100
|
-
.option('--name <name>', 'New project name')
|
|
101
|
-
.action(async (cmdOpts) => {
|
|
102
|
-
const opts = globalOpts();
|
|
103
|
-
try {
|
|
104
|
-
const projectId = cmdOpts.id ?? readLocalProjectId();
|
|
105
|
-
if (!projectId) {
|
|
106
|
-
throw new Error('No project id found. Pass --id <projectId> or run `sente init` to create a .sente/config.json.');
|
|
107
|
-
}
|
|
108
|
-
const body = {};
|
|
109
|
-
if (cmdOpts.url)
|
|
110
|
-
body.baseUrl = cmdOpts.url;
|
|
111
|
-
if (cmdOpts.name)
|
|
112
|
-
body.name = cmdOpts.name;
|
|
113
|
-
if (Object.keys(body).length === 0) {
|
|
114
|
-
throw new Error('Nothing to update. Pass --url <baseUrl> and/or --name <name>.');
|
|
115
|
-
}
|
|
116
|
-
const client = new client_1.GatewayClient();
|
|
117
|
-
const res = await client.request(`/api/projects/${projectId}`, {
|
|
118
|
-
method: 'PUT',
|
|
119
|
-
body,
|
|
120
|
-
});
|
|
121
|
-
// Keep the local authoring config in sync so `.sente/config.json` never
|
|
122
|
-
// diverges from the server (the server value is what runs/seeding use).
|
|
123
|
-
const localPath = cmdOpts.url ? updateLocalConfigBaseUrl(cmdOpts.url) : null;
|
|
124
|
-
(0, output_1.printSuccess)(res.project, () => {
|
|
125
|
-
const p = res.project;
|
|
126
|
-
process.stdout.write(`Updated project ${p.name} (${p.id}).\n`);
|
|
127
|
-
if (p.baseUrl)
|
|
128
|
-
process.stdout.write(`Base URL: ${p.baseUrl}\n`);
|
|
129
|
-
if (localPath)
|
|
130
|
-
process.stdout.write(`Synced ${localPath}\n`);
|
|
131
|
-
if (cmdOpts.url) {
|
|
132
|
-
process.stdout.write('\nThis URL is where runs AND `sente auth login` seeding navigate. If you changed the\n' +
|
|
133
|
-
'domain, re-run `sente auth login` to re-seed auth — cookies are domain-scoped.\n');
|
|
134
|
-
}
|
|
135
|
-
}, opts);
|
|
136
|
-
}
|
|
137
|
-
catch (err) {
|
|
138
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
project
|
|
142
|
-
.command('show')
|
|
143
|
-
.description('Show the current project (from .sente/config.json or --id)')
|
|
144
|
-
.option('--id <projectId>', 'Project id (overrides .sente/config.json)')
|
|
145
|
-
.action(async (cmdOpts) => {
|
|
146
|
-
const opts = globalOpts();
|
|
147
|
-
try {
|
|
148
|
-
const projectId = cmdOpts.id ?? readLocalProjectId();
|
|
149
|
-
if (!projectId) {
|
|
150
|
-
throw new Error('No project id found. Pass --id <projectId> or run `sente init` to create a .sente/config.json.');
|
|
151
|
-
}
|
|
152
|
-
const client = new client_1.GatewayClient();
|
|
153
|
-
const res = await client.request(`/api/projects/${projectId}`);
|
|
154
|
-
(0, output_1.printSuccess)(res.project, () => {
|
|
155
|
-
const p = res.project;
|
|
156
|
-
process.stdout.write(`Project: ${p.name} (${p.id})\n`);
|
|
157
|
-
if (p.description)
|
|
158
|
-
process.stdout.write(`Description: ${p.description}\n`);
|
|
159
|
-
if (p.baseUrl)
|
|
160
|
-
process.stdout.write(`Base URL: ${p.baseUrl}\n`);
|
|
161
|
-
process.stdout.write(`Created: ${p.createdAt}\n`);
|
|
162
|
-
process.stdout.write(`Updated: ${p.updatedAt}\n`);
|
|
163
|
-
}, opts);
|
|
164
|
-
}
|
|
165
|
-
catch (err) {
|
|
166
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
project
|
|
170
|
-
.command('run')
|
|
171
|
-
.description('Queue a run for every task across all workflows in a project (sequential, against staging)')
|
|
172
|
-
.option('--id <projectId>', 'Project id (overrides .sente/config.json)')
|
|
173
|
-
.action(async (cmdOpts) => {
|
|
174
|
-
const opts = globalOpts();
|
|
175
|
-
try {
|
|
176
|
-
const projectId = cmdOpts.id ?? readLocalProjectId();
|
|
177
|
-
if (!projectId) {
|
|
178
|
-
throw new Error('No project id found. Pass --id <projectId> or run `sente init` to create a .sente/config.json.');
|
|
179
|
-
}
|
|
180
|
-
const client = new client_1.GatewayClient();
|
|
181
|
-
const res = await client.request(`/api/projects/${projectId}/run`, { method: 'POST', body: {} });
|
|
182
|
-
(0, output_1.printSuccess)(res, () => (0, workflow_1.printBulkRun)(res), opts);
|
|
183
|
-
}
|
|
184
|
-
catch (err) {
|
|
185
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
function registerSyncCommand(program, globalOpts) {
|
|
190
|
-
program
|
|
191
|
-
.command('sync')
|
|
192
|
-
.description('Regenerate .sente/tasks.json from the current Sente project')
|
|
193
|
-
.action(async () => {
|
|
194
|
-
const opts = globalOpts();
|
|
195
|
-
try {
|
|
196
|
-
const projectId = readLocalProjectId();
|
|
197
|
-
if (!projectId) {
|
|
198
|
-
throw new Error('No project id found. Run `sente init` first, or run this from inside a repo with .sente/config.json.');
|
|
199
|
-
}
|
|
200
|
-
const client = new client_1.GatewayClient();
|
|
201
|
-
const res = await client.request('/api/tasks/list', {
|
|
202
|
-
query: { projectId },
|
|
203
|
-
});
|
|
204
|
-
const tasksDir = findSenteDir();
|
|
205
|
-
if (!tasksDir) {
|
|
206
|
-
throw new Error('No .sente directory found upward from cwd.');
|
|
207
|
-
}
|
|
208
|
-
const tasksPath = path.join(tasksDir, 'tasks.json');
|
|
209
|
-
// Preserve existing tags + relatedPaths -- the file is the authoring hint
|
|
210
|
-
// layer, so we treat user-written annotations as canonical for those fields.
|
|
211
|
-
const existing = readExistingTasksFile(tasksPath);
|
|
212
|
-
const existingById = new Map(existing.tasks.map((t) => [t.id, t]));
|
|
213
|
-
const merged = {
|
|
214
|
-
projectId,
|
|
215
|
-
tasks: res.tasks.map((t) => {
|
|
216
|
-
const prev = existingById.get(t.id);
|
|
217
|
-
return {
|
|
218
|
-
id: t.id,
|
|
219
|
-
name: t.name,
|
|
220
|
-
tags: prev?.tags ?? [],
|
|
221
|
-
relatedPaths: prev?.relatedPaths ?? [],
|
|
222
|
-
};
|
|
223
|
-
}),
|
|
224
|
-
};
|
|
225
|
-
fs.writeFileSync(tasksPath, JSON.stringify(merged, null, 2) + '\n');
|
|
226
|
-
(0, output_1.printSuccess)({ path: tasksPath, taskCount: merged.tasks.length }, `Wrote ${merged.tasks.length} task(s) to ${tasksPath}`, opts);
|
|
227
|
-
}
|
|
228
|
-
catch (err) {
|
|
229
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
function findSenteDir() {
|
|
234
|
-
let dir = process.cwd();
|
|
235
|
-
while (true) {
|
|
236
|
-
const candidate = path.join(dir, '.sente');
|
|
237
|
-
if (fs.existsSync(candidate) && fs.statSync(candidate).isDirectory()) {
|
|
238
|
-
return candidate;
|
|
239
|
-
}
|
|
240
|
-
const parent = path.dirname(dir);
|
|
241
|
-
if (parent === dir)
|
|
242
|
-
return null;
|
|
243
|
-
dir = parent;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Update the `baseUrl` in the local .sente/config.json (if present), preserving
|
|
248
|
-
* all other fields. Keeps the local authoring config in sync with the server-side
|
|
249
|
-
* project after `sente project set --url`. Returns the file path written, or null
|
|
250
|
-
* if there is no local config (e.g. running with an explicit --id outside a repo).
|
|
251
|
-
*/
|
|
252
|
-
function updateLocalConfigBaseUrl(baseUrl) {
|
|
253
|
-
const dir = findSenteDir();
|
|
254
|
-
if (!dir)
|
|
255
|
-
return null;
|
|
256
|
-
const configPath = path.join(dir, 'config.json');
|
|
257
|
-
if (!fs.existsSync(configPath))
|
|
258
|
-
return null;
|
|
259
|
-
try {
|
|
260
|
-
const cfg = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
261
|
-
cfg.baseUrl = baseUrl;
|
|
262
|
-
fs.writeFileSync(configPath, JSON.stringify(cfg, null, 2) + '\n');
|
|
263
|
-
return configPath;
|
|
264
|
-
}
|
|
265
|
-
catch {
|
|
266
|
-
return null;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
function readExistingTasksFile(p) {
|
|
270
|
-
if (!fs.existsSync(p))
|
|
271
|
-
return { projectId: '', tasks: [] };
|
|
272
|
-
try {
|
|
273
|
-
const parsed = JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
274
|
-
return {
|
|
275
|
-
projectId: typeof parsed.projectId === 'string' ? parsed.projectId : '',
|
|
276
|
-
tasks: Array.isArray(parsed.tasks) ? parsed.tasks : [],
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
catch {
|
|
280
|
-
return { projectId: '', tasks: [] };
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
//# sourceMappingUR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