@intutic/shared-types 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/.dist/anomaly.d.ts +227 -0
- package/.dist/anomaly.d.ts.map +1 -0
- package/.dist/anomaly.js +35 -0
- package/.dist/anomaly.js.map +1 -0
- package/.dist/api-contracts.d.ts +176 -0
- package/.dist/api-contracts.d.ts.map +1 -0
- package/.dist/api-contracts.js +110 -0
- package/.dist/api-contracts.js.map +1 -0
- package/.dist/auth.d.ts +222 -0
- package/.dist/auth.d.ts.map +1 -0
- package/.dist/auth.js +59 -0
- package/.dist/auth.js.map +1 -0
- package/.dist/enums.d.ts +156 -0
- package/.dist/enums.d.ts.map +1 -0
- package/.dist/enums.js +161 -0
- package/.dist/enums.js.map +1 -0
- package/.dist/errors.d.ts +106 -0
- package/.dist/errors.d.ts.map +1 -0
- package/.dist/errors.js +110 -0
- package/.dist/errors.js.map +1 -0
- package/.dist/finops.d.ts +117 -0
- package/.dist/finops.d.ts.map +1 -0
- package/.dist/finops.js +14 -0
- package/.dist/finops.js.map +1 -0
- package/.dist/identity.d.ts +176 -0
- package/.dist/identity.d.ts.map +1 -0
- package/.dist/identity.js +32 -0
- package/.dist/identity.js.map +1 -0
- package/.dist/index.d.ts +27 -0
- package/.dist/index.d.ts.map +1 -0
- package/.dist/index.js +75 -0
- package/.dist/index.js.map +1 -0
- package/.dist/policy.d.ts +104 -0
- package/.dist/policy.d.ts.map +1 -0
- package/.dist/policy.js +14 -0
- package/.dist/policy.js.map +1 -0
- package/.dist/session.d.ts +62 -0
- package/.dist/session.d.ts.map +1 -0
- package/.dist/session.js +14 -0
- package/.dist/session.js.map +1 -0
- package/.dist/sop.d.ts +329 -0
- package/.dist/sop.d.ts.map +1 -0
- package/.dist/sop.js +44 -0
- package/.dist/sop.js.map +1 -0
- package/.dist/sync.d.ts +204 -0
- package/.dist/sync.d.ts.map +1 -0
- package/.dist/sync.js +45 -0
- package/.dist/sync.js.map +1 -0
- package/package.json +19 -0
package/.dist/sop.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SOP (Standard Operating Procedure) registry types.
|
|
4
|
+
*
|
|
5
|
+
* These types correspond to the `sop_registry` table and the
|
|
6
|
+
* SOP proof tree structures used by the SSL (Self-Supervised Learning)
|
|
7
|
+
* synthesis pipeline.
|
|
8
|
+
*
|
|
9
|
+
* HLD §3.4 (SOP Registry), LLD 01-data-architecture §3.1, LLD #6
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ENFORCEMENT_BY_STATE = exports.VALID_SOP_TRANSITIONS = void 0;
|
|
15
|
+
/**
|
|
16
|
+
* The 10 valid lifecycle transitions in the 7-state FSM.
|
|
17
|
+
*
|
|
18
|
+
* @see HLD §3.4 — SOP Lifecycle
|
|
19
|
+
*/
|
|
20
|
+
exports.VALID_SOP_TRANSITIONS = [
|
|
21
|
+
{ from: 'DRAFT', to: 'PENDING_REVIEW', description: 'Submit for review' },
|
|
22
|
+
{ from: 'PENDING_REVIEW', to: 'GENERATED', description: 'Gödel score passes threshold' },
|
|
23
|
+
{ from: 'PENDING_REVIEW', to: 'DRAFT', description: 'Return to draft for edits' },
|
|
24
|
+
{ from: 'GENERATED', to: 'HYPOTHESIZED', description: 'Deploy in shadow mode' },
|
|
25
|
+
{ from: 'HYPOTHESIZED', to: 'REFINED', description: 'Refine based on shadow results' },
|
|
26
|
+
{ from: 'HYPOTHESIZED', to: 'INVALIDATED', description: 'Hypothesis disproved' },
|
|
27
|
+
{ from: 'REFINED', to: 'VALIDATED', description: 'Promote to active enforcement' },
|
|
28
|
+
{ from: 'REFINED', to: 'INVALIDATED', description: 'Refinement failed' },
|
|
29
|
+
{ from: 'VALIDATED', to: 'INVALIDATED', description: 'Invalidated by cascade or manual' },
|
|
30
|
+
{ from: 'VALIDATED', to: 'PENDING_REVIEW', description: 'Cascade invalidation triggers re-review' },
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* Maps lifecycle state to enforcement mode.
|
|
34
|
+
*/
|
|
35
|
+
exports.ENFORCEMENT_BY_STATE = {
|
|
36
|
+
DRAFT: 'NONE',
|
|
37
|
+
PENDING_REVIEW: 'NONE',
|
|
38
|
+
GENERATED: 'NONE',
|
|
39
|
+
HYPOTHESIZED: 'SHADOW',
|
|
40
|
+
REFINED: 'SHADOW',
|
|
41
|
+
VALIDATED: 'ACTIVE',
|
|
42
|
+
INVALIDATED: 'NONE',
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=sop.js.map
|
package/.dist/sop.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sop.js","sourceRoot":"","sources":["../src/sop.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AA2SH;;;;GAIG;AACU,QAAA,qBAAqB,GAA2F;IAC3H,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,gBAAgB,EAAE,WAAW,EAAE,mBAAmB,EAAE;IACzE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,8BAA8B,EAAE;IACxF,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE;IACjF,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,uBAAuB,EAAE;IAC/E,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,gCAAgC,EAAE;IACtF,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,sBAAsB,EAAE;IAChF,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,+BAA+B,EAAE;IAClF,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE;IACxE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,kCAAkC,EAAE;IACzF,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,gBAAgB,EAAE,WAAW,EAAE,yCAAyC,EAAE;CAC3F,CAAA;AAEV;;GAEG;AACU,QAAA,oBAAoB,GAA4D;IAC3F,KAAK,EAAE,MAAM;IACb,cAAc,EAAE,MAAM;IACtB,SAAS,EAAE,MAAM;IACjB,YAAY,EAAE,QAAQ;IACtB,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,QAAQ;IACnB,WAAW,EAAE,MAAM;CACpB,CAAA"}
|
package/.dist/sync.d.ts
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync Daemon & CLI Types — Shared across control plane + CLI + daemon.
|
|
3
|
+
*
|
|
4
|
+
* LLD #8 — Sync Daemon / CLI
|
|
5
|
+
* HLD §3.14 — Real-Time State Mirroring
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import type { HarnessType } from './enums.js';
|
|
11
|
+
export type { HarnessType } from './enums.js';
|
|
12
|
+
/** A single SOP entry within a sync config push. */
|
|
13
|
+
export interface SyncSopEntry {
|
|
14
|
+
/** SOP registry ID. */
|
|
15
|
+
sopId: string;
|
|
16
|
+
/** Human-readable SOP title. */
|
|
17
|
+
title: string;
|
|
18
|
+
/** Full SOP content (markdown). Written to harness config files. */
|
|
19
|
+
content: string;
|
|
20
|
+
/** SHA-256 canonical hash from SOP registry. */
|
|
21
|
+
contentHash: string;
|
|
22
|
+
/** Which harness config files should receive this SOP. */
|
|
23
|
+
harnessTargets: HarnessType[];
|
|
24
|
+
}
|
|
25
|
+
/** Config push payload from control plane to sync daemon. */
|
|
26
|
+
export interface SyncConfigPayload {
|
|
27
|
+
/** Workspace this config belongs to. */
|
|
28
|
+
workspaceId: string;
|
|
29
|
+
/** Monotonic config version counter. Daemon skips if local >= remote. */
|
|
30
|
+
configVersion: number;
|
|
31
|
+
/** Active SOPs to write to harness config files. */
|
|
32
|
+
sops: SyncSopEntry[];
|
|
33
|
+
/** Proxy URL for LLM API redirect (e.g., `https://proxy.intutic.ai`). */
|
|
34
|
+
proxyUrl: string;
|
|
35
|
+
/** Workspace-level settings (JSONB passthrough). */
|
|
36
|
+
settings: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
/** Hash of a single local SOP config file. */
|
|
39
|
+
export interface SopFileHash {
|
|
40
|
+
/** File path relative to workspace root (e.g., `.cursorrules`). */
|
|
41
|
+
filePath: string;
|
|
42
|
+
/** SHA-256 hash of actual local file content. */
|
|
43
|
+
localHash: string;
|
|
44
|
+
/** Expected hash from last sync (canonical). */
|
|
45
|
+
canonicalHash: string;
|
|
46
|
+
/** Whether local diverges from canonical. */
|
|
47
|
+
drifted: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** SOP hash integrity report sent by daemon to control plane. */
|
|
50
|
+
export interface SopHashReport {
|
|
51
|
+
/** Workspace ID. */
|
|
52
|
+
workspaceId: string;
|
|
53
|
+
/** Harness type that was scanned. */
|
|
54
|
+
harnessType: HarnessType;
|
|
55
|
+
/** File hashes for all synced config files. */
|
|
56
|
+
files: SopFileHash[];
|
|
57
|
+
/** ISO timestamp of report generation. */
|
|
58
|
+
reportedAt: string;
|
|
59
|
+
}
|
|
60
|
+
/** Detection status of a single harness in the workspace. */
|
|
61
|
+
export interface DetectedHarness {
|
|
62
|
+
/** Harness type. */
|
|
63
|
+
type: HarnessType;
|
|
64
|
+
/** Absolute path to the harness config file. */
|
|
65
|
+
configPath: string;
|
|
66
|
+
/** Whether the harness was auto-detected. */
|
|
67
|
+
detected: boolean;
|
|
68
|
+
/** ISO timestamp of last config file write (null if never written). */
|
|
69
|
+
lastWriteAt: string | null;
|
|
70
|
+
}
|
|
71
|
+
/** Daemon heartbeat status payload. */
|
|
72
|
+
export interface DaemonStatus {
|
|
73
|
+
/** Workspace ID. */
|
|
74
|
+
workspaceId: string;
|
|
75
|
+
/** Current local config version. */
|
|
76
|
+
configVersion: number;
|
|
77
|
+
/** ISO timestamp when daemon connected. */
|
|
78
|
+
connectedSince: string;
|
|
79
|
+
/** ISO timestamp of last successful sync. */
|
|
80
|
+
lastSyncAt: string;
|
|
81
|
+
/** Detected harnesses in the workspace. */
|
|
82
|
+
harnesses: DetectedHarness[];
|
|
83
|
+
}
|
|
84
|
+
/** Credentials stored at ~/.intutic/credentials.json. */
|
|
85
|
+
export interface IntuticCredentials {
|
|
86
|
+
/** API key (vk_*) or JWT access token. */
|
|
87
|
+
apiKey: string;
|
|
88
|
+
/** Workspace ID. */
|
|
89
|
+
workspaceId: string;
|
|
90
|
+
/** Control plane URL. */
|
|
91
|
+
controlPlaneUrl: string;
|
|
92
|
+
/** Member email (for display). */
|
|
93
|
+
email: string;
|
|
94
|
+
/** ISO timestamp when credentials were stored. */
|
|
95
|
+
storedAt: string;
|
|
96
|
+
}
|
|
97
|
+
/** Workspace config stored at ~/.intutic/config.json. */
|
|
98
|
+
export interface IntuticConfig {
|
|
99
|
+
/** Workspace root directory (absolute path). */
|
|
100
|
+
workspaceRoot: string;
|
|
101
|
+
/** Detected harnesses. */
|
|
102
|
+
harnesses: HarnessType[];
|
|
103
|
+
/** Current config version from last sync. */
|
|
104
|
+
configVersion: number;
|
|
105
|
+
/** Whether dev mode is active (local control plane). */
|
|
106
|
+
devMode: boolean;
|
|
107
|
+
}
|
|
108
|
+
/** Local integrity store at .intutic/integrity.json (per-workspace). */
|
|
109
|
+
export interface IntegrityStore {
|
|
110
|
+
/** Last sync timestamp. */
|
|
111
|
+
lastSyncAt: string;
|
|
112
|
+
/** Config version at last sync. */
|
|
113
|
+
configVersion: number;
|
|
114
|
+
/** Canonical hashes of synced files. */
|
|
115
|
+
files: Record<string, string>;
|
|
116
|
+
}
|
|
117
|
+
/** Zod schema for SOP hash report (daemon → control plane). */
|
|
118
|
+
export declare const SopHashReportSchema: z.ZodObject<{
|
|
119
|
+
workspaceId: z.ZodString;
|
|
120
|
+
harnessType: z.ZodEnum<["cursor", "claude-code", "antigravity", "n8n", "codex", "windsurf", "aider", "openhands"]>;
|
|
121
|
+
files: z.ZodArray<z.ZodObject<{
|
|
122
|
+
filePath: z.ZodString;
|
|
123
|
+
localHash: z.ZodString;
|
|
124
|
+
canonicalHash: z.ZodString;
|
|
125
|
+
drifted: z.ZodBoolean;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
filePath: string;
|
|
128
|
+
localHash: string;
|
|
129
|
+
canonicalHash: string;
|
|
130
|
+
drifted: boolean;
|
|
131
|
+
}, {
|
|
132
|
+
filePath: string;
|
|
133
|
+
localHash: string;
|
|
134
|
+
canonicalHash: string;
|
|
135
|
+
drifted: boolean;
|
|
136
|
+
}>, "many">;
|
|
137
|
+
reportedAt: z.ZodString;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
workspaceId: string;
|
|
140
|
+
harnessType: "cursor" | "claude-code" | "antigravity" | "n8n" | "codex" | "windsurf" | "aider" | "openhands";
|
|
141
|
+
files: {
|
|
142
|
+
filePath: string;
|
|
143
|
+
localHash: string;
|
|
144
|
+
canonicalHash: string;
|
|
145
|
+
drifted: boolean;
|
|
146
|
+
}[];
|
|
147
|
+
reportedAt: string;
|
|
148
|
+
}, {
|
|
149
|
+
workspaceId: string;
|
|
150
|
+
harnessType: "cursor" | "claude-code" | "antigravity" | "n8n" | "codex" | "windsurf" | "aider" | "openhands";
|
|
151
|
+
files: {
|
|
152
|
+
filePath: string;
|
|
153
|
+
localHash: string;
|
|
154
|
+
canonicalHash: string;
|
|
155
|
+
drifted: boolean;
|
|
156
|
+
}[];
|
|
157
|
+
reportedAt: string;
|
|
158
|
+
}>;
|
|
159
|
+
/** Zod schema for daemon status (heartbeat). */
|
|
160
|
+
export declare const DaemonStatusSchema: z.ZodObject<{
|
|
161
|
+
workspaceId: z.ZodString;
|
|
162
|
+
configVersion: z.ZodNumber;
|
|
163
|
+
connectedSince: z.ZodString;
|
|
164
|
+
lastSyncAt: z.ZodString;
|
|
165
|
+
harnesses: z.ZodArray<z.ZodObject<{
|
|
166
|
+
type: z.ZodEnum<["cursor", "claude-code", "antigravity", "n8n", "codex", "windsurf", "aider", "openhands"]>;
|
|
167
|
+
configPath: z.ZodString;
|
|
168
|
+
detected: z.ZodBoolean;
|
|
169
|
+
lastWriteAt: z.ZodNullable<z.ZodString>;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
type: "cursor" | "claude-code" | "antigravity" | "n8n" | "codex" | "windsurf" | "aider" | "openhands";
|
|
172
|
+
configPath: string;
|
|
173
|
+
detected: boolean;
|
|
174
|
+
lastWriteAt: string | null;
|
|
175
|
+
}, {
|
|
176
|
+
type: "cursor" | "claude-code" | "antigravity" | "n8n" | "codex" | "windsurf" | "aider" | "openhands";
|
|
177
|
+
configPath: string;
|
|
178
|
+
detected: boolean;
|
|
179
|
+
lastWriteAt: string | null;
|
|
180
|
+
}>, "many">;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
workspaceId: string;
|
|
183
|
+
configVersion: number;
|
|
184
|
+
connectedSince: string;
|
|
185
|
+
lastSyncAt: string;
|
|
186
|
+
harnesses: {
|
|
187
|
+
type: "cursor" | "claude-code" | "antigravity" | "n8n" | "codex" | "windsurf" | "aider" | "openhands";
|
|
188
|
+
configPath: string;
|
|
189
|
+
detected: boolean;
|
|
190
|
+
lastWriteAt: string | null;
|
|
191
|
+
}[];
|
|
192
|
+
}, {
|
|
193
|
+
workspaceId: string;
|
|
194
|
+
configVersion: number;
|
|
195
|
+
connectedSince: string;
|
|
196
|
+
lastSyncAt: string;
|
|
197
|
+
harnesses: {
|
|
198
|
+
type: "cursor" | "claude-code" | "antigravity" | "n8n" | "codex" | "windsurf" | "aider" | "openhands";
|
|
199
|
+
configPath: string;
|
|
200
|
+
detected: boolean;
|
|
201
|
+
lastWriteAt: string | null;
|
|
202
|
+
}[];
|
|
203
|
+
}>;
|
|
204
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG7C,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAK7C,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAA;IACf,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAA;IACnB,0DAA0D;IAC1D,cAAc,EAAE,WAAW,EAAE,CAAA;CAC9B;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,aAAa,EAAE,MAAM,CAAA;IACrB,oDAAoD;IACpD,IAAI,EAAE,YAAY,EAAE,CAAA;IACpB,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAA;IAChB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAMD,8CAA8C;AAC9C,MAAM,WAAW,WAAW;IAC1B,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAA;IAChB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAA;IACjB,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAA;IACrB,6CAA6C;IAC7C,O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B,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,mCAAmC;IACnC,aAAa,EAAE,MAAM,CAAA;IACrB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC9B;AAID,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa9B,CAAA;AAEF,gDAAgD;AAChD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc7B,CAAA"}
|
package/.dist/sync.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Sync Daemon & CLI Types — Shared across control plane + CLI + daemon.
|
|
4
|
+
*
|
|
5
|
+
* LLD #8 — Sync Daemon / CLI
|
|
6
|
+
* HLD §3.14 — Real-Time State Mirroring
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.DaemonStatusSchema = exports.SopHashReportSchema = void 0;
|
|
12
|
+
const zod_1 = require("zod");
|
|
13
|
+
// ─── Zod Schemas ─────────────────────────────────────────────────────
|
|
14
|
+
/** Zod schema for SOP hash report (daemon → control plane). */
|
|
15
|
+
exports.SopHashReportSchema = zod_1.z.object({
|
|
16
|
+
workspaceId: zod_1.z.string().min(1),
|
|
17
|
+
harnessType: zod_1.z.enum([
|
|
18
|
+
'cursor', 'claude-code', 'antigravity', 'n8n',
|
|
19
|
+
'codex', 'windsurf', 'aider', 'openhands',
|
|
20
|
+
]),
|
|
21
|
+
files: zod_1.z.array(zod_1.z.object({
|
|
22
|
+
filePath: zod_1.z.string().min(1),
|
|
23
|
+
localHash: zod_1.z.string().length(64), // SHA-256 hex
|
|
24
|
+
canonicalHash: zod_1.z.string().length(64),
|
|
25
|
+
drifted: zod_1.z.boolean(),
|
|
26
|
+
})),
|
|
27
|
+
reportedAt: zod_1.z.string().datetime(),
|
|
28
|
+
});
|
|
29
|
+
/** Zod schema for daemon status (heartbeat). */
|
|
30
|
+
exports.DaemonStatusSchema = zod_1.z.object({
|
|
31
|
+
workspaceId: zod_1.z.string().min(1),
|
|
32
|
+
configVersion: zod_1.z.number().int().min(0),
|
|
33
|
+
connectedSince: zod_1.z.string().datetime(),
|
|
34
|
+
lastSyncAt: zod_1.z.string().datetime(),
|
|
35
|
+
harnesses: zod_1.z.array(zod_1.z.object({
|
|
36
|
+
type: zod_1.z.enum([
|
|
37
|
+
'cursor', 'claude-code', 'antigravity', 'n8n',
|
|
38
|
+
'codex', 'windsurf', 'aider', 'openhands',
|
|
39
|
+
]),
|
|
40
|
+
configPath: zod_1.z.string(),
|
|
41
|
+
detected: zod_1.z.boolean(),
|
|
42
|
+
lastWriteAt: zod_1.z.string().datetime().nullable(),
|
|
43
|
+
})),
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,6BAAuB;AAqIvB,wEAAwE;AAExE,+DAA+D;AAClD,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,WAAW,EAAE,OAAC,CAAC,IAAI,CAAC;QAClB,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK;QAC7C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW;KAC1C,CAAC;IACF,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,C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",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"main": ".dist/index.js",
|
|
5
|
+
"types": ".dist/index.d.ts",
|
|
6
|
+
"files": [".dist"],
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"test": "vitest run",
|
|
10
|
+
"typecheck": "tsc --noEmit"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"zod": "^3.23"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"typescript": "^5.5",
|
|
17
|
+
"vitest": "^3"
|
|
18
|
+
}
|
|
19
|
+
}
|