@opensip-tools/contracts 1.0.4

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.
Files changed (86) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/.turbo/turbo-typecheck.log +4 -0
  3. package/LICENSE +21 -0
  4. package/dist/__tests__/dashboard.test.d.ts +2 -0
  5. package/dist/__tests__/dashboard.test.d.ts.map +1 -0
  6. package/dist/__tests__/dashboard.test.js +85 -0
  7. package/dist/__tests__/dashboard.test.js.map +1 -0
  8. package/dist/__tests__/exit-codes.test.d.ts +2 -0
  9. package/dist/__tests__/exit-codes.test.d.ts.map +1 -0
  10. package/dist/__tests__/exit-codes.test.js +73 -0
  11. package/dist/__tests__/exit-codes.test.js.map +1 -0
  12. package/dist/__tests__/store.test.d.ts +2 -0
  13. package/dist/__tests__/store.test.d.ts.map +1 -0
  14. package/dist/__tests__/store.test.js +169 -0
  15. package/dist/__tests__/store.test.js.map +1 -0
  16. package/dist/exit-codes.d.ts +14 -0
  17. package/dist/exit-codes.d.ts.map +1 -0
  18. package/dist/exit-codes.js +61 -0
  19. package/dist/exit-codes.js.map +1 -0
  20. package/dist/index.d.ts +21 -0
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/index.js +20 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/persistence/dashboard/checks.d.ts +7 -0
  25. package/dist/persistence/dashboard/checks.d.ts.map +1 -0
  26. package/dist/persistence/dashboard/checks.js +279 -0
  27. package/dist/persistence/dashboard/checks.js.map +1 -0
  28. package/dist/persistence/dashboard/css.d.ts +6 -0
  29. package/dist/persistence/dashboard/css.d.ts.map +1 -0
  30. package/dist/persistence/dashboard/css.js +141 -0
  31. package/dist/persistence/dashboard/css.js.map +1 -0
  32. package/dist/persistence/dashboard/generator.d.ts +9 -0
  33. package/dist/persistence/dashboard/generator.d.ts.map +1 -0
  34. package/dist/persistence/dashboard/generator.js +79 -0
  35. package/dist/persistence/dashboard/generator.js.map +1 -0
  36. package/dist/persistence/dashboard/index.d.ts +5 -0
  37. package/dist/persistence/dashboard/index.d.ts.map +1 -0
  38. package/dist/persistence/dashboard/index.js +5 -0
  39. package/dist/persistence/dashboard/index.js.map +1 -0
  40. package/dist/persistence/dashboard/overview.d.ts +6 -0
  41. package/dist/persistence/dashboard/overview.d.ts.map +1 -0
  42. package/dist/persistence/dashboard/overview.js +65 -0
  43. package/dist/persistence/dashboard/overview.js.map +1 -0
  44. package/dist/persistence/dashboard/recipes.d.ts +6 -0
  45. package/dist/persistence/dashboard/recipes.d.ts.map +1 -0
  46. package/dist/persistence/dashboard/recipes.js +68 -0
  47. package/dist/persistence/dashboard/recipes.js.map +1 -0
  48. package/dist/persistence/dashboard/sessions.d.ts +6 -0
  49. package/dist/persistence/dashboard/sessions.d.ts.map +1 -0
  50. package/dist/persistence/dashboard/sessions.js +205 -0
  51. package/dist/persistence/dashboard/sessions.js.map +1 -0
  52. package/dist/persistence/dashboard/shared.d.ts +6 -0
  53. package/dist/persistence/dashboard/shared.d.ts.map +1 -0
  54. package/dist/persistence/dashboard/shared.js +211 -0
  55. package/dist/persistence/dashboard/shared.js.map +1 -0
  56. package/dist/persistence/dashboard/tool-tabs.d.ts +6 -0
  57. package/dist/persistence/dashboard/tool-tabs.d.ts.map +1 -0
  58. package/dist/persistence/dashboard/tool-tabs.js +102 -0
  59. package/dist/persistence/dashboard/tool-tabs.js.map +1 -0
  60. package/dist/persistence/store.d.ts +103 -0
  61. package/dist/persistence/store.d.ts.map +1 -0
  62. package/dist/persistence/store.js +156 -0
  63. package/dist/persistence/store.js.map +1 -0
  64. package/dist/types.d.ts +279 -0
  65. package/dist/types.d.ts.map +1 -0
  66. package/dist/types.js +2 -0
  67. package/dist/types.js.map +1 -0
  68. package/package.json +35 -0
  69. package/src/__tests__/dashboard.test.ts +102 -0
  70. package/src/__tests__/exit-codes.test.ts +87 -0
  71. package/src/__tests__/store.test.ts +213 -0
  72. package/src/exit-codes.ts +74 -0
  73. package/src/index.ts +71 -0
  74. package/src/persistence/dashboard/checks.ts +279 -0
  75. package/src/persistence/dashboard/css.ts +141 -0
  76. package/src/persistence/dashboard/generator.ts +89 -0
  77. package/src/persistence/dashboard/index.ts +5 -0
  78. package/src/persistence/dashboard/overview.ts +65 -0
  79. package/src/persistence/dashboard/recipes.ts +68 -0
  80. package/src/persistence/dashboard/sessions.ts +205 -0
  81. package/src/persistence/dashboard/shared.ts +211 -0
  82. package/src/persistence/dashboard/tool-tabs.ts +102 -0
  83. package/src/persistence/store.ts +233 -0
  84. package/src/types.ts +306 -0
  85. package/tsconfig.json +8 -0
  86. package/vitest.config.ts +16 -0
