@illuminis/comprism 0.1.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/LICENSE +15 -0
- package/README.md +281 -0
- package/out/agent/command.d.ts +86 -0
- package/out/agent/command.js +259 -0
- package/out/agent/render.d.ts +97 -0
- package/out/agent/render.js +255 -0
- package/out/agent/session.d.ts +175 -0
- package/out/agent/session.js +573 -0
- package/out/commands/ask.d.ts +1 -0
- package/out/commands/ask.js +146 -0
- package/out/commands/codemap.d.ts +2 -0
- package/out/commands/codemap.js +151 -0
- package/out/commands/commands-thin.d.ts +39 -0
- package/out/commands/commands-thin.js +182 -0
- package/out/commands/install.d.ts +163 -0
- package/out/commands/install.js +543 -0
- package/out/commands/keys.d.ts +55 -0
- package/out/commands/keys.js +344 -0
- package/out/commands/login.d.ts +9 -0
- package/out/commands/login.js +384 -0
- package/out/commands/repl.d.ts +1 -0
- package/out/commands/repl.js +752 -0
- package/out/commands/settings.d.ts +21 -0
- package/out/commands/settings.js +244 -0
- package/out/commands/welcome.d.ts +1 -0
- package/out/commands/welcome.js +196 -0
- package/out/executor/documents.d.ts +40 -0
- package/out/executor/documents.js +170 -0
- package/out/executor/files.d.ts +2 -0
- package/out/executor/files.js +360 -0
- package/out/executor/git.d.ts +48 -0
- package/out/executor/git.js +132 -0
- package/out/executor/hooks.d.ts +67 -0
- package/out/executor/hooks.js +247 -0
- package/out/executor/index.d.ts +29 -0
- package/out/executor/index.js +221 -0
- package/out/executor/notebook.d.ts +2 -0
- package/out/executor/notebook.js +147 -0
- package/out/executor/paths.d.ts +15 -0
- package/out/executor/paths.js +126 -0
- package/out/executor/shell.d.ts +41 -0
- package/out/executor/shell.js +336 -0
- package/out/graph/build.d.ts +45 -0
- package/out/graph/build.js +91 -0
- package/out/graph/facts.d.ts +47 -0
- package/out/graph/facts.js +12 -0
- package/out/graph/files.d.ts +45 -0
- package/out/graph/files.js +207 -0
- package/out/graph/read-locales.d.ts +29 -0
- package/out/graph/read-locales.js +246 -0
- package/out/graph/read-python.d.ts +11 -0
- package/out/graph/read-python.js +115 -0
- package/out/graph/read-typescript.d.ts +16 -0
- package/out/graph/read-typescript.js +292 -0
- package/out/graph/sync.d.ts +66 -0
- package/out/graph/sync.js +242 -0
- package/out/lib/attach.d.ts +62 -0
- package/out/lib/attach.js +228 -0
- package/out/lib/config.d.ts +93 -0
- package/out/lib/config.js +198 -0
- package/out/lib/connection.d.ts +73 -0
- package/out/lib/connection.js +188 -0
- package/out/lib/gateway.d.ts +239 -0
- package/out/lib/gateway.js +171 -0
- package/out/lib/prompt.d.ts +34 -0
- package/out/lib/prompt.js +108 -0
- package/out/lib/types.d.ts +417 -0
- package/out/lib/types.js +21 -0
- package/out/lib/ui.d.ts +114 -0
- package/out/lib/ui.js +265 -0
- package/out/lib/version.d.ts +24 -0
- package/out/lib/version.js +27 -0
- package/out/lib/voice.d.ts +50 -0
- package/out/lib/voice.js +218 -0
- package/out/postinstall.d.ts +2 -0
- package/out/postinstall.js +92 -0
- package/out/thin.d.ts +2 -0
- package/out/thin.js +259 -0
- package/package.json +101 -0
- package/scripts/read_python.py +270 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/** The header the tenant reads to decide whether this machine may be served. */
|
|
2
|
+
export declare const WORKSPACE_KEY_HEADER = "x-comprism-key";
|
|
3
|
+
export declare function envScriptPath(): string;
|
|
4
|
+
export declare function pidFilePath(): string;
|
|
5
|
+
export declare function proxyLogPath(): string;
|
|
6
|
+
/** Every profile we should add the line to, that actually exists. */
|
|
7
|
+
export declare function shellProfiles(): string[];
|
|
8
|
+
/**
|
|
9
|
+
* The tenant's own endpoint, and never anything on this machine.
|
|
10
|
+
*
|
|
11
|
+
* Three sources, most specific first: what the caller passed, the connection
|
|
12
|
+
* `comprism login` stored, and the tenant and domain in config. Null when none
|
|
13
|
+
* of them names a tenant, and null is load-bearing - the install then writes a
|
|
14
|
+
* script that exports nothing rather than one that guesses a hostname.
|
|
15
|
+
*/
|
|
16
|
+
export declare function tenantBaseUrl(explicit?: string): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* The script every new shell sources.
|
|
19
|
+
*
|
|
20
|
+
* Written as POSIX shell so it works in bash and zsh alike, and deliberately
|
|
21
|
+
* silent: a shell startup file that prints things is a shell startup file people
|
|
22
|
+
* delete.
|
|
23
|
+
*
|
|
24
|
+
* `OPENAI_BASE_URL` is deliberately NOT set. The hosted interceptor speaks the
|
|
25
|
+
* Anthropic shape today, so pointing an OpenAI client at it would send that
|
|
26
|
+
* client somewhere with no route for it - breaking a working tool in order to
|
|
27
|
+
* measure it, which is the one thing this file exists to prevent. It comes back
|
|
28
|
+
* the day there is an OpenAI-shaped endpoint to point at.
|
|
29
|
+
*/
|
|
30
|
+
export declare function envScript(baseUrl: string | null, workspaceKey?: string | null): string;
|
|
31
|
+
export interface InstallReport {
|
|
32
|
+
envScript: string;
|
|
33
|
+
profilesTouched: string[];
|
|
34
|
+
profilesAlreadyHad: string[];
|
|
35
|
+
/** The tenant endpoint written into the script, or null if none is known. */
|
|
36
|
+
baseUrl: string | null;
|
|
37
|
+
/** Whether this machine holds a workspace key. Without one, nothing is exported. */
|
|
38
|
+
enrolled: boolean;
|
|
39
|
+
binary: LaunchCommand;
|
|
40
|
+
desktop: DesktopReport;
|
|
41
|
+
}
|
|
42
|
+
export interface DesktopReport {
|
|
43
|
+
/** Where the config lives, whether or not we wrote it. */
|
|
44
|
+
configPath: string;
|
|
45
|
+
/** Did the desktop client's config directory exist at all? */
|
|
46
|
+
present: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Always false. Kept so a caller reading this report cannot mistake "we
|
|
49
|
+
* touched the config" for "the connector is live" - the hosted connector is
|
|
50
|
+
* authorized by a consent screen, never by a file we write.
|
|
51
|
+
*/
|
|
52
|
+
registered: boolean;
|
|
53
|
+
/** Did we take an earlier version's stdio entry back out? */
|
|
54
|
+
staleRemoved: boolean;
|
|
55
|
+
/** Set when we deliberately did nothing. */
|
|
56
|
+
note?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Where the desktop client keeps its connector list, per platform.
|
|
60
|
+
*
|
|
61
|
+
* Only the directory the client itself created counts. Creating it ourselves on
|
|
62
|
+
* a machine with no desktop client would leave a config file for an application
|
|
63
|
+
* that is not installed, which is litter.
|
|
64
|
+
*/
|
|
65
|
+
export declare function desktopConfigPath(): string;
|
|
66
|
+
/**
|
|
67
|
+
* Take our STDIO entry back out of Claude Desktop's config, and say what to add
|
|
68
|
+
* instead.
|
|
69
|
+
*
|
|
70
|
+
* This used to REGISTER a stdio server here - `node cli.js mcp` - and that was
|
|
71
|
+
* wrong in a way that cost a real afternoon. That server exposes `record_work`,
|
|
72
|
+
* `completion_receipt` and `coverage`: it only ever OBSERVES. It does not route,
|
|
73
|
+
* it does not answer, so there is no receipt for the client to render, and it
|
|
74
|
+
* appends to `~/.comprism/ledger.jsonl` on this laptop rather than to the
|
|
75
|
+
* tenant, so nothing it records can ever appear in the portal. The install then
|
|
76
|
+
* printed "Claude Desktop connector registered and answering", which was true of
|
|
77
|
+
* the handshake and false about the product.
|
|
78
|
+
*
|
|
79
|
+
* The connector that works is the hosted one, `{tenant}/mcp`, which runs the
|
|
80
|
+
* same nine steps as every other surface, returns the answer with the receipt
|
|
81
|
+
* attached, and writes the turn to the tenant. It is added by pasting its
|
|
82
|
+
* address into Claude Desktop's own Connectors dialog, because a remote
|
|
83
|
+
* connector is authorized by an OAuth consent screen that only the person
|
|
84
|
+
* sitting there can approve - there is nothing an installer could write into a
|
|
85
|
+
* file to stand in for that.
|
|
86
|
+
*
|
|
87
|
+
* So this now does the honest thing: removes a stale entry of ours if one is
|
|
88
|
+
* there, never writes one, and returns the address for the caller to print. Two
|
|
89
|
+
* things it still will never do: create the file on a machine where the desktop
|
|
90
|
+
* client is not installed, and overwrite a config it could not parse.
|
|
91
|
+
*/
|
|
92
|
+
export declare function installDesktopConnector(_binary: LaunchCommand): DesktopReport;
|
|
93
|
+
/**
|
|
94
|
+
* Start the connector exactly as the desktop client will, and see if it answers.
|
|
95
|
+
*
|
|
96
|
+
* Written after a live failure that the installer had already called a success.
|
|
97
|
+
* `npm install -g .` from a checkout leaves the global package as a SYMLINK back
|
|
98
|
+
* into the source folder; on macOS the desktop client is sandboxed out of
|
|
99
|
+
* `~/Documents`, so the connector died on `EPERM` the moment it was launched -
|
|
100
|
+
* and the only trace was a log file nobody thinks to open. The installer said
|
|
101
|
+
* "registered", which was true and useless.
|
|
102
|
+
*
|
|
103
|
+
* So registration is no longer the claim. This spawns the real command, speaks
|
|
104
|
+
* the real handshake and waits for the real reply. A connector that cannot start
|
|
105
|
+
* is reported as broken, with the reason, at install time.
|
|
106
|
+
*/
|
|
107
|
+
export declare function probeDesktopConnector(binary: LaunchCommand): Promise<{
|
|
108
|
+
ok: boolean;
|
|
109
|
+
detail: string;
|
|
110
|
+
}>;
|
|
111
|
+
/** Take the connector back out, leaving every other server alone. */
|
|
112
|
+
export declare function uninstallDesktopConnector(): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Do the setup. Idempotent: running it twice changes nothing the second time.
|
|
115
|
+
*/
|
|
116
|
+
export declare function install(options?: {
|
|
117
|
+
baseUrl?: string;
|
|
118
|
+
binary?: LaunchCommand;
|
|
119
|
+
workspaceKey?: string | null;
|
|
120
|
+
}): InstallReport;
|
|
121
|
+
/** Take the line back out. An install you cannot cleanly undo is a liability. */
|
|
122
|
+
export declare function uninstall(): {
|
|
123
|
+
profilesCleaned: string[];
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* The command that starts this package's CLI, resolved from the package itself.
|
|
127
|
+
*
|
|
128
|
+
* It used to read `process.argv[1]` and assume that was the CLI. That holds when
|
|
129
|
+
* a person types `comprism install`, and is FALSE in the one case that matters
|
|
130
|
+
* most: the npm postinstall hook, where argv[1] is `postinstall.js`. So a global
|
|
131
|
+
* install wrote `node .../postinstall.js mcp` into the desktop config, and the
|
|
132
|
+
* connector "disconnected" on every launch - postinstall ignores the argument,
|
|
133
|
+
* does its work and exits, which looks exactly like a crash from the outside.
|
|
134
|
+
* It also silently overwrote a correct entry written moments earlier.
|
|
135
|
+
*
|
|
136
|
+
* Resolving from `__dirname` instead removes the guess: this file compiles to
|
|
137
|
+
* `out/install.js`, so the CLI is always `out/cli.js` beside it, whoever is
|
|
138
|
+
* calling and from where.
|
|
139
|
+
*/
|
|
140
|
+
/**
|
|
141
|
+
* How to start the CLI: a command and its arguments, kept apart.
|
|
142
|
+
*
|
|
143
|
+
* Apart, and never joined with a space, because "/Users/me/Code - Illuminis/…"
|
|
144
|
+
* is an ordinary macOS path and splitting on spaces turns it into three
|
|
145
|
+
* arguments and a connector that cannot launch. A shell string and an argv are
|
|
146
|
+
* different types; treating them as one is a bug waiting for the first customer
|
|
147
|
+
* whose folder has a space in it, which on a Mac is most of them.
|
|
148
|
+
*/
|
|
149
|
+
export interface LaunchCommand {
|
|
150
|
+
command: string;
|
|
151
|
+
args: string[];
|
|
152
|
+
}
|
|
153
|
+
/** The shell form, quoted, for the profile script that must be a shell string. */
|
|
154
|
+
export declare function launchShellString(launch: LaunchCommand): string;
|
|
155
|
+
export declare function proxyHealthy(port: number): Promise<boolean>;
|
|
156
|
+
/**
|
|
157
|
+
* Start the proxy detached, so it outlives the shell that started it.
|
|
158
|
+
*
|
|
159
|
+
* Returns whether it came up. Never throws: a service that fails to start is a
|
|
160
|
+
* missing measurement, and the caller's job is to carry on regardless.
|
|
161
|
+
*/
|
|
162
|
+
export declare function startDaemon(port: number): Promise<boolean>;
|
|
163
|
+
export declare function stopDaemon(): boolean;
|