@illuminis/comprism 0.1.7 → 2.4.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/out/{graph → build/machine/codemap}/read-python.js +2 -2
- package/out/{executor → build/machine/executor}/diagnostics.js +1 -1
- package/out/{executor → build/machine/executor}/hooks.js +1 -1
- package/out/{executor → build/machine/executor}/sandbox.js +1 -1
- package/out/build/machine/line/index.js +339 -0
- package/out/{commands/privacy.js → build/machine/runtime/home.js} +10 -19
- package/out/build/machine/runtime/needs.js +89 -0
- package/out/{lib → build/machine/runtime}/self.js +25 -3
- package/out/build/machine/terminal/jobs.js +67 -0
- package/out/build/machine/terminal/sign-in.js +212 -0
- package/out/build/machine/terminal/steps.js +460 -0
- package/out/build/machine/terminal/voice.js +136 -0
- package/out/build/machine/voice/record.js +286 -0
- package/out/cli-start.js +128 -0
- package/out/machine/line/index.js +339 -0
- package/out/machine/runtime/self.js +22 -0
- package/out/machine/terminal/clipboard.js +182 -0
- package/out/machine/terminal/jobs.js +67 -0
- package/out/machine/terminal/sign-in.js +212 -0
- package/out/machine/terminal/steps.js +460 -0
- package/out/machine/terminal/voice.js +136 -0
- package/out/machine/voice/record.js +79 -1
- package/out/native/dictate +0 -0
- package/out/server.generated.js +6 -0
- package/package.json +8 -40
- package/README.md +0 -343
- package/out/agent/command.d.ts +0 -157
- package/out/agent/command.js +0 -454
- package/out/agent/render.d.ts +0 -169
- package/out/agent/render.js +0 -689
- package/out/agent/session.d.ts +0 -334
- package/out/agent/session.js +0 -1223
- package/out/commands/agents.d.ts +0 -2
- package/out/commands/agents.js +0 -79
- package/out/commands/ask.d.ts +0 -1
- package/out/commands/ask.js +0 -222
- package/out/commands/codemap.d.ts +0 -2
- package/out/commands/codemap.js +0 -151
- package/out/commands/commands-thin.d.ts +0 -39
- package/out/commands/commands-thin.js +0 -244
- package/out/commands/config.d.ts +0 -1
- package/out/commands/config.js +0 -138
- package/out/commands/cost.d.ts +0 -1
- package/out/commands/cost.js +0 -167
- package/out/commands/decisionEngine.d.ts +0 -1
- package/out/commands/decisionEngine.js +0 -66
- package/out/commands/hooks.d.ts +0 -1
- package/out/commands/hooks.js +0 -83
- package/out/commands/install.d.ts +0 -206
- package/out/commands/install.js +0 -738
- package/out/commands/instructions.d.ts +0 -1
- package/out/commands/instructions.js +0 -113
- package/out/commands/integrations.d.ts +0 -3
- package/out/commands/integrations.js +0 -215
- package/out/commands/jobs.d.ts +0 -5
- package/out/commands/jobs.js +0 -157
- package/out/commands/keys.d.ts +0 -55
- package/out/commands/keys.js +0 -344
- package/out/commands/login.d.ts +0 -9
- package/out/commands/login.js +0 -606
- package/out/commands/memory.d.ts +0 -3
- package/out/commands/memory.js +0 -113
- package/out/commands/permissions.d.ts +0 -1
- package/out/commands/permissions.js +0 -94
- package/out/commands/plugins.d.ts +0 -4
- package/out/commands/plugins.js +0 -192
- package/out/commands/privacy.d.ts +0 -1
- package/out/commands/providerKey.d.ts +0 -32
- package/out/commands/providerKey.js +0 -108
- package/out/commands/repl.d.ts +0 -12
- package/out/commands/repl.js +0 -2303
- package/out/commands/report.d.ts +0 -39
- package/out/commands/report.js +0 -115
- package/out/commands/review.d.ts +0 -5
- package/out/commands/review.js +0 -223
- package/out/commands/sessions.d.ts +0 -23
- package/out/commands/sessions.js +0 -115
- package/out/commands/settings.d.ts +0 -23
- package/out/commands/settings.js +0 -153
- package/out/commands/skills.d.ts +0 -21
- package/out/commands/skills.js +0 -207
- package/out/commands/unattended.d.ts +0 -7
- package/out/commands/unattended.js +0 -351
- package/out/commands/update.d.ts +0 -1
- package/out/commands/update.js +0 -123
- package/out/commands/welcome.d.ts +0 -25
- package/out/commands/welcome.js +0 -223
- package/out/commands/worktrees.d.ts +0 -5
- package/out/commands/worktrees.js +0 -186
- package/out/executor/browser.d.ts +0 -14
- package/out/executor/diagnostics.d.ts +0 -2
- package/out/executor/documents.d.ts +0 -40
- package/out/executor/files.d.ts +0 -2
- package/out/executor/git.d.ts +0 -48
- package/out/executor/hooks.d.ts +0 -51
- package/out/executor/index.d.ts +0 -45
- package/out/executor/notebook.d.ts +0 -2
- package/out/executor/paths.d.ts +0 -20
- package/out/executor/sandbox.d.ts +0 -40
- package/out/executor/shell.d.ts +0 -86
- package/out/executor/toolservers.d.ts +0 -20
- package/out/executor/worktree.d.ts +0 -9
- package/out/graph/build.d.ts +0 -45
- package/out/graph/facts.d.ts +0 -47
- package/out/graph/files.d.ts +0 -45
- package/out/graph/read-locales.d.ts +0 -29
- package/out/graph/read-python.d.ts +0 -11
- package/out/graph/read-typescript.d.ts +0 -16
- package/out/graph/sync.d.ts +0 -66
- package/out/graph/sync.js +0 -242
- package/out/lib/attach.d.ts +0 -106
- package/out/lib/attach.js +0 -396
- package/out/lib/clipboard.d.ts +0 -23
- package/out/lib/commandlist.d.ts +0 -20
- package/out/lib/commandlist.js +0 -58
- package/out/lib/config.d.ts +0 -94
- package/out/lib/config.js +0 -197
- package/out/lib/connection.d.ts +0 -73
- package/out/lib/connection.js +0 -188
- package/out/lib/decision.d.ts +0 -22
- package/out/lib/decision.js +0 -50
- package/out/lib/fingerprint.d.ts +0 -25
- package/out/lib/fingerprint.js +0 -58
- package/out/lib/gateway.d.ts +0 -427
- package/out/lib/gateway.js +0 -226
- package/out/lib/history.d.ts +0 -24
- package/out/lib/history.js +0 -137
- package/out/lib/ide.d.ts +0 -19
- package/out/lib/ide.js +0 -131
- package/out/lib/keyboard.d.ts +0 -98
- package/out/lib/keyboard.js +0 -390
- package/out/lib/lastlogin.d.ts +0 -14
- package/out/lib/lastlogin.js +0 -105
- package/out/lib/machine.d.ts +0 -21
- package/out/lib/machine.js +0 -91
- package/out/lib/notify.d.ts +0 -4
- package/out/lib/notify.js +0 -52
- package/out/lib/output.d.ts +0 -48
- package/out/lib/output.js +0 -108
- package/out/lib/picker.d.ts +0 -1
- package/out/lib/picker.js +0 -158
- package/out/lib/project-ops.d.ts +0 -19
- package/out/lib/project-ops.js +0 -146
- package/out/lib/project.d.ts +0 -28
- package/out/lib/prompt.d.ts +0 -37
- package/out/lib/prompt.js +0 -142
- package/out/lib/queue.d.ts +0 -13
- package/out/lib/queue.js +0 -116
- package/out/lib/readiness.d.ts +0 -22
- package/out/lib/readiness.js +0 -207
- package/out/lib/self.d.ts +0 -23
- package/out/lib/servicecommand.d.ts +0 -14
- package/out/lib/servicecommand.js +0 -74
- package/out/lib/sessions.d.ts +0 -19
- package/out/lib/sessions.js +0 -221
- package/out/lib/startcache.d.ts +0 -13
- package/out/lib/startcache.js +0 -78
- package/out/lib/stdin.d.ts +0 -32
- package/out/lib/stdin.js +0 -117
- package/out/lib/store.d.ts +0 -40
- package/out/lib/store.js +0 -138
- package/out/lib/sync.d.ts +0 -18
- package/out/lib/sync.js +0 -81
- package/out/lib/types.d.ts +0 -417
- package/out/lib/types.js +0 -21
- package/out/lib/ui.d.ts +0 -123
- package/out/lib/ui.js +0 -299
- package/out/lib/version.d.ts +0 -23
- package/out/lib/version.js +0 -46
- package/out/lib/voice.d.ts +0 -49
- package/out/lib/voice.js +0 -236
- package/out/lib/words.d.ts +0 -20
- package/out/lib/words.js +0 -27
- package/out/machine/codemap/build.d.ts +0 -45
- package/out/machine/codemap/facts.d.ts +0 -47
- package/out/machine/codemap/files.d.ts +0 -45
- package/out/machine/codemap/read-locales.d.ts +0 -29
- package/out/machine/codemap/read-python.d.ts +0 -11
- package/out/machine/codemap/read-typescript.d.ts +0 -16
- package/out/machine/executor/browser.d.ts +0 -14
- package/out/machine/executor/diagnostics.d.ts +0 -2
- package/out/machine/executor/documents.d.ts +0 -40
- package/out/machine/executor/files.d.ts +0 -2
- package/out/machine/executor/git.d.ts +0 -48
- package/out/machine/executor/hooks.d.ts +0 -51
- package/out/machine/executor/index.d.ts +0 -45
- package/out/machine/executor/notebook.d.ts +0 -2
- package/out/machine/executor/paths.d.ts +0 -20
- package/out/machine/executor/sandbox.d.ts +0 -40
- package/out/machine/executor/shell.d.ts +0 -86
- package/out/machine/executor/toolservers.d.ts +0 -20
- package/out/machine/executor/worktree.d.ts +0 -9
- package/out/machine/folder/project.d.ts +0 -28
- package/out/machine/runtime/home.d.ts +0 -2
- package/out/machine/runtime/needs.d.ts +0 -30
- package/out/machine/runtime/self.d.ts +0 -23
- package/out/machine/voice/record.d.ts +0 -38
- package/out/postinstall.d.ts +0 -2
- package/out/postinstall.js +0 -120
- package/out/providers/anthropic.d.ts +0 -22
- package/out/providers/anthropic.js +0 -80
- package/out/providers/index.d.ts +0 -8
- package/out/providers/index.js +0 -84
- package/out/providers/openai.d.ts +0 -11
- package/out/providers/openai.js +0 -57
- package/out/thin.d.ts +0 -2
- package/out/thin.js +0 -855
- package/scripts/read_python.py +0 -270
- /package/out/{graph → build/machine/codemap}/build.js +0 -0
- /package/out/{graph → build/machine/codemap}/facts.js +0 -0
- /package/out/{graph → build/machine/codemap}/files.js +0 -0
- /package/out/{graph → build/machine/codemap}/read-locales.js +0 -0
- /package/out/{graph → build/machine/codemap}/read-typescript.js +0 -0
- /package/out/{executor → build/machine/executor}/browser.js +0 -0
- /package/out/{executor → build/machine/executor}/documents.js +0 -0
- /package/out/{executor → build/machine/executor}/files.js +0 -0
- /package/out/{executor → build/machine/executor}/git.js +0 -0
- /package/out/{executor → build/machine/executor}/index.js +0 -0
- /package/out/{executor → build/machine/executor}/notebook.js +0 -0
- /package/out/{executor → build/machine/executor}/paths.js +0 -0
- /package/out/{executor → build/machine/executor}/shell.js +0 -0
- /package/out/{executor → build/machine/executor}/toolservers.js +0 -0
- /package/out/{executor → build/machine/executor}/worktree.js +0 -0
- /package/out/{lib → build/machine/folder}/project.js +0 -0
- /package/out/{lib → build/machine/terminal}/clipboard.js +0 -0
|
@@ -1,244 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.cmdDisconnect = cmdDisconnect;
|
|
40
|
-
exports.cmdStatus = cmdStatus;
|
|
41
|
-
/**
|
|
42
|
-
* The commands the PUBLISHED tool has, written so none of them can reach the
|
|
43
|
-
* decision, the price list or the study.
|
|
44
|
-
*
|
|
45
|
-
* The full internal tool has richer versions of some of these in `cli.ts`. They
|
|
46
|
-
* are deliberately not shared: sharing them is how a module that must never
|
|
47
|
-
* ship ends up imported by one that does, which is the exact accident this
|
|
48
|
-
* whole split exists to make impossible.
|
|
49
|
-
*/
|
|
50
|
-
const node_child_process_1 = require("node:child_process");
|
|
51
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
52
|
-
const node_readline_1 = __importDefault(require("node:readline"));
|
|
53
|
-
const connection_1 = require("../lib/connection");
|
|
54
|
-
const gateway_1 = require("../lib/gateway");
|
|
55
|
-
const ui = __importStar(require("../lib/ui"));
|
|
56
|
-
const settings_1 = require("./settings");
|
|
57
|
-
const out = (s = '') => process.stdout.write(s + '\n');
|
|
58
|
-
function argValue(args, flag) {
|
|
59
|
-
const i = args.indexOf(flag);
|
|
60
|
-
return i >= 0 ? args[i + 1] : undefined;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Read a password without echoing it.
|
|
64
|
-
*
|
|
65
|
-
* It never reaches a file, a log or the shell history: the only copy is the
|
|
66
|
-
* string handed straight to the sign-in call.
|
|
67
|
-
*/
|
|
68
|
-
function askHidden(prompt) {
|
|
69
|
-
return new Promise((resolve) => {
|
|
70
|
-
const rl = node_readline_1.default.createInterface({
|
|
71
|
-
input: process.stdin, output: process.stdout, terminal: true,
|
|
72
|
-
});
|
|
73
|
-
const silent = rl;
|
|
74
|
-
silent._writeToOutput = () => { };
|
|
75
|
-
process.stdout.write(prompt);
|
|
76
|
-
rl.question('', (answer) => {
|
|
77
|
-
rl.close();
|
|
78
|
-
process.stdout.write('\n');
|
|
79
|
-
resolve(answer);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
// `cmdConnect` lived here and is gone.
|
|
84
|
-
//
|
|
85
|
-
// It was a second sign in: it called the authentication routes and the key
|
|
86
|
-
// route directly, in its own order, and nothing reached it. The published
|
|
87
|
-
// command `connect` has routed to `cmdLogin` for some time, so this was an
|
|
88
|
-
// unreachable copy of the one act the product most needs to have exactly one
|
|
89
|
-
// of. Two sign ins are two places for a rule about who may sign in to be
|
|
90
|
-
// enforced differently, and the dead one is always the one nobody updates.
|
|
91
|
-
/**
|
|
92
|
-
* Sign this machine out.
|
|
93
|
-
*
|
|
94
|
-
* ── Forgetting is not signing out ─────────────────────────────────────────
|
|
95
|
-
*
|
|
96
|
-
* This used to delete the local copy of the credential and say "disconnected".
|
|
97
|
-
* The credential stayed live: still listed in the portal, still accepted on
|
|
98
|
-
* every call, so anybody holding a copy of that file was still signed in and
|
|
99
|
-
* the person who signed out had no way to know it.
|
|
100
|
-
*
|
|
101
|
-
* So the server is told FIRST, on the one service every client shares, and it
|
|
102
|
-
* revokes the credential where it was minted. The local copy is then removed
|
|
103
|
-
* whatever the server said, because a person who asked to sign out must not be
|
|
104
|
-
* left holding a credential on a laptop they have finished with: if the server
|
|
105
|
-
* could not be reached, the key on this machine is gone and the words say
|
|
106
|
-
* plainly that it may still be live until it is revoked in the portal.
|
|
107
|
-
*
|
|
108
|
-
* `logout`, `signout` and `disconnect` are the same act under the three words
|
|
109
|
-
* people actually type. `logout` printed "there is no command called logout",
|
|
110
|
-
* which is the product telling somebody their own vocabulary is wrong.
|
|
111
|
-
*/
|
|
112
|
-
async function cmdDisconnect() {
|
|
113
|
-
out(ui.banner('Sign out'));
|
|
114
|
-
out();
|
|
115
|
-
const conn = (0, connection_1.readConnection)();
|
|
116
|
-
if (!conn?.url || !conn.workspaceKey) {
|
|
117
|
-
(0, connection_1.clearConnection)();
|
|
118
|
-
out(ui.info('This machine was not signed in.'));
|
|
119
|
-
out();
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
const reply = await (0, gateway_1.ask)({ intent: 'sign_out', prompt: '' });
|
|
123
|
-
const removed = (0, connection_1.clearConnection)();
|
|
124
|
-
// A new terminal must stop presenting the key that was just given up.
|
|
125
|
-
(await Promise.resolve().then(() => __importStar(require('./install')))).refreshEnvScript();
|
|
126
|
-
if (reply.signed_out) {
|
|
127
|
-
out(ui.ok(reply.message || 'Signed out. This machine\'s key is revoked.'));
|
|
128
|
-
out(` ${ui.c.dim('sign back in with')} ${ui.c.bold('comprism login')}`);
|
|
129
|
-
}
|
|
130
|
-
else if (removed) {
|
|
131
|
-
// Said plainly rather than dressed up. A person who is told "signed out"
|
|
132
|
-
// when the key is still live has been given the one piece of information
|
|
133
|
-
// they would have acted on.
|
|
134
|
-
out(ui.warn('Removed from this machine, but the key could not be revoked.'));
|
|
135
|
-
out(` ${ui.c.dim(reply.message
|
|
136
|
-
|| 'The service could not be reached. Revoke this machine from Administration in the web portal.')}`);
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
out(ui.info('This machine was not signed in.'));
|
|
140
|
-
}
|
|
141
|
-
out();
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Where this machine is pointed, and whether the workspace still accepts it.
|
|
145
|
-
*
|
|
146
|
-
* ── Why this asks the server rather than reading the file ─────────────────
|
|
147
|
-
*
|
|
148
|
-
* It used to report "signed in" from the presence of a local file, which is a
|
|
149
|
-
* statement about a laptop and not about an account. A credential revoked in
|
|
150
|
-
* the portal an hour ago still reads as signed in; so does a machine pointed at
|
|
151
|
-
* an address that has not answered for a week. That is precisely how a
|
|
152
|
-
* developer spent an evening on 17 September 2026 believing he was signed in to
|
|
153
|
-
* a workspace while every call was going to a dead port on his own laptop.
|
|
154
|
-
*
|
|
155
|
-
* Status is the command a person runs when something is wrong, so it is the one
|
|
156
|
-
* command that must never report a local guess as a fact. It asks the one
|
|
157
|
-
* service and prints what came back, or says it heard nothing.
|
|
158
|
-
*/
|
|
159
|
-
async function cmdStatus() {
|
|
160
|
-
const c = (0, connection_1.readConnection)();
|
|
161
|
-
out(ui.banner('Status'));
|
|
162
|
-
out();
|
|
163
|
-
// Exit numbers are Appendix B of the manual: 3 not signed in, revoked or
|
|
164
|
-
// expired; 6 service unreachable; 1 anything else that stopped the answer.
|
|
165
|
-
if (!c?.url || !c.workspaceKey) {
|
|
166
|
-
process.exitCode = 3;
|
|
167
|
-
out(ui.warn('Not signed in.'));
|
|
168
|
-
out(` ${ui.c.dim('$')} comprism login`);
|
|
169
|
-
out();
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
const reply = await (0, gateway_1.ask)({ intent: 'session', prompt: '' });
|
|
173
|
-
const me = reply.ok && reply.served !== false ? reply.session : null;
|
|
174
|
-
if (!reply.ok) {
|
|
175
|
-
if (reply.httpStatus === 401) {
|
|
176
|
-
out(ui.fail("Signed out: this machine's key was revoked or has expired."));
|
|
177
|
-
out(` ${ui.c.dim('sign in again with')} ${ui.c.bold('comprism login')}`);
|
|
178
|
-
process.exitCode = 3;
|
|
179
|
-
}
|
|
180
|
-
else if (reply.httpStatus) {
|
|
181
|
-
out(ui.fail('The organization could not confirm this account.'));
|
|
182
|
-
out(` ${ui.c.dim(reply.message || 'the service refused the request')}`);
|
|
183
|
-
process.exitCode = 1;
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
// Only what this machine knows, and said to be only that (manual 1.4).
|
|
187
|
-
out(ui.fail(`This machine is pointed at ${ui.c.bold(c.url)}, which did not answer.`));
|
|
188
|
-
out(` ${ui.c.dim(reply.message || 'no answer from the organization')}`);
|
|
189
|
-
out(` ${ui.c.dim('on this machine only:')} ${machineLine(c)}`);
|
|
190
|
-
process.exitCode = 6;
|
|
191
|
-
}
|
|
192
|
-
out();
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (reply.served === false) {
|
|
196
|
-
out(ui.warn(`${ui.c.bold(c.url)} answered, but is running a build that cannot report a session.`));
|
|
197
|
-
out(ui.c.dim(reply.message || 'Ask your organization administrator to update the service.'));
|
|
198
|
-
process.exitCode = 1;
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
if (reply.granted === false || !me?.signed_in) {
|
|
202
|
-
out(ui.fail(reply.message || 'The organization did not confirm a signed in account.'));
|
|
203
|
-
out(' Run comprism login to sign in.');
|
|
204
|
-
process.exitCode = 3;
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
const providers = me.vendors_known === false
|
|
208
|
-
? 'could not be checked, so unknown rather than none'
|
|
209
|
-
: me.vendor_names?.length
|
|
210
|
-
? `${me.vendor_names.join(', ')} (keys on your account)`
|
|
211
|
-
: me.vendors_with_key ? `${me.vendors_with_key} (keys on your account)` : 'none yet: comprism keys';
|
|
212
|
-
const project = currentProject();
|
|
213
|
-
out(` ${ui.c.bold(me.user_email)} at ${ui.c.bold(me.company)}`);
|
|
214
|
-
out(` ${ui.c.dim('workspace ')} ${me.workspace_url || c.url}`);
|
|
215
|
-
out(` ${ui.c.dim('machine ')} ${machineLine(c, me.machine)}`);
|
|
216
|
-
out(` ${ui.c.dim('providers ')} ${providers}`);
|
|
217
|
-
if (me.comparing)
|
|
218
|
-
out(` ${ui.c.dim('baseline ')} ${me.comparing}`);
|
|
219
|
-
out(` ${ui.c.dim('project ')} ${project}`);
|
|
220
|
-
out();
|
|
221
|
-
out(ui.c.dim(' Every figure you see is computed on our servers, never here.'));
|
|
222
|
-
out();
|
|
223
|
-
}
|
|
224
|
-
/** Enrollment date and the last four characters of the key: enough to match
|
|
225
|
-
* the machine against Administration, never enough to use it. */
|
|
226
|
-
function machineLine(c, label) {
|
|
227
|
-
const when = c.connectedAt ? new Date(c.connectedAt) : null;
|
|
228
|
-
const date = when && !Number.isNaN(when.getTime())
|
|
229
|
-
? when.toLocaleDateString('en-GB', { day: 'numeric', month: 'short', year: 'numeric' }) : '';
|
|
230
|
-
const key = c.workspaceKey ? `key ending ${c.workspaceKey.slice(-4)}` : 'no key';
|
|
231
|
-
return [label ? `"${label}"` : '', date ? `enrolled ${date}` : 'enrolled', key].filter(Boolean).join(', ');
|
|
232
|
-
}
|
|
233
|
-
/** The project folder, with its Git branch when it is a repository. */
|
|
234
|
-
function currentProject() {
|
|
235
|
-
const folder = (0, settings_1.currentWorkspace)().path;
|
|
236
|
-
const shown = folder.startsWith(node_os_1.default.homedir()) ? `~${folder.slice(node_os_1.default.homedir().length)}` : folder;
|
|
237
|
-
try {
|
|
238
|
-
const branch = (0, node_child_process_1.execFileSync)('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: folder, stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
|
|
239
|
-
return branch ? `${shown} (${branch})` : shown;
|
|
240
|
-
}
|
|
241
|
-
catch {
|
|
242
|
-
return shown;
|
|
243
|
-
}
|
|
244
|
-
}
|
package/out/commands/config.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function cmdConfig(args: string[]): Promise<number>;
|
package/out/commands/config.js
DELETED
|
@@ -1,138 +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.cmdConfig = cmdConfig;
|
|
37
|
-
/**
|
|
38
|
-
* `comprism config`: the settings for this machine (manual 2.10, 6.5, 6.10 to
|
|
39
|
-
* 6.12).
|
|
40
|
-
*
|
|
41
|
-
* The machine's own settings live here: theme, keys, notify, plain, history
|
|
42
|
-
* and editor. Settings that change what the agent does, such as the permission
|
|
43
|
-
* mode, are resolved by the service from the company, the command, the local
|
|
44
|
-
* and project settings files and the person's account (manual 2.10); this
|
|
45
|
-
* command sends the files and prints the service's answer.
|
|
46
|
-
*/
|
|
47
|
-
const ui = __importStar(require("../lib/ui"));
|
|
48
|
-
const machine_1 = require("../lib/machine");
|
|
49
|
-
const project_ops_1 = require("../lib/project-ops");
|
|
50
|
-
/** The settings files the service reads, as the manual names them. */
|
|
51
|
-
const SETTINGS_FILES = ['.completionprism/settings.local.json', '.completionprism/settings.json'];
|
|
52
|
-
/** `--config <file>` and `--no-personal`: show what a job run with them uses
|
|
53
|
-
* (manual 10.8). Set by `cmdConfig`, sent as read. */
|
|
54
|
-
let automation = {};
|
|
55
|
-
async function service(op, payload) {
|
|
56
|
-
const facts = await (0, project_ops_1.currentProject)();
|
|
57
|
-
const reply = await (0, project_ops_1.call)('config', op, {
|
|
58
|
-
...payload, ...automation, files: (0, project_ops_1.readSome)(facts.root, SETTINGS_FILES),
|
|
59
|
-
}, facts);
|
|
60
|
-
if (!reply)
|
|
61
|
-
return 1;
|
|
62
|
-
const write = reply.data?.write;
|
|
63
|
-
if (write)
|
|
64
|
-
(0, project_ops_1.writeSetting)(facts.root, write.file, write.key, write.value);
|
|
65
|
-
return 0;
|
|
66
|
-
}
|
|
67
|
-
const out = (s = '') => process.stdout.write(s + '\n');
|
|
68
|
-
function notHere(key) {
|
|
69
|
-
out(ui.fail(`\`${key}\` is not a setting for this machine, so nothing was changed.`));
|
|
70
|
-
out(ui.c.dim(` This machine keeps: ${Object.keys(machine_1.MACHINE_KEYS).join(', ')}. Workspace and personal settings are kept by the service (manual 2.10).`));
|
|
71
|
-
out();
|
|
72
|
-
return 1;
|
|
73
|
-
}
|
|
74
|
-
async function cmdConfig(args) {
|
|
75
|
-
const configAt = args.indexOf('--config');
|
|
76
|
-
if (configAt !== -1) {
|
|
77
|
-
const { readJsonFile } = await Promise.resolve().then(() => __importStar(require('../lib/output')));
|
|
78
|
-
const got = readJsonFile(String(args[configAt + 1] ?? ''), '--config');
|
|
79
|
-
if ('bad' in got) {
|
|
80
|
-
process.stderr.write(ui.fail(got.bad) + '\n');
|
|
81
|
-
return 2;
|
|
82
|
-
}
|
|
83
|
-
automation.settings_config = got.value;
|
|
84
|
-
args = args.filter((_, i) => i !== configAt && i !== configAt + 1);
|
|
85
|
-
}
|
|
86
|
-
if (args.includes('--no-personal')) {
|
|
87
|
-
automation.no_personal = true;
|
|
88
|
-
args = args.filter((a) => a !== '--no-personal');
|
|
89
|
-
}
|
|
90
|
-
const scopeAt = args.indexOf('--scope');
|
|
91
|
-
const scope = scopeAt === -1 ? undefined : args[scopeAt + 1];
|
|
92
|
-
const rest = scopeAt === -1 ? args : args.filter((_, i) => i !== scopeAt && i !== scopeAt + 1);
|
|
93
|
-
const [verb, key, ...value] = rest;
|
|
94
|
-
if (!verb) {
|
|
95
|
-
out();
|
|
96
|
-
const code = await service('list', {});
|
|
97
|
-
const now = (0, machine_1.machineSettings)();
|
|
98
|
-
for (const [k, spec] of Object.entries(machine_1.MACHINE_KEYS)) {
|
|
99
|
-
const shown = now[k] || '(not set)';
|
|
100
|
-
out(` ${k.padEnd(9)} ${ui.c.bold(shown.padEnd(10))} ${ui.c.dim((0, machine_1.isSet)(k) ? 'this machine' : 'default')} ${ui.c.dim(spec.what)}`);
|
|
101
|
-
}
|
|
102
|
-
out();
|
|
103
|
-
return code;
|
|
104
|
-
}
|
|
105
|
-
if (!key) {
|
|
106
|
-
out(ui.fail(`Say which setting: comprism config ${verb} <name>`));
|
|
107
|
-
return 1;
|
|
108
|
-
}
|
|
109
|
-
if (!machine_1.MACHINE_KEYS[key]) {
|
|
110
|
-
if (!['get', 'set', 'unset'].includes(verb)) {
|
|
111
|
-
out(ui.fail(`\`config ${verb}\` is not a command. Use get, set or unset.`));
|
|
112
|
-
return 2;
|
|
113
|
-
}
|
|
114
|
-
return service(verb, { key, value: value.join(' ').trim(), scope: scope ?? 'local' });
|
|
115
|
-
}
|
|
116
|
-
if (scope && scope !== 'machine' && scope !== 'local')
|
|
117
|
-
return notHere(`--scope ${scope}`);
|
|
118
|
-
if (verb === 'get') {
|
|
119
|
-
out((0, machine_1.machineSettings)()[key] ?? '');
|
|
120
|
-
return 0;
|
|
121
|
-
}
|
|
122
|
-
if (verb === 'set') {
|
|
123
|
-
const why = (0, machine_1.setMachine)(key, value.join(' ').trim());
|
|
124
|
-
if (why) {
|
|
125
|
-
out(ui.fail(why));
|
|
126
|
-
return 1;
|
|
127
|
-
}
|
|
128
|
-
out(ui.ok(`${key} is ${(0, machine_1.machineSettings)()[key]} on this machine.`));
|
|
129
|
-
return 0;
|
|
130
|
-
}
|
|
131
|
-
if (verb === 'unset') {
|
|
132
|
-
(0, machine_1.unsetMachine)(key);
|
|
133
|
-
out(ui.ok(`${key} is back to its default, ${machine_1.MACHINE_KEYS[key]?.fallback || 'not set'}.`));
|
|
134
|
-
return 0;
|
|
135
|
-
}
|
|
136
|
-
out(ui.fail(`\`config ${verb}\` is not a command. Use get, set or unset.`));
|
|
137
|
-
return 1;
|
|
138
|
-
}
|
package/out/commands/cost.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function cmdCost(args: string[]): Promise<number>;
|
package/out/commands/cost.js
DELETED
|
@@ -1,167 +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.cmdCost = cmdCost;
|
|
37
|
-
/**
|
|
38
|
-
* `comprism cost` — what a session cost, and what drove it.
|
|
39
|
-
*
|
|
40
|
-
* ── This file draws. It decides nothing ───────────────────────────────────
|
|
41
|
-
*
|
|
42
|
-
* Every word and every number below is written by `spend_report` on our
|
|
43
|
-
* server: which figures belong on the screen, what each one is called, what
|
|
44
|
-
* order they read in, and how each is formatted. This file receives that and
|
|
45
|
-
* puts it on a terminal.
|
|
46
|
-
*
|
|
47
|
-
* It was not always so. The first cut of this command held the list of cost
|
|
48
|
-
* factors, their labels and their formatting, which meant adding a factor or
|
|
49
|
-
* renaming one obliged every customer to install a new version of the tool to
|
|
50
|
-
* see a figure we had already begun measuring. A published package is the one
|
|
51
|
-
* thing in this product we cannot change, so as little as possible is decided
|
|
52
|
-
* inside it.
|
|
53
|
-
*
|
|
54
|
-
* What genuinely has to stay here is drawing: the server does not know the
|
|
55
|
-
* width of somebody's window or whether their terminal renders color, and
|
|
56
|
-
* finished text sent from a server breaks on a narrow window.
|
|
57
|
-
*
|
|
58
|
-
* A dash is how "nobody measured this" reaches the screen. The server sends
|
|
59
|
-
* null for it, never zero, because a zero in a cost column reads as a
|
|
60
|
-
* measurement.
|
|
61
|
-
*/
|
|
62
|
-
const gateway_1 = require("../lib/gateway");
|
|
63
|
-
const connection_1 = require("../lib/connection");
|
|
64
|
-
const ui = __importStar(require("../lib/ui"));
|
|
65
|
-
const out = (s = '') => process.stdout.write(`${s}\n`);
|
|
66
|
-
/** A cell. Null and undefined are a figure nobody measured, so they print as a dash. */
|
|
67
|
-
const cell = (v) => v === null || v === undefined || v === '' ? ui.c.dim('—') : String(v);
|
|
68
|
-
async function cmdCost(args) {
|
|
69
|
-
const conn = (0, connection_1.readConnection)();
|
|
70
|
-
if (!conn?.url || !conn.workspaceKey) {
|
|
71
|
-
out();
|
|
72
|
-
out(ui.warn('This machine is not signed in, so there is no work to read.'));
|
|
73
|
-
out(` ${ui.c.dim('$')} comprism login`);
|
|
74
|
-
out();
|
|
75
|
-
return 1;
|
|
76
|
-
}
|
|
77
|
-
// The first bare word is a session, when one is given. No flag, because
|
|
78
|
-
// "which session" is the only thing this command takes.
|
|
79
|
-
const wanted = args.find((a) => a && !a.startsWith('-'));
|
|
80
|
-
const reply = await (0, gateway_1.ask)({
|
|
81
|
-
intent: 'spend',
|
|
82
|
-
prompt: '',
|
|
83
|
-
...(wanted ? { spendSession: wanted } : {}),
|
|
84
|
-
});
|
|
85
|
-
// A workspace whose build does not carry this question says so, and that is a
|
|
86
|
-
// complete answer rather than an absence. Reading a refusal as "no spend"
|
|
87
|
-
// would tell somebody their work cost nothing.
|
|
88
|
-
if (reply.served === false) {
|
|
89
|
-
out();
|
|
90
|
-
out(ui.warn('This organization is running a build that cannot answer this yet.'));
|
|
91
|
-
out(` ${ui.c.dim(reply.message || '')}`);
|
|
92
|
-
out();
|
|
93
|
-
return 1;
|
|
94
|
-
}
|
|
95
|
-
const report = reply.spend;
|
|
96
|
-
if (!report || !report.session) {
|
|
97
|
-
out();
|
|
98
|
-
out(ui.info(reply.message || 'No work has been recorded in this organization yet.'));
|
|
99
|
-
out();
|
|
100
|
-
return 0;
|
|
101
|
-
}
|
|
102
|
-
const s = report.session;
|
|
103
|
-
// An older workspace answers without a presentation block. Saying so beats
|
|
104
|
-
// drawing an empty screen, and beats this file inventing the layout again.
|
|
105
|
-
const p = report.presentation;
|
|
106
|
-
if (!p) {
|
|
107
|
-
out();
|
|
108
|
-
out(ui.warn('This organization answered without the breakdown this version draws.'));
|
|
109
|
-
out(` ${ui.c.dim('Deploy the organization, or run `comprism status` to see which one you are on.')}`);
|
|
110
|
-
out();
|
|
111
|
-
return 1;
|
|
112
|
-
}
|
|
113
|
-
out();
|
|
114
|
-
out(ui.banner(String(p.heading || 'What this session cost')));
|
|
115
|
-
out();
|
|
116
|
-
out(` ${ui.c.bold(String(s.title || s.session_id))}`);
|
|
117
|
-
out(ui.c.dim(` ${String(s.started_at || '').slice(0, 16).replace('T', ' ')}`
|
|
118
|
-
+ ` · ${String(s.turns ?? 0)} turn(s)`
|
|
119
|
-
+ ` · ${String(s.surface || 'unknown surface')}`));
|
|
120
|
-
out();
|
|
121
|
-
const headline = (p.headline || []);
|
|
122
|
-
// One line per figure, label, value and the service's note in full, so a
|
|
123
|
-
// word like "estimated" is never cut to fit a box (manual 10.11). A figure
|
|
124
|
-
// nobody measured is blank.
|
|
125
|
-
if (headline.length > 0) {
|
|
126
|
-
for (const h of headline) {
|
|
127
|
-
const value = h.value === null || h.value === undefined ? 'blank' : String(h.value);
|
|
128
|
-
out(` ${String(h.label || '').padEnd(18)} ${ui.c.bold(value.padEnd(9))} ${ui.c.dim(h.note ? String(h.note) : '')}`);
|
|
129
|
-
}
|
|
130
|
-
out();
|
|
131
|
-
}
|
|
132
|
-
const factorRows = (p.factor_rows || []);
|
|
133
|
-
out(ui.c.muted(` ${String(p.factor_heading || '')}`));
|
|
134
|
-
out();
|
|
135
|
-
if (factorRows.length > 0) {
|
|
136
|
-
out(ui.table(p.factor_columns || ['factor', 'cost'], factorRows.map((r) => [String(r.label ?? ''), cell(r.value)])));
|
|
137
|
-
out();
|
|
138
|
-
if (p.driver) {
|
|
139
|
-
out(ui.c.dim(` ${String(p.driver)}`));
|
|
140
|
-
out();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
else if (p.factor_empty) {
|
|
144
|
-
out(ui.c.dim(` ${String(p.factor_empty)}`));
|
|
145
|
-
out();
|
|
146
|
-
}
|
|
147
|
-
const callRows = (p.call_rows || []);
|
|
148
|
-
const callColumns = (p.call_columns || []);
|
|
149
|
-
if (callRows.length > 0 && callColumns.length > 0) {
|
|
150
|
-
out(ui.c.muted(` ${String(p.call_heading || '')}`));
|
|
151
|
-
out();
|
|
152
|
-
out(ui.table(callColumns,
|
|
153
|
-
// Read by the column names the server sent, so a column added there
|
|
154
|
-
// appears here without this file being told about it.
|
|
155
|
-
callRows.map((r) => callColumns.map((k) => cell(r[k])))));
|
|
156
|
-
out();
|
|
157
|
-
}
|
|
158
|
-
if (p.footnote) {
|
|
159
|
-
out(ui.c.dim(` ${String(p.footnote)}`));
|
|
160
|
-
out();
|
|
161
|
-
}
|
|
162
|
-
if (reply.details_url) {
|
|
163
|
-
out(ui.c.dim(` Every figure here traces to its records: ${reply.details_url}`));
|
|
164
|
-
out();
|
|
165
|
-
}
|
|
166
|
-
return 0;
|
|
167
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function cmdDecisionEngine(args: string[]): Promise<number>;
|
|
@@ -1,66 +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.cmdDecisionEngine = cmdDecisionEngine;
|
|
37
|
-
/**
|
|
38
|
-
* `comprism decision-engine [none | <engine>]` (web manual 11.4): whether your
|
|
39
|
-
* work uses the decision engine your company has turned on. With no argument it
|
|
40
|
-
* shows your pick; with one it changes it. The service keeps the pick and words
|
|
41
|
-
* every line, so this matches the drop-down in Work and in VS Code.
|
|
42
|
-
*/
|
|
43
|
-
const gateway_1 = require("../lib/gateway");
|
|
44
|
-
const ui = __importStar(require("../lib/ui"));
|
|
45
|
-
const out = (s = "") => process.stdout.write(s + "\n");
|
|
46
|
-
async function cmdDecisionEngine(args) {
|
|
47
|
-
const choice = args[0];
|
|
48
|
-
const reply = await (0, gateway_1.ask)({
|
|
49
|
-
intent: "decision_engine", prompt: "",
|
|
50
|
-
op: choice ? "set" : "show",
|
|
51
|
-
...(choice ? { payload: { engine: choice === "none" ? null : choice } } : {}),
|
|
52
|
-
});
|
|
53
|
-
if (!reply.ok || reply.served === false) {
|
|
54
|
-
out(ui.fail(reply.served === false
|
|
55
|
-
? "Your organization is running an older build that does not answer this yet."
|
|
56
|
-
: `Your organization could not be reached: ${reply.message || "no answer"}`));
|
|
57
|
-
return 1;
|
|
58
|
-
}
|
|
59
|
-
out();
|
|
60
|
-
if (reply.message)
|
|
61
|
-
out(ui.fail(reply.message));
|
|
62
|
-
for (const line of reply.lines ?? [])
|
|
63
|
-
out(line);
|
|
64
|
-
out();
|
|
65
|
-
return reply.message ? 1 : 0;
|
|
66
|
-
}
|
package/out/commands/hooks.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function cmdHooks(args: string[]): Promise<number>;
|