@codeledger/instrument 0.1.1
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 +27 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/preflight.d.ts +8 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/preflight.js +126 -0
- package/dist/preflight.js.map +1 -0
- package/dist/process-probe.d.ts +14 -0
- package/dist/process-probe.d.ts.map +1 -0
- package/dist/process-probe.js +87 -0
- package/dist/process-probe.js.map +1 -0
- package/dist/recorder.d.ts +12 -0
- package/dist/recorder.d.ts.map +1 -0
- package/dist/recorder.js +32 -0
- package/dist/recorder.js.map +1 -0
- package/dist/snapshotter.d.ts +7 -0
- package/dist/snapshotter.d.ts.map +1 -0
- package/dist/snapshotter.js +44 -0
- package/dist/snapshotter.js.map +1 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Intelligent Context AI, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Note: This license applies to the CLI wrapper, types, repository scanning,
|
|
26
|
+
instrumentation, harness, and report packages (the "Plugin"). The scoring
|
|
27
|
+
engine (packages/core-engine/bin/) is licensed separately under LICENSE-CORE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { runPreflight, validatePreflight } from './preflight.js';
|
|
2
|
+
export { validateGitRef, ensureCleanOrFail, resolveRef, getHeadCommit, getShortRef, isRepoDirty, } from './snapshotter.js';
|
|
3
|
+
export { execCommand, execCommandAsync } from './process-probe.js';
|
|
4
|
+
export { RunRecorder } from './recorder.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { runPreflight, validatePreflight } from './preflight.js';
|
|
2
|
+
export { validateGitRef, ensureCleanOrFail, resolveRef, getHeadCommit, getShortRef, isRepoDirty, } from './snapshotter.js';
|
|
3
|
+
export { execCommand, execCommandAsync } from './process-probe.js';
|
|
4
|
+
export { RunRecorder } from './recorder.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PreflightResult } from '@codeledger/types';
|
|
2
|
+
export declare function runPreflight(cwd: string, configPath?: string, indexPath?: string): PreflightResult;
|
|
3
|
+
export declare function validatePreflight(result: PreflightResult, level: 'init' | 'scan' | 'bundle' | 'run', force?: boolean): {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
errors: string[];
|
|
6
|
+
warnings: string[];
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=preflight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../src/preflight.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,eAAe,CAsFjB;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,EACzC,KAAK,GAAE,OAAe,GACrB;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA8CvD"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, accessSync, constants } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
export function runPreflight(cwd, configPath, indexPath) {
|
|
5
|
+
const result = {
|
|
6
|
+
git_installed: false,
|
|
7
|
+
inside_git_repo: false,
|
|
8
|
+
repo_clean: false,
|
|
9
|
+
worktree_supported: false,
|
|
10
|
+
worktree_root_writable: false,
|
|
11
|
+
node_version: process.version,
|
|
12
|
+
config_exists: false,
|
|
13
|
+
repo_index_exists: false,
|
|
14
|
+
};
|
|
15
|
+
// Check git installed
|
|
16
|
+
try {
|
|
17
|
+
execSync('git --version', { cwd, encoding: 'utf-8', stdio: 'pipe' });
|
|
18
|
+
result.git_installed = true;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
// Check inside git repo
|
|
24
|
+
try {
|
|
25
|
+
execSync('git rev-parse --git-dir', { cwd, encoding: 'utf-8', stdio: 'pipe' });
|
|
26
|
+
result.inside_git_repo = true;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
// Check repo clean
|
|
32
|
+
try {
|
|
33
|
+
const status = execSync('git status --porcelain', {
|
|
34
|
+
cwd,
|
|
35
|
+
encoding: 'utf-8',
|
|
36
|
+
stdio: 'pipe',
|
|
37
|
+
});
|
|
38
|
+
result.repo_clean = status.trim().length === 0;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Treat error as dirty
|
|
42
|
+
}
|
|
43
|
+
// Check worktree support (git >= 2.15)
|
|
44
|
+
try {
|
|
45
|
+
const versionStr = execSync('git --version', {
|
|
46
|
+
cwd,
|
|
47
|
+
encoding: 'utf-8',
|
|
48
|
+
stdio: 'pipe',
|
|
49
|
+
});
|
|
50
|
+
const match = versionStr.match(/(\d+)\.(\d+)/);
|
|
51
|
+
if (match) {
|
|
52
|
+
const major = parseInt(match[1], 10);
|
|
53
|
+
const minor = parseInt(match[2], 10);
|
|
54
|
+
result.worktree_supported = major > 2 || (major === 2 && minor >= 15);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// Assume not supported
|
|
59
|
+
}
|
|
60
|
+
// Check worktree root writable
|
|
61
|
+
const worktreeRoot = join(cwd, '.codeledger', 'worktrees');
|
|
62
|
+
try {
|
|
63
|
+
if (existsSync(worktreeRoot)) {
|
|
64
|
+
accessSync(worktreeRoot, constants.W_OK);
|
|
65
|
+
result.worktree_root_writable = true;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// Check parent writable
|
|
69
|
+
const parent = join(cwd, '.codeledger');
|
|
70
|
+
if (existsSync(parent)) {
|
|
71
|
+
accessSync(parent, constants.W_OK);
|
|
72
|
+
result.worktree_root_writable = true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Not writable
|
|
78
|
+
}
|
|
79
|
+
// Check config exists
|
|
80
|
+
if (configPath) {
|
|
81
|
+
result.config_exists = existsSync(configPath);
|
|
82
|
+
}
|
|
83
|
+
// Check repo index exists
|
|
84
|
+
if (indexPath) {
|
|
85
|
+
result.repo_index_exists = existsSync(indexPath);
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
export function validatePreflight(result, level, force = false) {
|
|
90
|
+
const errors = [];
|
|
91
|
+
const warnings = [];
|
|
92
|
+
if (!result.git_installed) {
|
|
93
|
+
errors.push('Git is not installed. Install git and try again.');
|
|
94
|
+
}
|
|
95
|
+
if (!result.inside_git_repo) {
|
|
96
|
+
errors.push('Not inside a git repository. Run "git init" first.');
|
|
97
|
+
}
|
|
98
|
+
if (level === 'init') {
|
|
99
|
+
return { ok: errors.length === 0, errors, warnings };
|
|
100
|
+
}
|
|
101
|
+
if (!result.config_exists) {
|
|
102
|
+
errors.push('No .codeledger/config.json found. Run "codeledger init" first.');
|
|
103
|
+
}
|
|
104
|
+
if (level === 'scan') {
|
|
105
|
+
return { ok: errors.length === 0, errors, warnings };
|
|
106
|
+
}
|
|
107
|
+
if (!result.repo_index_exists && level !== 'bundle') {
|
|
108
|
+
errors.push('No repo index found. Run "codeledger scan" first.');
|
|
109
|
+
}
|
|
110
|
+
if (level === 'run') {
|
|
111
|
+
if (!result.repo_clean && !force) {
|
|
112
|
+
warnings.push('Working directory has uncommitted changes. Use --force to proceed or commit first.');
|
|
113
|
+
}
|
|
114
|
+
if (!result.worktree_supported) {
|
|
115
|
+
warnings.push('Git worktree not supported (requires git >= 2.15). Worktrees will be disabled.');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const hasBlockingWarnings = !force && warnings.length > 0 &&
|
|
119
|
+
warnings.some((w) => w.includes('uncommitted'));
|
|
120
|
+
return {
|
|
121
|
+
ok: errors.length === 0 && !hasBlockingWarnings,
|
|
122
|
+
errors,
|
|
123
|
+
warnings,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=preflight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight.js","sourceRoot":"","sources":["../src/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,UAAU,YAAY,CAC1B,GAAW,EACX,UAAmB,EACnB,SAAkB;IAEl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gF,CAAC,CAAC;QAClG,CAAC;IACH,CAAC;IAED,MAAM,mBAAmB,GAAG,CAAC,KAAK,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QACvD,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IAElD,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,mBAAmB;QAC/C,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ExecResult } from '@codeledger/types';
|
|
2
|
+
export declare function execCommand(cmd: string, opts?: {
|
|
3
|
+
cwd?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
env?: Record<string, string>;
|
|
6
|
+
}): ExecResult;
|
|
7
|
+
export declare function execCommandAsync(cmd: string, opts?: {
|
|
8
|
+
cwd?: string;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
stdoutLog?: string;
|
|
12
|
+
stderrLog?: string;
|
|
13
|
+
}): Promise<ExecResult>;
|
|
14
|
+
//# sourceMappingURL=process-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-probe.d.ts","sourceRoot":"","sources":["../src/process-probe.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE;IACJ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzB,GACL,UAAU,CA8BZ;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,IAAI,GAAE;IACJ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,OAAO,CAAC,UAAU,CAAC,CA4DrB"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { execSync, spawn } from 'node:child_process';
|
|
2
|
+
import { writeFileSync } from 'node:fs';
|
|
3
|
+
export function execCommand(cmd, opts = {}) {
|
|
4
|
+
const start = Date.now();
|
|
5
|
+
try {
|
|
6
|
+
const stdout = execSync(cmd, {
|
|
7
|
+
cwd: opts.cwd,
|
|
8
|
+
encoding: 'utf-8',
|
|
9
|
+
timeout: opts.timeout ?? 300_000,
|
|
10
|
+
env: { ...process.env, ...opts.env },
|
|
11
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
12
|
+
maxBuffer: 50 * 1024 * 1024,
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
exit_code: 0,
|
|
16
|
+
duration_ms: Date.now() - start,
|
|
17
|
+
stdout,
|
|
18
|
+
stderr: '',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
const e = err;
|
|
23
|
+
return {
|
|
24
|
+
exit_code: e.status ?? 1,
|
|
25
|
+
duration_ms: Date.now() - start,
|
|
26
|
+
stdout: e.stdout ?? '',
|
|
27
|
+
stderr: e.stderr ?? '',
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export async function execCommandAsync(cmd, opts = {}) {
|
|
32
|
+
return new Promise((resolve) => {
|
|
33
|
+
const start = Date.now();
|
|
34
|
+
const child = spawn('sh', ['-c', cmd], {
|
|
35
|
+
cwd: opts.cwd,
|
|
36
|
+
env: { ...process.env, ...opts.env },
|
|
37
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
38
|
+
});
|
|
39
|
+
let stdout = '';
|
|
40
|
+
let stderr = '';
|
|
41
|
+
child.stdout.on('data', (data) => {
|
|
42
|
+
stdout += data.toString();
|
|
43
|
+
});
|
|
44
|
+
child.stderr.on('data', (data) => {
|
|
45
|
+
stderr += data.toString();
|
|
46
|
+
});
|
|
47
|
+
let timedOut = false;
|
|
48
|
+
const timer = opts.timeout
|
|
49
|
+
? setTimeout(() => {
|
|
50
|
+
timedOut = true;
|
|
51
|
+
child.kill('SIGTERM');
|
|
52
|
+
}, opts.timeout)
|
|
53
|
+
: null;
|
|
54
|
+
child.on('error', (err) => {
|
|
55
|
+
if (timer)
|
|
56
|
+
clearTimeout(timer);
|
|
57
|
+
resolve({
|
|
58
|
+
exit_code: 1,
|
|
59
|
+
duration_ms: Date.now() - start,
|
|
60
|
+
stdout,
|
|
61
|
+
stderr: stderr || String(err),
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
child.on('close', (code) => {
|
|
65
|
+
if (timer)
|
|
66
|
+
clearTimeout(timer);
|
|
67
|
+
try {
|
|
68
|
+
if (opts.stdoutLog) {
|
|
69
|
+
writeFileSync(opts.stdoutLog, stdout);
|
|
70
|
+
}
|
|
71
|
+
if (opts.stderrLog) {
|
|
72
|
+
writeFileSync(opts.stderrLog, stderr);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// Non-fatal: log write failure should not prevent result delivery
|
|
77
|
+
}
|
|
78
|
+
resolve({
|
|
79
|
+
exit_code: timedOut ? 124 : (code ?? 1),
|
|
80
|
+
duration_ms: Date.now() - start,
|
|
81
|
+
stdout,
|
|
82
|
+
stderr,
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=process-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-probe.js","sourceRoot":"","sources":["../src/process-probe.ts"],"names":[],"m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AC;aAC9B,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACzB,IAAI,KAAK;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YAE/B,IAAI,CAAC;gBACH,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;oBACnB,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;gBACxC,CAAC;gBACD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;oBACnB,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;gBACxC,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,kEAAkE;YACpE,CAAC;YAED,OAAO,CAAC;gBACN,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;gBACvC,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;gBAC/B,MAAM;gBACN,MAAM;aACP,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LedgerStore } from '@codeledger/core';
|
|
2
|
+
import type { RunIdentity, RunStatus, EventType } from '@codeledger/types';
|
|
3
|
+
export declare class RunRecorder {
|
|
4
|
+
private ledger;
|
|
5
|
+
private runId;
|
|
6
|
+
constructor(ledger: LedgerStore, runId?: string);
|
|
7
|
+
get id(): string;
|
|
8
|
+
startRun(identity: Omit<RunIdentity, 'run_id'>): void;
|
|
9
|
+
recordEvent(type: EventType, payload: unknown): void;
|
|
10
|
+
finishRun(status: RunStatus, summary?: unknown): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=recorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../src/recorder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAEV,WAAW,EACX,SAAS,EACT,SAAS,EAEV,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,KAAK,CAAS;gBAEV,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM;IAK/C,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,IAAI;IAOrD,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAWpD,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;CAGtD"}
|
package/dist/recorder.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
export class RunRecorder {
|
|
3
|
+
ledger;
|
|
4
|
+
runId;
|
|
5
|
+
constructor(ledger, runId) {
|
|
6
|
+
this.ledger = ledger;
|
|
7
|
+
this.runId = runId ?? `run_${randomUUID().slice(0, 12)}`;
|
|
8
|
+
}
|
|
9
|
+
get id() {
|
|
10
|
+
return this.runId;
|
|
11
|
+
}
|
|
12
|
+
startRun(identity) {
|
|
13
|
+
this.ledger.startRun({
|
|
14
|
+
...identity,
|
|
15
|
+
run_id: this.runId,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
recordEvent(type, payload) {
|
|
19
|
+
const event = {
|
|
20
|
+
event_id: `evt_${randomUUID().slice(0, 12)}`,
|
|
21
|
+
run_id: this.runId,
|
|
22
|
+
ts: new Date().toISOString(),
|
|
23
|
+
type,
|
|
24
|
+
payload,
|
|
25
|
+
};
|
|
26
|
+
this.ledger.append(event);
|
|
27
|
+
}
|
|
28
|
+
finishRun(status, summary) {
|
|
29
|
+
this.ledger.finishRun(this.runId, status, summary);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=recorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorder.js","sourceRoot":"","sources":["../src/recorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUzC,MAAM,OAAO,WAAW;IACd,MAAM,CAAc;IACpB,KAAK,CAAS;IAEtB,YAAY,MAAmB,EAAE,KAAc;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,OAAO,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IAC3D,CAAC;IAED,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,QAAQ,CAAC,QAAqC;QAC5C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,GAAG,QAAQ;YACX,MAAM,EAAE,IAAI,CAAC,KAAK;SACnB,CAAC,CAAC;IACL,CAAC;IAED,WAAW,CAAC,IAAe,EAAE,OAAgB;QAC3C,MAAM,KAAK,GAAgB;YACzB,QAAQ,EAAE,OAAO,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;YAC5C,MAAM,EAAE,IAAI,CAAC,KAAK;YAClB,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAiB;YAC3C,IAAI;YACJ,OAAO;SACR,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,SAAS,CAAC,MAAiB,EAAE,OAAiB;QAC5C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function validateGitRef(ref: string): void;
|
|
2
|
+
export declare function ensureCleanOrFail(root: string): void;
|
|
3
|
+
export declare function resolveRef(root: string, ref: string): string;
|
|
4
|
+
export declare function getHeadCommit(root: string): string;
|
|
5
|
+
export declare function getShortRef(root: string): string;
|
|
6
|
+
export declare function isRepoDirty(root: string): boolean;
|
|
7
|
+
//# sourceMappingURL=snapshotter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshotter.d.ts","sourceRoot":"","sources":["../src/snapshotter.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAIhD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAYpD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAO5D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMhD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOjD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
const GIT_REF_PATTERN = /^[a-zA-Z0-9._\-/~^@{}]+$/;
|
|
3
|
+
export function validateGitRef(ref) {
|
|
4
|
+
if (!GIT_REF_PATTERN.test(ref)) {
|
|
5
|
+
throw new Error(`Invalid git ref: "${ref}" contains disallowed characters`);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export function ensureCleanOrFail(root) {
|
|
9
|
+
const status = execFileSync('git', ['status', '--porcelain'], {
|
|
10
|
+
cwd: root,
|
|
11
|
+
encoding: 'utf-8',
|
|
12
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
13
|
+
}).trim();
|
|
14
|
+
if (status.length > 0) {
|
|
15
|
+
throw new Error('Working directory is not clean. Commit or stash changes before running.');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function resolveRef(root, ref) {
|
|
19
|
+
validateGitRef(ref);
|
|
20
|
+
return execFileSync('git', ['rev-parse', '--verify', ref], {
|
|
21
|
+
cwd: root,
|
|
22
|
+
encoding: 'utf-8',
|
|
23
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
24
|
+
}).trim();
|
|
25
|
+
}
|
|
26
|
+
export function getHeadCommit(root) {
|
|
27
|
+
return resolveRef(root, 'HEAD');
|
|
28
|
+
}
|
|
29
|
+
export function getShortRef(root) {
|
|
30
|
+
return execFileSync('git', ['rev-parse', '--short', 'HEAD'], {
|
|
31
|
+
cwd: root,
|
|
32
|
+
encoding: 'utf-8',
|
|
33
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
34
|
+
}).trim();
|
|
35
|
+
}
|
|
36
|
+
export function isRepoDirty(root) {
|
|
37
|
+
const status = execFileSync('git', ['status', '--porcelain'], {
|
|
38
|
+
cwd: root,
|
|
39
|
+
encoding: 'utf-8',
|
|
40
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
41
|
+
}).trim();
|
|
42
|
+
return status.length > 0;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=snapshotter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshotter.js","sourceRoot":"","sources":["../src/snapshotter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAEnD,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,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QAAQ,EAAE,aAAa,CAAC,EAAE;QAC5D,GAAG,EAAE,IAAI;QACT,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;KAChC,CAAC,CAAC,IAAI,EAAE,CAAC;IACV,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AAC3B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codeledger/instrument",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Runtime instrumentation and recording for CodeLedger",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/codeledgerECF/codeledger-blackbox.git",
|
|
10
|
+
"directory": "packages/instrument"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@codeledger/types": "0.1.1",
|
|
28
|
+
"@codeledger/core": "0.1.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "^5.4.0"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc",
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"clean": "rm -rf dist"
|
|
37
|
+
}
|
|
38
|
+
}
|