@sente-labs/cli 0.10.0 → 0.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 +73 -46
- package/dist/client.js +12 -3
- package/dist/client.js.map +1 -1
- package/dist/commands/inbox.js +93 -10
- package/dist/commands/inbox.js.map +1 -1
- package/dist/commands/token.js +24 -0
- package/dist/commands/token.js.map +1 -0
- package/dist/config.js +0 -27
- package/dist/config.js.map +1 -1
- package/dist/index.js +6 -28
- 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 -92
- package/dist/skill/autoupdate.js.map +0 -1
- package/dist/skill/template.js +0 -68
- package/dist/skill/template.js.map +0 -1
|
@@ -33,52 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
36
|
+
exports.CLI_VERSION = void 0;
|
|
37
37
|
exports.checkForCliUpdate = checkForCliUpdate;
|
|
38
38
|
const fs = __importStar(require("fs"));
|
|
39
|
-
const os = __importStar(require("os"));
|
|
40
39
|
const path = __importStar(require("path"));
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
* - No marker → user-customized skill; leave it alone.
|
|
48
|
-
* - Marker matches CLI version → up to date; no-op.
|
|
49
|
-
* - Installed marker NEWER than this CLI → don't downgrade; leave it alone.
|
|
50
|
-
* - Installed marker OLDER than this CLI → auto-upgrade. Print a stderr notice.
|
|
51
|
-
*
|
|
52
|
-
* All errors are swallowed: this is a UX nicety, not a correctness gate.
|
|
53
|
-
* Skipped when `--json` is in argv so machine consumers see clean output.
|
|
54
|
-
*/
|
|
55
|
-
function autoUpdateSkillIfStale() {
|
|
56
|
-
if (process.argv.includes('--json'))
|
|
57
|
-
return;
|
|
58
|
-
try {
|
|
59
|
-
const dest = (0, template_1.skillInstallPath)(os.homedir());
|
|
60
|
-
if (!fs.existsSync(dest))
|
|
61
|
-
return; // never installed; not our place
|
|
62
|
-
const installed = fs.readFileSync(dest, 'utf8');
|
|
63
|
-
const installedVersion = (0, template_1.readSkillVersion)(installed);
|
|
64
|
-
if (!installedVersion)
|
|
65
|
-
return; // user-customized; respect it
|
|
66
|
-
if (installedVersion === template_1.CLI_VERSION)
|
|
67
|
-
return; // already current
|
|
68
|
-
// Downgrade floor: never clobber a NEWER installed skill with this (older)
|
|
69
|
-
// CLI's bundled copy. Without this, a stale global CLI (e.g. not yet
|
|
70
|
-
// `npm i -g`'d to latest) thrashes a newer skill back down on every
|
|
71
|
-
// invocation — silently stripping commands/guidance the newer skill added.
|
|
72
|
-
// Upgrades (installed older than CLI) still proceed below.
|
|
73
|
-
if (isNewer(installedVersion, template_1.CLI_VERSION))
|
|
74
|
-
return;
|
|
75
|
-
fs.writeFileSync(dest, template_1.SKILL_MD);
|
|
76
|
-
process.stderr.write(`sente: refreshed Claude Code skill (${installedVersion} -> ${template_1.CLI_VERSION}). Restart Claude Code to pick up changes.\n`);
|
|
77
|
-
}
|
|
78
|
-
catch {
|
|
79
|
-
// Best-effort. Never crash the user's command on update failures.
|
|
80
|
-
}
|
|
81
|
-
}
|
|
40
|
+
const config_1 = require("./config");
|
|
41
|
+
// Read package.json once at module load. One level up from dist/update.js at
|
|
42
|
+
// runtime and from src/update.ts at dev time -- same depth.
|
|
43
|
+
const PKG = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
|
|
44
|
+
exports.CLI_VERSION = PKG.version;
|
|
82
45
|
const CACHE_PATH = path.join(config_1.CREDENTIALS_DIR, 'update-check.json');
|
|
83
46
|
const CACHE_TTL_MS = 24 * 60 * 60 * 1000; // 24h
|
|
84
47
|
const REGISTRY_URL = 'https://registry.npmjs.org/@sente-labs%2fcli/latest';
|
|
@@ -89,7 +52,7 @@ const REGISTRY_URL = 'https://registry.npmjs.org/@sente-labs%2fcli/latest';
|
|
|
89
52
|
*
|
|
90
53
|
* - Network failures, registry errors → silent skip.
|
|
91
54
|
* - --json mode → silent skip.
|
|
92
|
-
* -
|
|
55
|
+
* - SENTE_DISABLE_UPDATE_CHECK env var lets users opt out.
|
|
93
56
|
*
|
|
94
57
|
* Returns a promise the caller MAY await; the entry point fires-and-forgets
|
|
95
58
|
* by returning before the request settles, so the user's command doesn't
|
|
@@ -114,8 +77,8 @@ async function checkForCliUpdate() {
|
|
|
114
77
|
}
|
|
115
78
|
if (!latest)
|
|
116
79
|
return;
|
|
117
|
-
if (isNewer(latest,
|
|
118
|
-
process.stderr.write(`sente: ${
|
|
80
|
+
if (isNewer(latest, exports.CLI_VERSION)) {
|
|
81
|
+
process.stderr.write(`sente: ${exports.CLI_VERSION} -> ${latest} available. Run: npm i -g @sente-labs/cli@latest\n`);
|
|
119
82
|
}
|
|
120
83
|
}
|
|
121
84
|
catch {
|
|
@@ -176,4 +139,4 @@ function isNewer(candidate, current) {
|
|
|
176
139
|
}
|
|
177
140
|
return false;
|
|
178
141
|
}
|
|
179
|
-
//# sourceMappingURL=
|
|
142
|
+
//# sourceMappingURL=update.js.map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IAAI,EAAE,GAAG,EAAE;YAAE,OAAO,KAAK,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sente-labs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Sente CLI -- give your AI agents managed email identities: create identities, receive and react to email, manage webhooks, from your terminal and Claude Code.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sente": "dist/index.js"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "tsc &&
|
|
14
|
+
"build": "tsc && chmod +x dist/index.js",
|
|
15
15
|
"dev": "ts-node src/index.ts",
|
|
16
16
|
"typecheck": "tsc --noEmit",
|
|
17
17
|
"prepublishOnly": "npm run build",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"ts-node": "^10.9.0",
|
|
50
50
|
"typescript": "^5.0.0"
|
|
51
51
|
},
|
|
52
|
-
"license": "
|
|
52
|
+
"license": "MIT"
|
|
53
53
|
}
|
|
@@ -1,110 +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.registerAppGraphCommands = registerAppGraphCommands;
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
|
-
const client_1 = require("../client");
|
|
39
|
-
const config_1 = require("../config");
|
|
40
|
-
const output_1 = require("../output");
|
|
41
|
-
/**
|
|
42
|
-
* App-graph commands. The app graph is a source-derived route map (routes +
|
|
43
|
-
* navigation edges) that the customer's coding agent generates from the repo at
|
|
44
|
-
* onboarding; the browser agent consults it to localize ("what page am I on,
|
|
45
|
-
* what's reachable, which controls leave this page"). The agent authors the JSON
|
|
46
|
-
* by reading the repo (see the skill's "Generating the app map" recipe); these
|
|
47
|
-
* commands upload and inspect it.
|
|
48
|
-
*/
|
|
49
|
-
function registerAppGraphCommands(program, globalOpts) {
|
|
50
|
-
const appGraph = program.command('app-graph').description('App-graph: source-derived route map for the browser agent');
|
|
51
|
-
appGraph
|
|
52
|
-
.command('push')
|
|
53
|
-
.description('Upload a generated app-graph JSON for a project')
|
|
54
|
-
.requiredOption('--from <file>', 'JSON file containing the app graph')
|
|
55
|
-
.option('--project <id>', 'project id (overrides .sente/config.json)')
|
|
56
|
-
.action(async (cmdOpts) => {
|
|
57
|
-
const opts = globalOpts();
|
|
58
|
-
try {
|
|
59
|
-
const projectId = cmdOpts.project ?? (0, config_1.readLocalProjectId)();
|
|
60
|
-
if (!projectId) {
|
|
61
|
-
throw new Error('No project id found. Pass --project <id> or run `sente init` to create a .sente/config.json.');
|
|
62
|
-
}
|
|
63
|
-
let graph;
|
|
64
|
-
try {
|
|
65
|
-
graph = JSON.parse(fs.readFileSync(cmdOpts.from, 'utf8'));
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
throw new Error(`Could not read or parse JSON from ${cmdOpts.from}`);
|
|
69
|
-
}
|
|
70
|
-
const client = new client_1.GatewayClient();
|
|
71
|
-
const res = await client.request(`/api/projects/${projectId}/app-graph`, { method: 'PUT', body: graph });
|
|
72
|
-
(0, output_1.printSuccess)(res, () => process.stdout.write(`Uploaded app graph: ${res.nodeCount} route(s), ${res.edgeCount} edge(s).\n`), opts);
|
|
73
|
-
}
|
|
74
|
-
catch (err) {
|
|
75
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
appGraph
|
|
79
|
-
.command('show')
|
|
80
|
-
.description('Show the stored app-graph for a project')
|
|
81
|
-
.option('--project <id>', 'project id (overrides .sente/config.json)')
|
|
82
|
-
.action(async (cmdOpts) => {
|
|
83
|
-
const opts = globalOpts();
|
|
84
|
-
try {
|
|
85
|
-
const projectId = cmdOpts.project ?? (0, config_1.readLocalProjectId)();
|
|
86
|
-
if (!projectId) {
|
|
87
|
-
throw new Error('No project id found. Pass --project <id> or run `sente init` to create a .sente/config.json.');
|
|
88
|
-
}
|
|
89
|
-
const client = new client_1.GatewayClient();
|
|
90
|
-
const res = await client.request(`/api/projects/${projectId}/app-graph`);
|
|
91
|
-
(0, output_1.printSuccess)(res, () => {
|
|
92
|
-
const g = res.appGraph;
|
|
93
|
-
if (!g) {
|
|
94
|
-
process.stdout.write('No app graph stored for this project. Ask Claude Code to "generate the Sente app map", then `sente app-graph push`.\n');
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const nodes = g.nodes ?? [];
|
|
98
|
-
const commit = g.commitSha ? `, commit ${g.commitSha.slice(0, 7)}` : '';
|
|
99
|
-
process.stdout.write(`App graph v${g.version}${g.framework ? ` (${g.framework})` : ''} — ${nodes.length} route(s), ${(g.edges ?? []).length} edge(s)${commit}\n`);
|
|
100
|
-
for (const n of nodes) {
|
|
101
|
-
process.stdout.write(` ${n.pathPattern} → ${n.componentName ?? ''} [${n.confidence}]\n`);
|
|
102
|
-
}
|
|
103
|
-
}, opts);
|
|
104
|
-
}
|
|
105
|
-
catch (err) {
|
|
106
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=appGraph.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"appGraph.js","sourceRoot":"","sources":["../../src/commands/appGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,4DA8EC;AApHD,uCAAyB;AAEzB,sCAA0C;AAC1C,sCAA+C;AAC/C,sCAAiE;AA0BjE;;;;;;;GAOG;AACH,SAAgB,wBAAwB,CAAC,OAAgB,EAAE,UAA4B;IACrF,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,2DAA2D,CAAC,CAAC;IAEvH,QAAQ;SACL,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,iDAAiD,CAAC;SAC9D,cAAc,CAAC,eAAe,EAAE,oCAAoC,CAAC;SACrE,MAAM,CAAC,gBAAgB,EAAE,2CAA2C,CAAC;SACrE,MAAM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,CAAC,CAAC,aAAa,IAAI,EAAE,KAAK,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC;gBAC7F,CAAC;YACH,CAAC,EACD,IAAI,CACL,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/commands/auth.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerAuthCommands = registerAuthCommands;
|
|
4
|
-
const client_1 = require("../client");
|
|
5
|
-
const output_1 = require("../output");
|
|
6
|
-
/**
|
|
7
|
-
* Authenticated-session seeding for SSO / 2FA flows. A human logs in once in a
|
|
8
|
-
* live browser bound to the project's persistent profile; the login persists,
|
|
9
|
-
* and later runs start already authenticated (so tests skip the login entirely).
|
|
10
|
-
*
|
|
11
|
-
* This is the answer for providers like "Log in with Google" that block
|
|
12
|
-
* automated per-run logins (bot detection + 2FA device prompts).
|
|
13
|
-
*/
|
|
14
|
-
function registerAuthCommands(program, globalOpts) {
|
|
15
|
-
const auth = program.command('auth').description('Authenticated-session seeding (SSO / 2FA)');
|
|
16
|
-
auth
|
|
17
|
-
.command('login')
|
|
18
|
-
.description('Open a one-time live browser to log in (incl. SSO/2FA); saves the session to the project profile')
|
|
19
|
-
.requiredOption('--project <id>', 'project id to seed')
|
|
20
|
-
.action(async (cmdOpts) => {
|
|
21
|
-
const opts = globalOpts();
|
|
22
|
-
try {
|
|
23
|
-
const client = new client_1.GatewayClient();
|
|
24
|
-
const res = await client.request(`/api/projects/${cmdOpts.project}/auth-session`, { method: 'POST', body: {} });
|
|
25
|
-
(0, output_1.printSuccess)(res, () => {
|
|
26
|
-
process.stdout.write('Open this URL and log in (complete any 2FA on your device):\n\n');
|
|
27
|
-
process.stdout.write(` ${res.liveUrl}\n\n`);
|
|
28
|
-
process.stdout.write('Once you have reached the logged-in app, run:\n');
|
|
29
|
-
process.stdout.write(` sente auth finish ${res.sessionId} --project ${cmdOpts.project}\n\n`);
|
|
30
|
-
process.stdout.write(`(The live session expires at ${res.expiresAt}.)\n`);
|
|
31
|
-
}, opts);
|
|
32
|
-
}
|
|
33
|
-
catch (err) {
|
|
34
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
auth
|
|
38
|
-
.command('finish')
|
|
39
|
-
.description('Close the live login session and persist the logged-in state to the project profile')
|
|
40
|
-
.argument('<sessionId>', 'the sessionId returned by `sente auth login`')
|
|
41
|
-
.requiredOption('--project <id>', 'project id')
|
|
42
|
-
.action(async (sessionId, cmdOpts) => {
|
|
43
|
-
const opts = globalOpts();
|
|
44
|
-
try {
|
|
45
|
-
const client = new client_1.GatewayClient();
|
|
46
|
-
const res = await client.request(`/api/projects/${cmdOpts.project}/auth-session/${sessionId}/finish`, { method: 'POST', body: {} });
|
|
47
|
-
(0, output_1.printSuccess)(res, 'Login saved to the project profile. Runs with the browser profile enabled will start authenticated.', opts);
|
|
48
|
-
}
|
|
49
|
-
catch (err) {
|
|
50
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":";;AAoBA,oDAqDC;AAxED,sCAA0C;AAC1C,sCAAiE;AAUjE;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAAC,OAAgB,EAAE,UAA4B;IACjF,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,2CAA2C,CAAC,CAAC;IAE9F,IAAI;SACD,OAAO,C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Y,CAAC;SAC9C,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,OAA4B,EAAE,EAAE;QAChE,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;QAC1B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,sBAAa,EAAE,CAAC;YACnC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,OAAO,CAC9B,iBAAiB,OAAO,CAAC,OAAO,iBAAiB,SAAS,SAAS,EACnE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAC7B,CAAC;YACF,IAAA,qBAAY,EACV,GAAG,EACH,qGAAqG,EACrG,IAAI,CACL,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerDeployWebhookCommands = registerDeployWebhookCommands;
|
|
4
|
-
const client_1 = require("../client");
|
|
5
|
-
const config_1 = require("../config");
|
|
6
|
-
const output_1 = require("../output");
|
|
7
|
-
/**
|
|
8
|
-
* Resolve the target project id from `--project` or the repo's `.sente/config.json`.
|
|
9
|
-
* Throws a clear error if neither is available.
|
|
10
|
-
*/
|
|
11
|
-
function resolveProjectId(explicit) {
|
|
12
|
-
const projectId = explicit ?? (0, config_1.readLocalProjectId)();
|
|
13
|
-
if (!projectId) {
|
|
14
|
-
throw new Error('No project id found. Pass --project <projectId> or run `sente init` to create a .sente/config.json.');
|
|
15
|
-
}
|
|
16
|
-
return projectId;
|
|
17
|
-
}
|
|
18
|
-
function registerDeployWebhookCommands(program, globalOpts) {
|
|
19
|
-
const webhook = program
|
|
20
|
-
.command('deploy-webhook')
|
|
21
|
-
.description('Manage a project deploy webhook (fires runOnDeploy tasks when staging/prod deploys)');
|
|
22
|
-
webhook
|
|
23
|
-
.command('status')
|
|
24
|
-
.description('Show whether a deploy webhook secret exists, plus recent deploy events')
|
|
25
|
-
.option('--project <projectId>', 'Project id (overrides .sente/config.json)')
|
|
26
|
-
.action(async (cmdOpts) => {
|
|
27
|
-
const opts = globalOpts();
|
|
28
|
-
try {
|
|
29
|
-
const projectId = resolveProjectId(cmdOpts.project);
|
|
30
|
-
const client = new client_1.GatewayClient();
|
|
31
|
-
const res = await client.request(`/api/projects/${projectId}/deploy-webhook`);
|
|
32
|
-
(0, output_1.printSuccess)({ hasSecret: res.hasSecret, secretPrefix: res.secretPrefix, events: res.events }, () => {
|
|
33
|
-
process.stdout.write(res.hasSecret
|
|
34
|
-
? `Deploy webhook: configured (secret ${res.secretPrefix}…)\n`
|
|
35
|
-
: 'Deploy webhook: no secret set (PAT-authenticated deploy events only)\n');
|
|
36
|
-
if (res.events.length === 0) {
|
|
37
|
-
process.stdout.write('No recent deploy events.\n');
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
process.stdout.write('\nRecent deploy events:\n');
|
|
41
|
-
for (const e of res.events) {
|
|
42
|
-
const sha = e.commitSha ? e.commitSha.slice(0, 8) : '—';
|
|
43
|
-
const dedup = e.deduplicated ? ' (deduplicated)' : '';
|
|
44
|
-
process.stdout.write(` ${e.createdAt} ${e.environment.padEnd(10)} ${sha} ${e.triggeredTaskIds.length} task(s)${dedup}\n`);
|
|
45
|
-
}
|
|
46
|
-
}, opts);
|
|
47
|
-
}
|
|
48
|
-
catch (err) {
|
|
49
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
webhook
|
|
53
|
-
.command('regenerate')
|
|
54
|
-
.description('Rotate (or create) the deploy webhook secret. Returns the raw value ONCE — copy it now.')
|
|
55
|
-
.option('--project <projectId>', 'Project id (overrides .sente/config.json)')
|
|
56
|
-
.action(async (cmdOpts) => {
|
|
57
|
-
const opts = globalOpts();
|
|
58
|
-
try {
|
|
59
|
-
const projectId = resolveProjectId(cmdOpts.project);
|
|
60
|
-
const client = new client_1.GatewayClient();
|
|
61
|
-
const res = await client.request(`/api/projects/${projectId}/deploy-webhook/regenerate`, { method: 'POST', body: {} });
|
|
62
|
-
(0, output_1.printSuccess)({ rawSecret: res.rawSecret, prefix: res.prefix }, () => {
|
|
63
|
-
process.stdout.write('Deploy webhook secret rotated. This is shown ONCE:\n\n');
|
|
64
|
-
process.stdout.write(` ${res.rawSecret}\n\n`);
|
|
65
|
-
process.stdout.write('Store it as a CI secret and send it as the X-Sente-Secret header when POSTing\n' +
|
|
66
|
-
`to /api/projects/${projectId}/deploy-events after each deploy.\n`);
|
|
67
|
-
}, opts);
|
|
68
|
-
// In human mode, nudge the operator that the value won't be retrievable later.
|
|
69
|
-
if (!(0, output_1.isJson)(opts)) {
|
|
70
|
-
process.stderr.write('\nThe raw secret is not stored and cannot be retrieved again.\n');
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
webhook
|
|
78
|
-
.command('clear')
|
|
79
|
-
.description('Clear the deploy webhook secret (after this, only PAT-authenticated deploy events are accepted)')
|
|
80
|
-
.option('--project <projectId>', 'Project id (overrides .sente/config.json)')
|
|
81
|
-
.action(async (cmdOpts) => {
|
|
82
|
-
const opts = globalOpts();
|
|
83
|
-
try {
|
|
84
|
-
const projectId = resolveProjectId(cmdOpts.project);
|
|
85
|
-
const client = new client_1.GatewayClient();
|
|
86
|
-
await client.request(`/api/projects/${projectId}/deploy-webhook`, { method: 'DELETE' });
|
|
87
|
-
(0, output_1.printSuccess)({ ok: true, projectId }, `Cleared deploy webhook secret for project ${projectId}.`, opts);
|
|
88
|
-
}
|
|
89
|
-
catch (err) {
|
|
90
|
-
process.exit((0, output_1.printError)(err, opts));
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=deployWebhook.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deployWebhook.js","sourceRoot":"","sources":["../../src/commands/deployWebhook.ts"],"names":[],"mappings":";;AA0CA,sEAkGC;AA3ID,sCAA0C;AAC1C,sCAA+C;AAC/C,sCAAyE;AAyBzE;;;GAGG;AACH,SAAS,gBAAgB,CAAC,QAAiB;IACzC,MAAM,SAAS,GAAG,QAAQ,IAAI,IAAA,2BAAkB,GAAE,CAAC;IACnD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,qGAAqG,CACtG,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,6BAA6B,CAAC,OAAgB,EAAE,UAA4B;IAC1F,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,qFAAqF,CAAC,CAAC;IAEtG,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,wEAAwE,CAAC;SACrF,MAAM,CAAC,uBAAuB,EAAE,2CAA2C,CAAC;SAC5E,MAAM,CAAC,KAAK,EAAE,OAA6B,EAAE,EAAE;QAC9C,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;QAC1B,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpD,MAAM,MAAM,GAAG,IAAI,sBAAa,EAAE,CAAC;YACnC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,OAAO,CAC9B,iBAAiB,SAAS,iBAAiB,CAC5C,CAAC;YACF,IAAA,qBAAY,EACV,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAChF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AAK,EAAE,OAA6B,EAAE,EAAE;QAC9C,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;QAC1B,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACpD,MAAM,MAAM,GAAG,IAAI,sBAAa,EAAE,CAAC;YACnC,MAAM,MAAM,CAAC,OAAO,CAAC,iBAAiB,SAAS,iBAAiB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;YACxF,IAAA,qBAAY,EACV,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EACvB,6CAA6C,SAAS,GAAG,EACzD,IAAI,CACL,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
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
|
|
@@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