@@ -0,0 +1,103 @@
1
+ /**
2
+ * JSON file persistence for opensip-tools results.
3
+ *
4
+ * Sessions land at `<project>/opensip-tools/.runtime/sessions/`
5
+ * (per-project). Each run creates one file:
6
+ * `{timestamp}-{tool}-{recipe}.json`.
7
+ *
8
+ * The CLI bootstrap calls `configurePersistencePaths(projectPaths)`
9
+ * once on startup with paths from `resolveProjectPaths(cwd)`. Until
10
+ * that call, the module falls back to a user-global location
11
+ * (`~/.opensip-tools/`) so any caller who imports persistence helpers
12
+ * before the CLI's preAction hook still gets a valid path. The
13
+ * fallback is also exercised by tests that don't bootstrap a CLI.
14
+ */
15
+ import type { ProjectPaths } from '@opensip-tools/core';
16
+ export interface StoredSession {
17
+ readonly id: string;
18
+ readonly tool: 'fit' | 'sim';
19
+ readonly timestamp: string;
20
+ readonly cwd: string;
21
+ readonly recipe?: string;
22
+ readonly score: number;
23
+ readonly passed: boolean;
24
+ readonly summary: {
25
+ readonly total: number;
26
+ readonly passed: number;
27
+ readonly failed: number;
28
+ readonly errors: number;
29
+ readonly warnings: number;
30
+ };
31
+ readonly checks: readonly {
32
+ readonly checkSlug: string;
33
+ readonly passed: boolean;
34
+ readonly violationCount?: number;
35
+ readonly findings: readonly {
36
+ readonly ruleId: string;
37
+ readonly message: string;
38
+ readonly severity: string;
39
+ readonly filePath?: string;
40
+ readonly line?: number;
41
+ readonly column?: number;
42
+ readonly suggestion?: string;
43
+ readonly category?: string;
44
+ }[];
45
+ readonly durationMs: number;
46
+ }[];
47
+ readonly durationMs: number;
48
+ }
49
+ /** Check catalog entry for dashboard display */
50
+ export interface CheckCatalogEntry {
51
+ readonly slug: string;
52
+ readonly name: string;
53
+ readonly icon: string;
54
+ readonly description: string;
55
+ readonly longDescription?: string;
56
+ readonly tags: readonly string[];
57
+ readonly confidence: 'high' | 'medium' | 'low';
58
+ readonly source: 'built-in' | 'community';
59
+ }
60
+ /** Recipe catalog entry for dashboard display */
61
+ export interface RecipeCatalogEntry {
62
+ readonly name: string;
63
+ readonly displayName: string;
64
+ readonly description: string;
65
+ readonly tags: readonly string[];
66
+ readonly selectorType: string;
67
+ readonly mode: string;
68
+ readonly timeout: number;
69
+ }
70
+ /**
71
+ * Fallback path: user-global `~/.opensip-tools/`, used by tests and
72
+ * any code path that imports persistence helpers before the CLI has
73
+ * called `configurePersistencePaths`. New code should not rely on
74
+ * this fallback — call `configurePersistencePaths` first.
75
+ */
76
+ export declare const TOOLS_HOME: string;
77
+ /**
78
+ * Configure where this module writes sessions and reports. Called
79
+ * once by the CLI bootstrap with the project paths. Idempotent and
80
+ * safe to call repeatedly (e.g. tests that switch project dirs).
81
+ */
82
+ export declare function configurePersistencePaths(paths: Pick<ProjectPaths, 'sessionsDir' | 'reportsDir'>): void;
83
+ /** Sanitize a string for use in a filename — strip path separators and special chars */
84
+ export declare function sanitizeForFilename(s: string): string;
85
+ /** Save a session result to disk */
86
+ export declare function saveSession(session: StoredSession): string;
87
+ /** Count session files in the store directory */
88
+ export declare function countSessions(): number;
89
+ /** Delete all sessions. Returns the number of files deleted. */
90
+ export declare function clearAllSessions(): number;
91
+ /** Delete sessions older than the given number of days. Returns the number of files deleted. */
92
+ export declare function clearSessionsOlderThan(days: number): number;
93
+ /** Load all sessions, newest first. Optional limit to avoid reading everything. */
94
+ export declare function loadSessions(limit?: number): StoredSession[];
95
+ /** Load the most recent session */
96
+ export declare function loadLatestSession(): StoredSession | null;
97
+ /** Get the store directory path */
98
+ export declare function getStoreDir(): string;
99
+ /** Get the reports directory path, creating it if needed */
100
+ export declare function getReportsDir(): string;
101
+ /** Generate a unique session ID */
102
+ export declare function generateSessionId(): string;
103
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/persistence/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE,SAAS;QACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QACjC,QAAQ,CAAC,QAAQ,EAAE,SAAS;YAC1B,QAAQ,CAAC,MAAM,EAAE,MAA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AE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,QAAoC,CAAC;AAO5D;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,aAAa,GAAG,YAAY,CAAC,GAAG,IAAI,CAGvG;AAOD,wFAAwF;AACxF,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,oCAAoC;AACpC,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAU1D;AAED,iDAAiD;AACjD,wBAAgB,aAAa,IAAI,MAAM,CAGtC;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,IAAI,MAAM,CAOzC;AAED,gGAAgG;AAChG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAwB3D;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE,CAoB5D;AAED,mCAAmC;AACnC,wBAAgB,iBAAiB,IAAI,aAAa,GAAG,IAAI,CAGxD;AAqBD,mCAAmC;AACnC,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,4DAA4D;AAC5D,wBAAgB,aAAa,IAAI,MAAM,CAGtC;AAED,mCAAmC;AACnC,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
@@ -0,0 +1,156 @@
1
+ /**
2
+ * JSON file persistence for opensip-tools results.
3
+ *
4
+ * Sessions land at `<project>/opensip-tools/.runtime/sessions/`
5
+ * (per-project). Each run creates one file:
6
+ * `{timestamp}-{tool}-{recipe}.json`.
7
+ *
8
+ * The CLI bootstrap calls `configurePersistencePaths(projectPaths)`
9
+ * once on startup with paths from `resolveProjectPaths(cwd)`. Until
10
+ * that call, the module falls back to a user-global location
11
+ * (`~/.opensip-tools/`) so any caller who imports persistence helpers
12
+ * before the CLI's preAction hook still gets a valid path. The
13
+ * fallback is also exercised by tests that don't bootstrap a CLI.
14
+ */
15
+ import { randomUUID } from 'node:crypto';
16
+ import { mkdirSync, readFileSync, readdirSync, writeFileSync, unlinkSync } from 'node:fs';
17
+ import { homedir } from 'node:os';
18
+ import { basename, join } from 'node:path';
19
+ import { logger } from '@opensip-tools/core';
20
+ /**
21
+ * Fallback path: user-global `~/.opensip-tools/`, used by tests and
22
+ * any code path that imports persistence helpers before the CLI has
23
+ * called `configurePersistencePaths`. New code should not rely on
24
+ * this fallback — call `configurePersistencePaths` first.
25
+ */
26
+ export const TOOLS_HOME = join(homedir(), '.opensip-tools');
27
+ /** Mutable per-process state — set by `configurePersistencePaths`. */
28
+ let storeDir = join(TOOLS_HOME, 'sessions');
29
+ let reportsDir = join(TOOLS_HOME, 'reports');
30
+ const MAX_SESSIONS = 100;
31
+ /**
32
+ * Configure where this module writes sessions and reports. Called
33
+ * once by the CLI bootstrap with the project paths. Idempotent and
34
+ * safe to call repeatedly (e.g. tests that switch project dirs).
35
+ */
36
+ export function configurePersistencePaths(paths) {
37
+ storeDir = paths.sessionsDir;
38
+ reportsDir = paths.reportsDir;
39
+ }
40
+ /** Ensure directory exists — mkdirSync with recursive is idempotent */
41
+ function ensureDir(dir) {
42
+ mkdirSync(dir, { recursive: true });
43
+ }
44
+ /** Sanitize a string for use in a filename — strip path separators and special chars */
45
+ export function sanitizeForFilename(s) {
46
+ return s.replaceAll('..', '-').replaceAll(/[/\\:*?"<>|.]/g, '-');
47
+ }
48
+ /** Save a session result to disk */
49
+ export function saveSession(session) {
50
+ ensureDir(storeDir);
51
+ const safeRecipe = session.recipe ? `-${sanitizeForFilename(session.recipe)}` : '';
52
+ const filename = `${session.timestamp.replaceAll(/[:.]/g, '-')}-${session.tool}${safeRecipe}.json`;
53
+ // Ensure filename stays within the sessions directory
54
+ const filepath = join(storeDir, basename(filename));
55
+ writeFileSync(filepath, JSON.stringify(session, null, 2), 'utf8');
56
+ pruneOldSessions();
57
+ return filepath;
58
+ }
59
+ /** Count session files in the store directory */
60
+ export function countSessions() {
61
+ ensureDir(storeDir);
62
+ return readdirSync(storeDir).filter(f => f.endsWith('.json')).length;
63
+ }
64
+ /** Delete all sessions. Returns the number of files deleted. */
65
+ export function clearAllSessions() {
66
+ ensureDir(storeDir);
67
+ const files = readdirSync(storeDir).filter(f => f.endsWith('.json'));
68
+ for (const file of files) {
69
+ unlinkSync(join(storeDir, file));
70
+ }
71
+ return files.length;
72
+ }
73
+ /** Delete sessions older than the given number of days. Returns the number of files deleted. */
74
+ export function clearSessionsOlderThan(days) {
75
+ ensureDir(storeDir);
76
+ const cutoff = Date.now() - days * 24 * 60 * 60 * 1000;
77
+ const files = readdirSync(storeDir).filter(f => f.endsWith('.json'));
78
+ let deleted = 0;
79
+ for (const file of files) {
80
+ try {
81
+ const filepath = join(storeDir, file);
82
+ const raw = readFileSync(filepath, 'utf8');
83
+ const session = JSON.parse(raw);
84
+ if (session.timestamp) {
85
+ const sessionTime = new Date(session.timestamp).getTime();
86
+ if (!Number.isNaN(sessionTime) && sessionTime < cutoff) {
87
+ unlinkSync(filepath);
88
+ deleted++;
89
+ }
90
+ }
91
+ }
92
+ catch {
93
+ // Skip files that can't be read/parsed
94
+ }
95
+ }
96
+ return deleted;
97
+ }
98
+ /** Load all sessions, newest first. Optional limit to avoid reading everything. */
99
+ export function loadSessions(limit) {
100
+ ensureDir(storeDir);
101
+ const files = readdirSync(storeDir)
102
+ .filter(f => f.endsWith('.json'))
103
+ .sort()
104
+ // eslint-disable-next-line unicorn/no-array-reverse -- target ES2022; Array#toReversed is ES2023 and not in the lib
105
+ .reverse();
106
+ const toRead = limit ? files.slice(0, limit) : files;
107
+ const sessions = [];
108
+ for (const file of toRead) {
109
+ try {
110
+ const raw = readFileSync(join(storeDir, file), 'utf8');
111
+ sessions.push(JSON.parse(raw));
112
+ }
113
+ catch {
114
+ // Warn about corrupted files — don't crash
115
+ logger.warn({ evt: 'cli.session.corrupted', module: 'cli:persistence', msg: `Skipping corrupted session file: ${file}`, file });
116
+ }
117
+ }
118
+ return sessions;
119
+ }
120
+ /** Load the most recent session */
121
+ export function loadLatestSession() {
122
+ const sessions = loadSessions(1);
123
+ return sessions[0] ?? null;
124
+ }
125
+ /** Prune sessions beyond the max count */
126
+ function pruneOldSessions() {
127
+ const files = readdirSync(storeDir)
128
+ .filter(f => f.endsWith('.json'))
129
+ .sort()
130
+ // eslint-disable-next-line unicorn/no-array-reverse -- target ES2022; Array#toReversed is ES2023 and not in the lib
131
+ .reverse();
132
+ if (files.length <= MAX_SESSIONS)
133
+ return;
134
+ for (const file of files.slice(MAX_SESSIONS)) {
135
+ try {
136
+ unlinkSync(join(storeDir, file));
137
+ }
138
+ catch {
139
+ // Best effort
140
+ }
141
+ }
142
+ }
143
+ /** Get the store directory path */
144
+ export function getStoreDir() {
145
+ return storeDir;
146
+ }
147
+ /** Get the reports directory path, creating it if needed */
148
+ export function getReportsDir() {
149
+ ensureDir(reportsDir);
150
+ return reportsDir;
151
+ }
152
+ /** Generate a unique session ID */
153
+ export function generateSessionId() {
154
+ return randomUUID();
155
+ }
156
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/persistence/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA6D7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,gBAA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ession } from './persistence/store.js';
2
+ /** Options for the `fit` subcommand (derived from Commander flags). */
3
+ export interface FitOptions {
4
+ recipe?: string;
5
+ check?: string;
6
+ tags?: string;
7
+ list: boolean;
8
+ recipes: boolean;
9
+ json: boolean;
10
+ verbose: boolean;
11
+ findings: boolean;
12
+ reportTo?: string;
13
+ apiKey?: string;
14
+ exclude: string[];
15
+ cwd: string;
16
+ /** Explicit path to opensip-tools.config.yml (overrides package.json pointer and default location). */
17
+ config?: string;
18
+ debug: boolean;
19
+ /** Architecture-gate: save the current run's findings as a baseline. Mutually exclusive with --gate-compare. */
20
+ gateSave?: boolean;
21
+ /** Architecture-gate: compare current findings against a saved baseline; exit 1 if regressions found. Mutually exclusive with --gate-save. */
22
+ gateCompare?: boolean;
23
+ /** Path to the baseline file used by --gate-save / --gate-compare. Default: opensip-tools/.runtime/baseline.sarif */
24
+ baseline?: string;
25
+ }
26
+ /** Options for the `init` subcommand. */
27
+ export interface InitOptions {
28
+ cwd: string;
29
+ json: boolean;
30
+ debug: boolean;
31
+ /**
32
+ * Comma-separated language list. When omitted, init detects the
33
+ * project's primary language(s) by inspecting filesystem markers
34
+ * (Cargo.toml, pyproject.toml, etc.) and exits 2 with a prompt if
35
+ * the result is ambiguous.
36
+ */
37
+ language?: string;
38
+ /**
39
+ * Overwrite an existing opensip-tools.config.yml or example files
40
+ * without prompting. Default false — the safe behavior is to refuse
41
+ * overwriting.
42
+ */
43
+ force: boolean;
44
+ }
45
+ /** Options for `sim` subcommand. */
46
+ export interface ToolOptions {
47
+ cwd: string;
48
+ json: boolean;
49
+ debug: boolean;
50
+ /** Recipe name to run. Defaults to the built-in `default` if omitted. */
51
+ recipe?: string;
52
+ /** Filter by scenario kind (load / chaos / invariant / fix-evaluation). */
53
+ kind?: string;
54
+ }
55
+ /**
56
+ * Backwards-compatible alias — commands that previously accepted CliArgs
57
+ * can accept this union instead. The shape covers all fields used by any command.
58
+ */
59
+ export interface CliArgs {
60
+ command: string;
61
+ json: boolean;
62
+ check?: string;
63
+ recipe?: string;
64
+ cwd: string;
65
+ help: boolean;
66
+ list: boolean;
67
+ listRecipes: boolean;
68
+ verbose: boolean;
69
+ reportTo?: string;
70
+ apiKey?: string;
71
+ exclude: string[];
72
+ findings: boolean;
73
+ tags?: string;
74
+ /** Suppress banner/boxes; show only the pass-fail summary line. */
75
+ quiet?: boolean;
76
+ /** Open the HTML dashboard in the default browser after a successful run. */
77
+ open?: boolean;
78
+ /** Explicit opensip-tools.config.yml path from --config flag. */
79
+ config?: string;
80
+ /** Architecture-gate flags — see FitOptions for details. */
81
+ gateSave?: boolean;
82
+ gateCompare?: boolean;
83
+ baseline?: string;
84
+ /**
85
+ * Sim-only: filter scenarios by kind.
86
+ * One of 'load' | 'chaos' | 'invariant' | 'fix-evaluation', or undefined for all.
87
+ */
88
+ kind?: string;
89
+ }
90
+ /** Structured JSON output format */
91
+ export interface CliOutput {
92
+ readonly version: '1.0';
93
+ readonly tool: 'fit' | 'sim';
94
+ readonly timestamp: string;
95
+ readonly recipe?: string;
96
+ readonly score: number;
97
+ readonly passed: boolean;
98
+ readonly summary: {
99
+ total: number;
100
+ passed: number;
101
+ failed: number;
102
+ errors: number;
103
+ warnings: number;
104
+ };
105
+ readonly checks: readonly CheckOutput[];
106
+ readonly durationMs: number;
107
+ }
108
+ export interface CheckOutput {
109
+ readonly checkSlug: string;
110
+ readonly passed: boolean;
111
+ readonly violationCount?: number;
112
+ readonly findings: readonly FindingOutput[];
113
+ readonly durationMs: number;
114
+ }
115
+ export interface FindingOutput {
116
+ readonly ruleId: string;
117
+ readonly message: string;
118
+ readonly severity: 'error' | 'warning';
119
+ readonly filePath?: string;
120
+ readonly line?: number;
121
+ readonly column?: number;
122
+ readonly suggestion?: string;
123
+ }
124
+ export interface TableRow {
125
+ check: string;
126
+ status: 'PASS' | 'FAIL' | 'TIMEOUT';
127
+ errors: number;
128
+ warnings: number;
129
+ validated: string;
130
+ ignored: number;
131
+ duration: string;
132
+ durationMs: number;
133
+ }
134
+ export interface SummaryOptions {
135
+ passed: number;
136
+ failed: number;
137
+ totalErrors: number;
138
+ totalWarnings: number;
139
+ totalIgnored: number;
140
+ durationMs: number;
141
+ }
142
+ /** Union type for all command results — App.tsx dispatches on result.type */
143
+ export type CommandResult = FitDoneResult | SimDoneResult | ListChecksResult | ListRecipesResult | HistoryResult | DashboardResult | InitResult | ExperimentalResult | PluginResult | ClearDoneResult | HelpResult | ErrorResult;
144
+ export interface ClearDoneResult {
145
+ type: 'clear-done';
146
+ action: 'done' | 'cancelled' | 'empty';
147
+ deletedCount: number;
148
+ sessionCount: number;
149
+ }
150
+ export interface FitDoneResult {
151
+ type: 'fit-done';
152
+ rows: TableRow[];
153
+ summary: SummaryOptions;
154
+ label: string;
155
+ cwd: string;
156
+ findings?: {
157
+ checks: {
158
+ checkSlug: string;
159
+ errorCount: number;
160
+ warningCount: number;
161
+ error?: string;
162
+ violations?: {
163
+ severity: 'error' | 'warning';
164
+ message: string;
165
+ file?: string;
166
+ line?: number;
167
+ suggestion?: string;
168
+ }[];
169
+ }[];
170
+ };
171
+ reportStatus?: {
172
+ url: string;
173
+ findingCount: number;
174
+ runCount: number;
175
+ success: boolean;
176
+ error?: string;
177
+ chunksTotal?: number;
178
+ chunksSucceeded?: number;
179
+ };
180
+ /** Whether the run should cause a non-zero exit code (based on failOnErrors/failOnWarnings config) */
181
+ shouldFail?: boolean;
182
+ /** Whether an opensip-tools.config.yml was found in the target directory */
183
+ configFound?: boolean;
184
+ }
185
+ export interface ListChecksResult {
186
+ type: 'list-checks';
187
+ checks: {
188
+ slug: string;
189
+ description: string;
190
+ tags: string[];
191
+ }[];
192
+ totalCount: number;
193
+ }
194
+ export interface ListRecipesResult {
195
+ type: 'list-recipes';
196
+ recipes: {
197
+ name: string;
198
+ description: string;
199
+ checkCount: string;
200
+ }[];
201
+ }
202
+ export interface HistoryResult {
203
+ type: 'history';
204
+ sessions: StoredSession[];
205
+ }
206
+ export interface DashboardResult {
207
+ type: 'dashboard';
208
+ path: string;
209
+ opened: boolean;
210
+ }
211
+ export interface InitResult {
212
+ type: 'init';
213
+ created: boolean;
214
+ path: string;
215
+ alreadyExists: boolean;
216
+ cwd: string;
217
+ configFilename: string;
218
+ /** Languages selected for this scaffold (post-detection or from --language). */
219
+ languages?: readonly ('typescript' | 'rust' | 'python' | 'go' | 'java' | 'cpp')[];
220
+ /**
221
+ * Every file init created, in display order. Includes the config
222
+ * file plus example check / recipe / scenario scaffolds. Empty
223
+ * when alreadyExists is true (nothing was written).
224
+ */
225
+ createdFiles?: readonly string[];
226
+ /** True when init appended `opensip-tools/.runtime/` to .gitignore. */
227
+ gitignoreUpdated?: boolean;
228
+ /**
229
+ * When detection is ambiguous and --language wasn't passed, init
230
+ * exits without writing anything and surfaces this error so the
231
+ * user can re-invoke with --language <list>.
232
+ */
233
+ ambiguousLanguageError?: {
234
+ detected: readonly string[];
235
+ message: string;
236
+ };
237
+ }
238
+ export interface ExperimentalResult {
239
+ type: 'experimental';
240
+ tool: 'sim';
241
+ cwd: string;
242
+ /** Optional `--kind` filter (load / chaos / invariant / fix-evaluation). */
243
+ kind?: string;
244
+ }
245
+ /** Outcome of a `sim --recipe <name>` run. */
246
+ export interface SimDoneResult {
247
+ type: 'sim-done';
248
+ recipeName: string;
249
+ cwd: string;
250
+ totalScenarios: number;
251
+ passedScenarios: number;
252
+ failedScenarios: number;
253
+ scenarios: {
254
+ scenarioId: string;
255
+ scenarioName: string;
256
+ kind: 'load' | 'chaos' | 'invariant' | 'fix-evaluation';
257
+ passed: boolean;
258
+ durationMs: number;
259
+ error?: string;
260
+ }[];
261
+ durationMs: number;
262
+ /** Whether the run should cause a non-zero exit code (any scenario failed). */
263
+ shouldFail?: boolean;
264
+ }
265
+ export interface PluginResult {
266
+ type: 'plugin';
267
+ action: 'list' | 'install' | 'remove' | 'sync' | 'add';
268
+ [key: string]: unknown;
269
+ }
270
+ export interface HelpResult {
271
+ type: 'help';
272
+ }
273
+ export interface ErrorResult {
274
+ type: 'error';
275
+ message: string;
276
+ suggestion?: string;
277
+ exitCode: number;
278
+ }
279
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAM5D,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,uGAAuG;IACvG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,gHAAgH;IAChH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8IAA8I;IAC9I,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qHAAqH;IACrH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,yCAAyC;AACzC,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,oCAAoC;AACpC,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,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E,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@opensip-tools/contracts",
3
+ "version": "1.0.4",
4
+ "license": "MIT",
5
+ "description": "Shared contract types for OpenSIP Tools — CliOutput / CommandResult shapes, exit codes, session persistence",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/opensip-ai/opensip-tools.git",
9
+ "directory": "packages/contracts"
10
+ },
11
+ "homepage": "https://github.com/opensip-ai/opensip-tools",
12
+ "bugs": {
13
+ "url": "https://github.com/opensip-ai/opensip-tools/issues"
14
+ },
15
+ "type": "module",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": "./dist/index.js"
20
+ },
21
+ "dependencies": {
22
+ "@opensip-tools/core": "1.0.4"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^22.0.0",
26
+ "typescript": "~5.7.0",
27
+ "vitest": "^2.1.0"
28
+ },
29
+ "scripts": {
30
+ "build": "tsc",
31
+ "test": "vitest run --passWithNoTests",
32
+ "typecheck": "tsc --noEmit",
33
+ "clean": "rm -rf dist"
34
+ }
35
+ }