@illuminis/comprism 0.1.5 → 0.1.6
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/agent/command.js +4 -4
- package/out/agent/session.d.ts +6 -1
- package/out/agent/session.js +17 -8
- package/out/commands/agents.js +3 -3
- package/out/commands/ask.js +8 -8
- package/out/commands/codemap.d.ts +1 -1
- package/out/commands/codemap.js +3 -3
- package/out/commands/commands-thin.js +4 -4
- package/out/commands/config.js +1 -1
- package/out/commands/cost.js +4 -4
- package/out/commands/hooks.js +1 -1
- package/out/commands/install.d.ts +1 -1
- package/out/commands/install.js +3 -2
- package/out/commands/instructions.js +1 -1
- package/out/commands/integrations.js +4 -4
- package/out/commands/keys.js +6 -6
- package/out/commands/login.js +37 -21
- package/out/commands/permissions.js +2 -2
- package/out/commands/plugins.js +3 -3
- package/out/commands/privacy.js +2 -2
- package/out/commands/repl.js +107 -83
- package/out/commands/review.js +6 -6
- package/out/commands/settings.js +30 -123
- package/out/commands/skills.js +2 -2
- package/out/commands/unattended.js +6 -6
- package/out/commands/update.js +1 -1
- package/out/commands/welcome.js +20 -29
- package/out/commands/worktrees.d.ts +1 -1
- package/out/graph/sync.d.ts +1 -1
- package/out/graph/sync.js +6 -6
- package/out/lib/attach.js +4 -3
- package/out/lib/commandlist.d.ts +1 -1
- package/out/lib/commandlist.js +2 -2
- package/out/lib/config.d.ts +3 -2
- package/out/lib/config.js +7 -8
- package/out/lib/connection.js +1 -1
- package/out/lib/gateway.d.ts +5 -5
- package/out/lib/machine.js +1 -1
- package/out/lib/project-ops.d.ts +1 -1
- package/out/lib/project-ops.js +4 -4
- package/out/lib/queue.js +1 -1
- package/out/lib/readiness.d.ts +3 -30
- package/out/lib/readiness.js +13 -82
- package/out/lib/servicecommand.d.ts +14 -0
- package/out/lib/servicecommand.js +74 -0
- package/out/lib/sessions.js +3 -3
- package/out/lib/ui.d.ts +9 -6
- package/out/lib/ui.js +20 -26
- package/out/lib/voice.js +1 -1
- package/out/lib/words.d.ts +20 -0
- package/out/lib/words.js +27 -0
- package/out/machine/codemap/build.d.ts +45 -0
- package/out/machine/codemap/build.js +91 -0
- package/out/machine/codemap/facts.d.ts +47 -0
- package/out/machine/codemap/facts.js +12 -0
- package/out/machine/codemap/files.d.ts +45 -0
- package/out/machine/codemap/files.js +207 -0
- package/out/machine/codemap/read-locales.d.ts +29 -0
- package/out/machine/codemap/read-locales.js +246 -0
- package/out/machine/codemap/read-python.d.ts +11 -0
- package/out/machine/codemap/read-python.js +116 -0
- package/out/machine/codemap/read-typescript.d.ts +16 -0
- package/out/machine/codemap/read-typescript.js +292 -0
- package/out/machine/executor/browser.d.ts +14 -0
- package/out/machine/executor/browser.js +270 -0
- package/out/machine/executor/diagnostics.d.ts +2 -0
- package/out/machine/executor/diagnostics.js +181 -0
- package/out/machine/executor/documents.d.ts +40 -0
- package/out/machine/executor/documents.js +170 -0
- package/out/machine/executor/files.d.ts +2 -0
- package/out/machine/executor/files.js +590 -0
- package/out/machine/executor/git.d.ts +48 -0
- package/out/machine/executor/git.js +145 -0
- package/out/machine/executor/hooks.d.ts +51 -0
- package/out/machine/executor/hooks.js +154 -0
- package/out/machine/executor/index.d.ts +45 -0
- package/out/machine/executor/index.js +367 -0
- package/out/machine/executor/notebook.d.ts +2 -0
- package/out/machine/executor/notebook.js +147 -0
- package/out/machine/executor/paths.d.ts +20 -0
- package/out/machine/executor/paths.js +154 -0
- package/out/machine/executor/sandbox.d.ts +40 -0
- package/out/machine/executor/sandbox.js +299 -0
- package/out/machine/executor/shell.d.ts +86 -0
- package/out/machine/executor/shell.js +582 -0
- package/out/machine/executor/toolservers.d.ts +20 -0
- package/out/machine/executor/toolservers.js +189 -0
- package/out/machine/executor/worktree.d.ts +9 -0
- package/out/machine/executor/worktree.js +119 -0
- package/out/machine/folder/project.d.ts +28 -0
- package/out/machine/folder/project.js +114 -0
- package/out/machine/runtime/home.d.ts +2 -0
- package/out/machine/runtime/home.js +48 -0
- package/out/machine/runtime/needs.d.ts +30 -0
- package/out/machine/runtime/needs.js +89 -0
- package/out/machine/runtime/self.d.ts +23 -0
- package/out/machine/runtime/self.js +124 -0
- package/out/providers/index.js +2 -1
- package/out/thin.js +11 -10
- package/package.json +4 -4
|
@@ -0,0 +1,124 @@
|
|
|
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.isStandalone = isStandalone;
|
|
37
|
+
exports.standaloneBinDir = standaloneBinDir;
|
|
38
|
+
exports.installMethod = installMethod;
|
|
39
|
+
exports.selfLaunch = selfLaunch;
|
|
40
|
+
exports.shippedFile = shippedFile;
|
|
41
|
+
/**
|
|
42
|
+
* How this copy of the tool was installed, and how it starts another copy of
|
|
43
|
+
* itself (manual 1.1).
|
|
44
|
+
*
|
|
45
|
+
* The same code ships two ways. Through npm it is a script that Node runs, so
|
|
46
|
+
* `process.argv[1]` is the script and a second copy is `node <script> <args>`.
|
|
47
|
+
* Through the install script and the Python package it is one ready to run
|
|
48
|
+
* program with Node built in, where `process.argv[1]` is the program again and
|
|
49
|
+
* a second copy is just `<program> <args>`. Passing the program's own path as
|
|
50
|
+
* the first argument there would read as a command called "/Users/me/...", so
|
|
51
|
+
* every place that starts a copy of the tool asks here instead of guessing.
|
|
52
|
+
*/
|
|
53
|
+
const fs = __importStar(require("fs"));
|
|
54
|
+
const path = __importStar(require("path"));
|
|
55
|
+
const home_1 = require("./home");
|
|
56
|
+
let sea;
|
|
57
|
+
/** True when running as the ready to run program rather than under Node. */
|
|
58
|
+
function isStandalone() {
|
|
59
|
+
if (sea === undefined) {
|
|
60
|
+
try {
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
62
|
+
sea = Boolean(require("node:sea").isSea());
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
sea = false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return sea;
|
|
69
|
+
}
|
|
70
|
+
/** Where the install script keeps the program: `~/.comprism/bin`. */
|
|
71
|
+
function standaloneBinDir() {
|
|
72
|
+
return path.join((0, home_1.homeDir)(), "bin");
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Which of the three install options put this copy here.
|
|
76
|
+
*
|
|
77
|
+
* The program is only ever distributed two ways, so where it sits decides it:
|
|
78
|
+
* in `~/.comprism/bin` it came from the install script, anywhere else pip put
|
|
79
|
+
* it. Under Node it came from npm.
|
|
80
|
+
*/
|
|
81
|
+
function installMethod() {
|
|
82
|
+
if (!isStandalone())
|
|
83
|
+
return "npm";
|
|
84
|
+
try {
|
|
85
|
+
const here = fs.realpathSync(process.execPath);
|
|
86
|
+
const bin = fs.realpathSync(standaloneBinDir());
|
|
87
|
+
if (path.dirname(here) === bin)
|
|
88
|
+
return "script";
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// No `~/.comprism/bin`: not an install script install.
|
|
92
|
+
}
|
|
93
|
+
return "python";
|
|
94
|
+
}
|
|
95
|
+
/** The command and arguments that start another copy of this tool. */
|
|
96
|
+
function selfLaunch(args, nodeFlags = []) {
|
|
97
|
+
if (isStandalone())
|
|
98
|
+
return [process.execPath, args];
|
|
99
|
+
return [process.execPath, [...nodeFlags, process.argv[1] ?? "", ...args]];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A file shipped beside the code, as a path on disk.
|
|
103
|
+
*
|
|
104
|
+
* Under npm it sits in the package. Inside the program it is carried as an
|
|
105
|
+
* asset and written once to `~/.comprism/assets`, because the programs it is
|
|
106
|
+
* handed to (Python, for the reader script) need a real file.
|
|
107
|
+
*/
|
|
108
|
+
function shippedFile(name, packagePath) {
|
|
109
|
+
if (!isStandalone())
|
|
110
|
+
return packagePath;
|
|
111
|
+
const target = path.join((0, home_1.homeDir)(), "assets", name);
|
|
112
|
+
try {
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
114
|
+
const text = require("node:sea").getAsset(name, "utf8");
|
|
115
|
+
if (!fs.existsSync(target) || fs.readFileSync(target, "utf8") !== text) {
|
|
116
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
117
|
+
fs.writeFileSync(target, text);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
// An asset that cannot be written leaves the caller's own fallback in charge.
|
|
122
|
+
}
|
|
123
|
+
return target;
|
|
124
|
+
}
|
package/out/providers/index.js
CHANGED
|
@@ -19,6 +19,7 @@ exports.callModel = callModel;
|
|
|
19
19
|
const catalog_1 = require("../internal/catalog");
|
|
20
20
|
const anthropic_1 = require("./anthropic");
|
|
21
21
|
const openai_1 = require("./openai");
|
|
22
|
+
const words_1 = require("../lib/words");
|
|
22
23
|
var anthropic_2 = require("./anthropic");
|
|
23
24
|
Object.defineProperty(exports, "ProviderHttpError", { enumerable: true, get: function () { return anthropic_2.ProviderHttpError; } });
|
|
24
25
|
const DEFAULT_MAX_TOKENS = 4096;
|
|
@@ -62,7 +63,7 @@ async function callModel(call, keys) {
|
|
|
62
63
|
continue;
|
|
63
64
|
}
|
|
64
65
|
const latency = err instanceof anthropic_1.ProviderHttpError ? err.latencyMs : 0;
|
|
65
|
-
return errorResult(err instanceof Error ? err.message :
|
|
66
|
+
return errorResult(err instanceof Error ? err.message : (0, words_1.word)('providerCallFailed'), latency);
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
return errorResult('provider call failed', 0);
|
package/out/thin.js
CHANGED
|
@@ -56,7 +56,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
56
56
|
*/
|
|
57
57
|
const ui = __importStar(require("./lib/ui"));
|
|
58
58
|
const version_1 = require("./lib/version");
|
|
59
|
-
const self_1 = require("./
|
|
59
|
+
const self_1 = require("./machine/runtime/self");
|
|
60
|
+
const words_1 = require("./lib/words");
|
|
60
61
|
const out = (s = '') => process.stdout.write(s + '\n');
|
|
61
62
|
/** A refusal a script reads: always on standard error (Appendix B). */
|
|
62
63
|
const err = (s = '') => process.stderr.write(s + '\n');
|
|
@@ -115,19 +116,19 @@ function usage() {
|
|
|
115
116
|
out();
|
|
116
117
|
out(ui.table(['COMMAND', 'WHAT IT DOES'], [
|
|
117
118
|
['comprism ask "<your question>"', 'one prompt, one answer, and what it cost'],
|
|
118
|
-
['comprism work', 'have it do the work: reads your
|
|
119
|
+
['comprism work', 'have it do the work: reads your workspace, edits, runs your tests'],
|
|
119
120
|
['comprism login', 'sign in with your email and password'],
|
|
120
121
|
['comprism', 'start a session and just type your questions'],
|
|
121
|
-
['comprism --continue', 'carry on the most recent session in this
|
|
122
|
+
['comprism --continue', 'carry on the most recent session in this workspace'],
|
|
122
123
|
['comprism --resume [number]', 'carry on a session; with no number, choose from a list'],
|
|
123
124
|
['comprism sessions', 'your recent sessions, newest first; --search to find one'],
|
|
124
125
|
['comprism keys', 'add a provider key, or point at a file of them'],
|
|
125
126
|
['comprism model', 'the model your savings are measured against'],
|
|
126
127
|
['comprism providers', 'every AI vendor and model, and what you can reach'],
|
|
127
|
-
['comprism
|
|
128
|
+
['comprism workspace', 'the folder to work in, default is where you are'],
|
|
128
129
|
['comprism config', 'settings in force and where each came from'],
|
|
129
130
|
['comprism instructions', 'the instructions the next job receives'],
|
|
130
|
-
['comprism memory', 'this
|
|
131
|
+
['comprism memory', 'this workspace\'s notes'],
|
|
131
132
|
['comprism skills', 'the skills here and where each came from; /name runs one'],
|
|
132
133
|
['comprism integrations', 'outside tools the agent can call, and their sign in'],
|
|
133
134
|
['comprism plugins', 'packs of skills, helpers, hooks and connections'],
|
|
@@ -378,7 +379,7 @@ async function main() {
|
|
|
378
379
|
const reply = await askGateway({ intent: 'usage', prompt: '', tzMinutes: -new Date().getTimezoneOffset() });
|
|
379
380
|
const found = reply.usage;
|
|
380
381
|
if (!reply.ok || reply.served === false || !found?.lines) {
|
|
381
|
-
err(ui.fail(reply.message || 'Usage could not be read from your
|
|
382
|
+
err(ui.fail(reply.message || 'Usage could not be read from your organization.'));
|
|
382
383
|
process.exitCode = exitFor(reply.httpStatus === 401 ? 'signed_out'
|
|
383
384
|
: reply.ok || reply.httpStatus ? 'incomplete' : 'unreachable');
|
|
384
385
|
return;
|
|
@@ -400,7 +401,7 @@ async function main() {
|
|
|
400
401
|
const reply = await askGateway({ intent: 'schema', prompt: '' });
|
|
401
402
|
const doc = reply.schema_doc;
|
|
402
403
|
if (!reply.ok || reply.served === false || !doc?.output) {
|
|
403
|
-
err(ui.fail(reply.message || 'The schema could not be read from your
|
|
404
|
+
err(ui.fail(reply.message || 'The schema could not be read from your organization.'));
|
|
404
405
|
const { exitFor } = await Promise.resolve().then(() => __importStar(require('./lib/output')));
|
|
405
406
|
process.exitCode = exitFor(reply.httpStatus === 401 ? 'signed_out'
|
|
406
407
|
: reply.ok || reply.httpStatus ? 'incomplete' : 'unreachable');
|
|
@@ -512,7 +513,7 @@ async function main() {
|
|
|
512
513
|
const slashWord = /^\/([a-z][a-z0-9-]*)(?:\s|$)/i.exec(request.trim());
|
|
513
514
|
if (slashWord && !(await Promise.resolve().then(() => __importStar(require('./lib/attach')))).startsWithPath(request.trim())) {
|
|
514
515
|
const { fetchCommandList } = await Promise.resolve().then(() => __importStar(require('./lib/commandlist')));
|
|
515
|
-
const { resolveProject } = await Promise.resolve().then(() => __importStar(require('./
|
|
516
|
+
const { resolveProject } = await Promise.resolve().then(() => __importStar(require('./machine/folder/project')));
|
|
516
517
|
const where = flag(args, '--cwd') ?? (await Promise.resolve().then(() => __importStar(require('./commands/settings')))).currentWorkspace().path;
|
|
517
518
|
const list = await fetchCommandList(resolveProject(where).root, []);
|
|
518
519
|
const name = slashWord[1].toLowerCase();
|
|
@@ -562,7 +563,7 @@ async function main() {
|
|
|
562
563
|
?? (await Promise.resolve().then(() => __importStar(require('./commands/settings')))).currentWorkspace().path;
|
|
563
564
|
const worktree = flag(args, '--worktree');
|
|
564
565
|
if (worktree) {
|
|
565
|
-
const { checkFolder, resolveProject } = await Promise.resolve().then(() => __importStar(require('./
|
|
566
|
+
const { checkFolder, resolveProject } = await Promise.resolve().then(() => __importStar(require('./machine/folder/project')));
|
|
566
567
|
const start = checkFolder(workFolder);
|
|
567
568
|
if (!start.ok) {
|
|
568
569
|
out(ui.fail(start.why));
|
|
@@ -842,6 +843,6 @@ async function main() {
|
|
|
842
843
|
}
|
|
843
844
|
}
|
|
844
845
|
main().catch((err) => {
|
|
845
|
-
process.stderr.write(ui.fail(err instanceof Error ? err.message :
|
|
846
|
+
process.stderr.write(ui.fail(err instanceof Error ? err.message : (0, words_1.word)('somethingWrong')) + '\n');
|
|
846
847
|
process.exitCode = 1;
|
|
847
848
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@illuminis/comprism",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "CompletionPrism Companion. Records what finishing a piece of work actually costs - every attempt, and the human time spent noticing and repairing the ones that failed.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"node": ">=22"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "tsc -p ./ && node scripts/build-native.mjs",
|
|
27
|
-
"dev": "tsc -w -p ./",
|
|
26
|
+
"build": "node scripts/sync-machine-services.mjs && tsc -p ./ && node scripts/build-native.mjs",
|
|
27
|
+
"dev": "node scripts/sync-machine-services.mjs && tsc -w -p ./",
|
|
28
28
|
"test": "npm run build && node --test out/**/*.test.js",
|
|
29
29
|
"gate": "npm run build && npm test && npm run shipcheck",
|
|
30
30
|
"prepublishOnly": "npm run build",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|
|
46
46
|
"url": "git+https://github.com/Illuminis-ai/completionprism.git",
|
|
47
|
-
"directory": "app/
|
|
47
|
+
"directory": "app/frontend/terminal"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
50
50
|
"ai",
|