@nightloom/isy 1.0.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 +21 -0
- package/README.md +69 -0
- package/dist/agents/claude.d.ts +6 -0
- package/dist/agents/claude.js +66 -0
- package/dist/agents/claude.js.map +1 -0
- package/dist/agents/codex-records.d.ts +34 -0
- package/dist/agents/codex-records.js +492 -0
- package/dist/agents/codex-records.js.map +1 -0
- package/dist/agents/codex.d.ts +5 -0
- package/dist/agents/codex.js +205 -0
- package/dist/agents/codex.js.map +1 -0
- package/dist/agents/index.d.ts +25 -0
- package/dist/agents/index.js +50 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/kimi-records.d.ts +24 -0
- package/dist/agents/kimi-records.js +252 -0
- package/dist/agents/kimi-records.js.map +1 -0
- package/dist/agents/kimi-wire.d.ts +8 -0
- package/dist/agents/kimi-wire.js +158 -0
- package/dist/agents/kimi-wire.js.map +1 -0
- package/dist/agents/kimi.d.ts +6 -0
- package/dist/agents/kimi.js +332 -0
- package/dist/agents/kimi.js.map +1 -0
- package/dist/agents/types.d.ts +83 -0
- package/dist/agents/types.js +2 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/alert.d.ts +24 -0
- package/dist/alert.js +68 -0
- package/dist/alert.js.map +1 -0
- package/dist/api.d.ts +103 -0
- package/dist/api.js +171 -0
- package/dist/api.js.map +1 -0
- package/dist/commands/analyze.d.ts +61 -0
- package/dist/commands/analyze.js +198 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/check.d.ts +55 -0
- package/dist/commands/check.js +180 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/commit.d.ts +26 -0
- package/dist/commands/commit.js +130 -0
- package/dist/commands/commit.js.map +1 -0
- package/dist/commands/health.d.ts +47 -0
- package/dist/commands/health.js +366 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.js +173 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/logout.d.ts +1 -0
- package/dist/commands/logout.js +30 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/notes.d.ts +11 -0
- package/dist/commands/notes.js +49 -0
- package/dist/commands/notes.js.map +1 -0
- package/dist/commands/scan.d.ts +47 -0
- package/dist/commands/scan.js +199 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/settings.d.ts +15 -0
- package/dist/commands/settings.js +94 -0
- package/dist/commands/settings.js.map +1 -0
- package/dist/commands/status.d.ts +61 -0
- package/dist/commands/status.js +151 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/upload.d.ts +42 -0
- package/dist/commands/upload.js +429 -0
- package/dist/commands/upload.js.map +1 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.js +32 -0
- package/dist/config.js.map +1 -0
- package/dist/detectors.d.ts +43 -0
- package/dist/detectors.js +1026 -0
- package/dist/detectors.js.map +1 -0
- package/dist/git.d.ts +22 -0
- package/dist/git.js +68 -0
- package/dist/git.js.map +1 -0
- package/dist/githook.d.ts +71 -0
- package/dist/githook.js +238 -0
- package/dist/githook.js.map +1 -0
- package/dist/hook.d.ts +39 -0
- package/dist/hook.js +173 -0
- package/dist/hook.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +205 -0
- package/dist/index.js.map +1 -0
- package/dist/log.d.ts +19 -0
- package/dist/log.js +97 -0
- package/dist/log.js.map +1 -0
- package/dist/mask-paths.d.ts +75 -0
- package/dist/mask-paths.js +364 -0
- package/dist/mask-paths.js.map +1 -0
- package/dist/pairing.d.ts +60 -0
- package/dist/pairing.js +137 -0
- package/dist/pairing.js.map +1 -0
- package/dist/parser.d.ts +48 -0
- package/dist/parser.js +516 -0
- package/dist/parser.js.map +1 -0
- package/dist/paths.d.ts +41 -0
- package/dist/paths.js +181 -0
- package/dist/paths.js.map +1 -0
- package/dist/plan.d.ts +25 -0
- package/dist/plan.js +39 -0
- package/dist/plan.js.map +1 -0
- package/dist/queue.d.ts +26 -0
- package/dist/queue.js +120 -0
- package/dist/queue.js.map +1 -0
- package/dist/redact.d.ts +29 -0
- package/dist/redact.js +254 -0
- package/dist/redact.js.map +1 -0
- package/dist/spawn.d.ts +13 -0
- package/dist/spawn.js +32 -0
- package/dist/spawn.js.map +1 -0
- package/dist/stage0.d.ts +20 -0
- package/dist/stage0.js +90 -0
- package/dist/stage0.js.map +1 -0
- package/dist/state.d.ts +84 -0
- package/dist/state.js +150 -0
- package/dist/state.js.map +1 -0
- package/dist/test/analyze.test.d.ts +1 -0
- package/dist/test/analyze.test.js +408 -0
- package/dist/test/analyze.test.js.map +1 -0
- package/dist/test/check.test.d.ts +1 -0
- package/dist/test/check.test.js +193 -0
- package/dist/test/check.test.js.map +1 -0
- package/dist/test/cli.test.d.ts +1 -0
- package/dist/test/cli.test.js +132 -0
- package/dist/test/cli.test.js.map +1 -0
- package/dist/test/codex.test.d.ts +1 -0
- package/dist/test/codex.test.js +585 -0
- package/dist/test/codex.test.js.map +1 -0
- package/dist/test/commit.test.d.ts +1 -0
- package/dist/test/commit.test.js +430 -0
- package/dist/test/commit.test.js.map +1 -0
- package/dist/test/git.test.d.ts +1 -0
- package/dist/test/git.test.js +75 -0
- package/dist/test/git.test.js.map +1 -0
- package/dist/test/health.test.d.ts +1 -0
- package/dist/test/health.test.js +156 -0
- package/dist/test/health.test.js.map +1 -0
- package/dist/test/hook.test.d.ts +1 -0
- package/dist/test/hook.test.js +144 -0
- package/dist/test/hook.test.js.map +1 -0
- package/dist/test/kimi.test.d.ts +1 -0
- package/dist/test/kimi.test.js +349 -0
- package/dist/test/kimi.test.js.map +1 -0
- package/dist/test/mask-paths.test.d.ts +1 -0
- package/dist/test/mask-paths.test.js +230 -0
- package/dist/test/mask-paths.test.js.map +1 -0
- package/dist/test/notes.test.d.ts +1 -0
- package/dist/test/notes.test.js +41 -0
- package/dist/test/notes.test.js.map +1 -0
- package/dist/test/pairing.test.d.ts +1 -0
- package/dist/test/pairing.test.js +138 -0
- package/dist/test/pairing.test.js.map +1 -0
- package/dist/test/parser.test.d.ts +1 -0
- package/dist/test/parser.test.js +312 -0
- package/dist/test/parser.test.js.map +1 -0
- package/dist/test/plan.test.d.ts +1 -0
- package/dist/test/plan.test.js +34 -0
- package/dist/test/plan.test.js.map +1 -0
- package/dist/test/redact.test.d.ts +1 -0
- package/dist/test/redact.test.js +303 -0
- package/dist/test/redact.test.js.map +1 -0
- package/dist/test/settings.test.d.ts +1 -0
- package/dist/test/settings.test.js +32 -0
- package/dist/test/settings.test.js.map +1 -0
- package/dist/test/stage0.test.d.ts +1 -0
- package/dist/test/stage0.test.js +607 -0
- package/dist/test/stage0.test.js.map +1 -0
- package/dist/test/sweep.test.d.ts +1 -0
- package/dist/test/sweep.test.js +298 -0
- package/dist/test/sweep.test.js.map +1 -0
- package/dist/test/update.test.d.ts +1 -0
- package/dist/test/update.test.js +26 -0
- package/dist/test/update.test.js.map +1 -0
- package/dist/test/upload.test.d.ts +1 -0
- package/dist/test/upload.test.js +331 -0
- package/dist/test/upload.test.js.map +1 -0
- package/dist/types.d.ts +142 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/update.d.ts +17 -0
- package/dist/update.js +46 -0
- package/dist/update.js.map +1 -0
- package/package.json +60 -0
- package/src/agents/claude.ts +89 -0
- package/src/agents/codex-records.ts +533 -0
- package/src/agents/codex.ts +238 -0
- package/src/agents/index.ts +58 -0
- package/src/agents/kimi-records.ts +274 -0
- package/src/agents/kimi-wire.ts +179 -0
- package/src/agents/kimi.ts +390 -0
- package/src/agents/types.ts +92 -0
- package/src/alert.ts +68 -0
- package/src/api.ts +269 -0
- package/src/commands/analyze.ts +308 -0
- package/src/commands/check.ts +239 -0
- package/src/commands/commit.ts +179 -0
- package/src/commands/health.ts +444 -0
- package/src/commands/init.ts +186 -0
- package/src/commands/logout.ts +33 -0
- package/src/commands/notes.ts +57 -0
- package/src/commands/scan.ts +278 -0
- package/src/commands/settings.ts +107 -0
- package/src/commands/status.ts +236 -0
- package/src/commands/upload.ts +524 -0
- package/src/config.ts +33 -0
- package/src/detectors.ts +1138 -0
- package/src/git.ts +86 -0
- package/src/githook.ts +269 -0
- package/src/hook.ts +237 -0
- package/src/index.ts +229 -0
- package/src/log.ts +113 -0
- package/src/mask-paths.ts +434 -0
- package/src/pairing.ts +190 -0
- package/src/parser.ts +581 -0
- package/src/paths.ts +191 -0
- package/src/plan.ts +56 -0
- package/src/queue.ts +145 -0
- package/src/redact.ts +335 -0
- package/src/spawn.ts +33 -0
- package/src/stage0.ts +121 -0
- package/src/state.ts +208 -0
- package/src/types.ts +165 -0
- package/src/update.ts +46 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export interface TranscriptMessage {
|
|
2
|
+
role?: string;
|
|
3
|
+
model?: string;
|
|
4
|
+
content?: unknown;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface TranscriptRecord {
|
|
9
|
+
type: string;
|
|
10
|
+
uuid?: string;
|
|
11
|
+
parentUuid?: string | null;
|
|
12
|
+
sessionId?: string;
|
|
13
|
+
timestamp?: string;
|
|
14
|
+
cwd?: string;
|
|
15
|
+
gitBranch?: string;
|
|
16
|
+
version?: string;
|
|
17
|
+
isSidechain?: boolean;
|
|
18
|
+
requestId?: string;
|
|
19
|
+
message?: TranscriptMessage;
|
|
20
|
+
toolUseResult?: unknown;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ContentBlock {
|
|
25
|
+
type: string;
|
|
26
|
+
recordIndex: number;
|
|
27
|
+
uuid?: string;
|
|
28
|
+
timestamp?: string;
|
|
29
|
+
isSidechain: boolean;
|
|
30
|
+
text?: string;
|
|
31
|
+
raw: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ToolResult {
|
|
35
|
+
recordIndex: number;
|
|
36
|
+
uuid?: string;
|
|
37
|
+
timestamp?: string;
|
|
38
|
+
isError: boolean;
|
|
39
|
+
text: string;
|
|
40
|
+
stdout?: string;
|
|
41
|
+
stderr?: string;
|
|
42
|
+
fileContent?: string;
|
|
43
|
+
interrupted: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type SignalCategory =
|
|
47
|
+
| "abandoned_approach"
|
|
48
|
+
| "unverified_assumption"
|
|
49
|
+
| "known_gap"
|
|
50
|
+
| "test_modified_to_pass"
|
|
51
|
+
| "external_dependency"
|
|
52
|
+
| "unverified_fix"
|
|
53
|
+
| "error_suppressed"
|
|
54
|
+
| "destructive_command"
|
|
55
|
+
| "user_correction_ignored"
|
|
56
|
+
| "stale_context";
|
|
57
|
+
|
|
58
|
+
export interface Candidate {
|
|
59
|
+
category: SignalCategory;
|
|
60
|
+
sessionId?: string;
|
|
61
|
+
uuid?: string;
|
|
62
|
+
toolUseId?: string;
|
|
63
|
+
filePath?: string;
|
|
64
|
+
recordIndex: number;
|
|
65
|
+
startedAt?: string;
|
|
66
|
+
endedAt?: string;
|
|
67
|
+
weight: number;
|
|
68
|
+
detail: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ToolUse {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
input: Record<string, unknown>;
|
|
75
|
+
recordIndex: number;
|
|
76
|
+
uuid?: string;
|
|
77
|
+
timestamp?: string;
|
|
78
|
+
isSidechain: boolean;
|
|
79
|
+
result?: ToolResult;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface FileEdit {
|
|
83
|
+
toolUseId: string;
|
|
84
|
+
tool: string;
|
|
85
|
+
filePath: string;
|
|
86
|
+
oldString?: string;
|
|
87
|
+
newString?: string;
|
|
88
|
+
content?: string;
|
|
89
|
+
recordIndex: number;
|
|
90
|
+
uuid?: string;
|
|
91
|
+
timestamp?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface SkipStats {
|
|
95
|
+
lines: number;
|
|
96
|
+
blank: number;
|
|
97
|
+
malformedJson: number;
|
|
98
|
+
notAnObject: number;
|
|
99
|
+
unknownTypes: Record<string, number>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface SessionMeta {
|
|
103
|
+
cwd?: string;
|
|
104
|
+
gitBranch?: string;
|
|
105
|
+
claudeVersion?: string;
|
|
106
|
+
startedAt?: string;
|
|
107
|
+
endedAt?: string;
|
|
108
|
+
assistantRecords: number;
|
|
109
|
+
thinkingBlocks: number;
|
|
110
|
+
editToolUses: number;
|
|
111
|
+
/** Touched a file by any means — see parser.ts:shellWrites. Gates analysis. */
|
|
112
|
+
hasFileEdits: boolean;
|
|
113
|
+
sidechainRecords: number;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface ParsedSession {
|
|
117
|
+
sessionId?: string;
|
|
118
|
+
filePath?: string;
|
|
119
|
+
records: TranscriptRecord[];
|
|
120
|
+
blocks: ContentBlock[];
|
|
121
|
+
toolUses: ToolUse[];
|
|
122
|
+
fileEdits: Map<string, FileEdit[]>;
|
|
123
|
+
filesRead: Set<string>;
|
|
124
|
+
byUuid: Map<string, TranscriptRecord>;
|
|
125
|
+
mainPath: Set<string>;
|
|
126
|
+
meta: SessionMeta;
|
|
127
|
+
skipped: SkipStats;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface SessionFile {
|
|
131
|
+
sessionId: string;
|
|
132
|
+
path: string;
|
|
133
|
+
sizeBytes: number;
|
|
134
|
+
modifiedAt: Date;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* A session found by a scan that had no working directory to start from, so the
|
|
139
|
+
* directory it ran in is an answer rather than a question. Read from the
|
|
140
|
+
* transcript, never derived from its path: `projectSlug` is lossy, and Kimi and
|
|
141
|
+
* Codex file sessions by workspace hash and by date respectively.
|
|
142
|
+
*/
|
|
143
|
+
export interface DiscoveredSession extends SessionFile {
|
|
144
|
+
cwd?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface IsyConfig {
|
|
148
|
+
token?: string;
|
|
149
|
+
githubLogin?: string;
|
|
150
|
+
apiBaseUrl?: string;
|
|
151
|
+
extraRedactPatterns?: string[];
|
|
152
|
+
lastUploadAt?: string;
|
|
153
|
+
/** The client version the server last said it expects. */
|
|
154
|
+
latestVersion?: string;
|
|
155
|
+
/**
|
|
156
|
+
* What the last upload heard about the plan (`plan.ts`). Kept so `isy status`
|
|
157
|
+
* and `isy check` can say the allowance is gone without a call of their own.
|
|
158
|
+
*/
|
|
159
|
+
plan?: {
|
|
160
|
+
tier: string;
|
|
161
|
+
analysesLeft: number;
|
|
162
|
+
credits: number;
|
|
163
|
+
resetsAt?: string;
|
|
164
|
+
};
|
|
165
|
+
}
|
package/src/update.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { sep } from "node:path";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Whether the server's client version is ahead of this one.
|
|
5
|
+
*
|
|
6
|
+
* ponytail: numeric dot-compare, no semver parsing — pre-release tags and build
|
|
7
|
+
* metadata compare as "not newer" rather than wrongly. Pull in a semver library
|
|
8
|
+
* the day the CLI actually ships tagged builds.
|
|
9
|
+
*/
|
|
10
|
+
export function isNewer(latest: string | undefined, current: string): boolean {
|
|
11
|
+
if (!latest || latest === current) return false;
|
|
12
|
+
|
|
13
|
+
const parse = (value: string): number[] | undefined => {
|
|
14
|
+
const parts = value.split(".");
|
|
15
|
+
if (parts.length !== 3) return undefined;
|
|
16
|
+
const numbers = parts.map((part) => Number(part));
|
|
17
|
+
return numbers.every((n) => Number.isInteger(n) && n >= 0) ? numbers : undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const a = parse(latest);
|
|
21
|
+
const b = parse(current);
|
|
22
|
+
if (!a || !b) return false;
|
|
23
|
+
|
|
24
|
+
for (let i = 0; i < 3; i += 1) {
|
|
25
|
+
if (a[i]! !== b[i]!) return a[i]! > b[i]!;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* How this install updates itself. A package under node_modules came from a
|
|
32
|
+
* package manager; anything else is a source checkout, where pulling and
|
|
33
|
+
* rebuilding is the only honest answer — and where `npm install -g` would
|
|
34
|
+
* quietly replace the checkout the developer is working in.
|
|
35
|
+
*/
|
|
36
|
+
export function updateCommand(dir: string = import.meta.dirname): string {
|
|
37
|
+
return dir.includes(`${sep}node_modules${sep}`)
|
|
38
|
+
? "npm install -g @nightloom/isy@latest"
|
|
39
|
+
: "git pull && npm install && npm run build";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The one line the user sees when their client is behind. */
|
|
43
|
+
export function updateNotice(latest: string | undefined, current: string): string | undefined {
|
|
44
|
+
if (!isNewer(latest, current)) return undefined;
|
|
45
|
+
return `isy ${latest} is available (you have ${current}) — update: ${updateCommand()}`;
|
|
46
|
+
}
|