@hasna/instructions 0.4.7 → 0.4.9
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/README.md +87 -0
- package/dashboard/README.md +73 -0
- package/dist/cli/index.js +8772 -860
- package/dist/cli/project-context.test.d.ts +2 -0
- package/dist/cli/project-context.test.d.ts.map +1 -0
- package/dist/data/config-store.d.ts +13 -0
- package/dist/data/config-store.d.ts.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8705 -867
- package/dist/lib/apply.d.ts +27 -0
- package/dist/lib/apply.d.ts.map +1 -1
- package/dist/lib/global-agent-rules-render-integration.test.d.ts +2 -0
- package/dist/lib/global-agent-rules-render-integration.test.d.ts.map +1 -0
- package/dist/lib/global-agent-rules-standard.d.ts +158 -1
- package/dist/lib/global-agent-rules-standard.d.ts.map +1 -1
- package/dist/lib/global-agent-rules-stored-content.test.d.ts +2 -0
- package/dist/lib/global-agent-rules-stored-content.test.d.ts.map +1 -0
- package/dist/lib/machine.d.ts +4 -0
- package/dist/lib/machine.d.ts.map +1 -1
- package/dist/lib/platform-profiles.d.ts.map +1 -1
- package/dist/lib/project-context.d.ts +440 -0
- package/dist/lib/project-context.d.ts.map +1 -0
- package/dist/lib/project-context.test.d.ts +2 -0
- package/dist/lib/project-context.test.d.ts.map +1 -0
- package/dist/lib/session-apply.d.ts +35 -0
- package/dist/lib/session-apply.d.ts.map +1 -1
- package/dist/lib/session-render-contract.d.ts +15 -0
- package/dist/lib/session-render-contract.d.ts.map +1 -0
- package/dist/lib/session-render-ownership.d.ts +23 -0
- package/dist/lib/session-render-ownership.d.ts.map +1 -0
- package/dist/lib/session-render-ownership.test.d.ts +2 -0
- package/dist/lib/session-render-ownership.test.d.ts.map +1 -0
- package/dist/lib/session-render.d.ts +74 -4
- package/dist/lib/session-render.d.ts.map +1 -1
- package/dist/lib/sync-dir.d.ts.map +1 -1
- package/dist/lib/sync.d.ts.map +1 -1
- package/dist/lib/template.d.ts +4 -0
- package/dist/lib/template.d.ts.map +1 -1
- package/dist/mcp/index.js +5014 -330
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { SessionRenderFile, SessionRenderManifest, SessionRenderMode, SessionRenderTool } from "./session-render.js";
|
|
3
|
+
export declare const PROJECT_CONTEXT_SCHEMA: "hasna.projects.project_context_bundle.v1";
|
|
4
|
+
export declare const PROJECT_CONTEXT_MAX_INPUT_BYTES: number;
|
|
5
|
+
export declare const PROJECT_CONTEXT_MAX_RENDERED_BYTES: number;
|
|
6
|
+
export declare const PROJECT_CONTEXT_MAX_APPROX_TOKENS = 1000;
|
|
7
|
+
export declare const PROJECT_CONTEXT_MAX_COMMANDS = 6;
|
|
8
|
+
export declare const PROJECT_CONTEXT_MAX_WARNINGS = 3;
|
|
9
|
+
export declare const PROJECT_CONTEXT_FRAGMENT_PATH = ".hasna/instructions/project-context.md";
|
|
10
|
+
export declare const PROJECT_CONTEXT_MANIFEST_PATH = ".hasna/project-context-manifest.json";
|
|
11
|
+
export declare const PROJECT_CONTEXT_CACHE_PATH = ".hasna/project-context-cache.json";
|
|
12
|
+
export declare const PROJECT_CONTEXT_LOCK_PATH = ".hasna/project-context.lock";
|
|
13
|
+
export declare const PROJECT_CONTEXT_SNAPSHOT_DIR = ".hasna/project-context-snapshots";
|
|
14
|
+
export declare const PROJECT_CONTEXT_CACHE_SCHEMA: "hasna.instructions.project-context-cache/v1";
|
|
15
|
+
export declare const PROJECT_CONTEXT_MANAGED_COMMENT = "Managed by @hasna/configs project context";
|
|
16
|
+
export declare const LEGACY_CONFIGS_PACKAGE: "@hasna/configs";
|
|
17
|
+
export declare const LEGACY_CONFIGS_COMPAT_VERSION: "0.2.45";
|
|
18
|
+
export declare const LEGACY_CONFIGS_EXECUTABLE: "configs";
|
|
19
|
+
declare const projectContextBundleSchema: z.ZodObject<{
|
|
20
|
+
schema: z.ZodLiteral<"hasna.projects.project_context_bundle.v1">;
|
|
21
|
+
generated_at: z.ZodEffects<z.ZodString, string, string>;
|
|
22
|
+
hash: z.ZodString;
|
|
23
|
+
revision: z.ZodEffects<z.ZodString, string, string>;
|
|
24
|
+
freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
|
|
25
|
+
resolution: z.ZodObject<{
|
|
26
|
+
source: z.ZodEnum<["marker", "path", "id-or-slug", "name"]>;
|
|
27
|
+
conflict: z.ZodBoolean;
|
|
28
|
+
create_allowed: z.ZodBoolean;
|
|
29
|
+
}, "strict", z.ZodTypeAny, {
|
|
30
|
+
source: "name" | "path" | "marker" | "id-or-slug";
|
|
31
|
+
conflict: boolean;
|
|
32
|
+
create_allowed: boolean;
|
|
33
|
+
}, {
|
|
34
|
+
source: "name" | "path" | "marker" | "id-or-slug";
|
|
35
|
+
conflict: boolean;
|
|
36
|
+
create_allowed: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
authority: z.ZodObject<{
|
|
39
|
+
owner: z.ZodLiteral<"projects">;
|
|
40
|
+
mode: z.ZodEnum<["local", "api"]>;
|
|
41
|
+
storage: z.ZodEnum<["sqlite", "cloud", "self-hosted"]>;
|
|
42
|
+
availability: z.ZodEnum<["available", "unavailable"]>;
|
|
43
|
+
}, "strict", z.ZodTypeAny, {
|
|
44
|
+
mode: "local" | "api";
|
|
45
|
+
owner: "projects";
|
|
46
|
+
storage: "sqlite" | "cloud" | "self-hosted";
|
|
47
|
+
availability: "available" | "unavailable";
|
|
48
|
+
}, {
|
|
49
|
+
mode: "local" | "api";
|
|
50
|
+
owner: "projects";
|
|
51
|
+
storage: "sqlite" | "cloud" | "self-hosted";
|
|
52
|
+
availability: "available" | "unavailable";
|
|
53
|
+
}>;
|
|
54
|
+
project: z.ZodObject<{
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
slug: z.ZodString;
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
kind: z.ZodEnum<["open-source", "internal-app", "platform", "company-website", "scaffold", "community", "project", "experiment", "docs", "remote-only", "generic"]>;
|
|
59
|
+
status: z.ZodEnum<["active", "archived", "deleted"]>;
|
|
60
|
+
path: z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
61
|
+
updated_at: z.ZodEffects<z.ZodString, string, string>;
|
|
62
|
+
}, "strict", z.ZodTypeAny, {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
slug: string;
|
|
66
|
+
kind: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic";
|
|
67
|
+
updated_at: string;
|
|
68
|
+
status: "active" | "archived" | "deleted";
|
|
69
|
+
path: string | null;
|
|
70
|
+
}, {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
slug: string;
|
|
74
|
+
kind: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic";
|
|
75
|
+
updated_at: string;
|
|
76
|
+
status: "active" | "archived" | "deleted";
|
|
77
|
+
path: string | null;
|
|
78
|
+
}>;
|
|
79
|
+
links: z.ZodObject<{
|
|
80
|
+
todos: z.ZodObject<{
|
|
81
|
+
state: z.ZodEnum<["linked", "partial", "unlinked"]>;
|
|
82
|
+
project_id: z.ZodNullable<z.ZodString>;
|
|
83
|
+
task_list_id: z.ZodNullable<z.ZodString>;
|
|
84
|
+
}, "strict", z.ZodTypeAny, {
|
|
85
|
+
state: "linked" | "partial" | "unlinked";
|
|
86
|
+
project_id: string | null;
|
|
87
|
+
task_list_id: string | null;
|
|
88
|
+
}, {
|
|
89
|
+
state: "linked" | "partial" | "unlinked";
|
|
90
|
+
project_id: string | null;
|
|
91
|
+
task_list_id: string | null;
|
|
92
|
+
}>;
|
|
93
|
+
conversations: z.ZodObject<{
|
|
94
|
+
state: z.ZodEnum<["linked", "partial", "unlinked"]>;
|
|
95
|
+
channel: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
|
|
96
|
+
}, "strict", z.ZodTypeAny, {
|
|
97
|
+
state: "linked" | "partial" | "unlinked";
|
|
98
|
+
channel: string | null;
|
|
99
|
+
}, {
|
|
100
|
+
state: "linked" | "partial" | "unlinked";
|
|
101
|
+
channel: string | null;
|
|
102
|
+
}>;
|
|
103
|
+
mementos: z.ZodObject<{
|
|
104
|
+
state: z.ZodEnum<["linked", "partial", "unlinked"]>;
|
|
105
|
+
project_id: z.ZodNullable<z.ZodString>;
|
|
106
|
+
scope: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
|
|
107
|
+
}, "strict", z.ZodTypeAny, {
|
|
108
|
+
state: "linked" | "partial" | "unlinked";
|
|
109
|
+
project_id: string | null;
|
|
110
|
+
scope: string | null;
|
|
111
|
+
}, {
|
|
112
|
+
state: "linked" | "partial" | "unlinked";
|
|
113
|
+
project_id: string | null;
|
|
114
|
+
scope: string | null;
|
|
115
|
+
}>;
|
|
116
|
+
}, "strict", z.ZodTypeAny, {
|
|
117
|
+
todos: {
|
|
118
|
+
state: "linked" | "partial" | "unlinked";
|
|
119
|
+
project_id: string | null;
|
|
120
|
+
task_list_id: string | null;
|
|
121
|
+
};
|
|
122
|
+
conversations: {
|
|
123
|
+
state: "linked" | "partial" | "unlinked";
|
|
124
|
+
channel: string | null;
|
|
125
|
+
};
|
|
126
|
+
mementos: {
|
|
127
|
+
state: "linked" | "partial" | "unlinked";
|
|
128
|
+
project_id: string | null;
|
|
129
|
+
scope: string | null;
|
|
130
|
+
};
|
|
131
|
+
}, {
|
|
132
|
+
todos: {
|
|
133
|
+
state: "linked" | "partial" | "unlinked";
|
|
134
|
+
project_id: string | null;
|
|
135
|
+
task_list_id: string | null;
|
|
136
|
+
};
|
|
137
|
+
conversations: {
|
|
138
|
+
state: "linked" | "partial" | "unlinked";
|
|
139
|
+
channel: string | null;
|
|
140
|
+
};
|
|
141
|
+
mementos: {
|
|
142
|
+
state: "linked" | "partial" | "unlinked";
|
|
143
|
+
project_id: string | null;
|
|
144
|
+
scope: string | null;
|
|
145
|
+
};
|
|
146
|
+
}>;
|
|
147
|
+
station: z.ZodNullable<z.ZodObject<{
|
|
148
|
+
station_id: z.ZodNullable<z.ZodString>;
|
|
149
|
+
machine_id: z.ZodNullable<z.ZodString>;
|
|
150
|
+
}, "strict", z.ZodTypeAny, {
|
|
151
|
+
machine_id: string | null;
|
|
152
|
+
station_id: string | null;
|
|
153
|
+
}, {
|
|
154
|
+
machine_id: string | null;
|
|
155
|
+
station_id: string | null;
|
|
156
|
+
}>>;
|
|
157
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
158
|
+
name: z.ZodEnum<["show", "context", "why", "context-bundle"]>;
|
|
159
|
+
argv: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
160
|
+
}, "strict", z.ZodTypeAny, {
|
|
161
|
+
name: "show" | "context" | "why" | "context-bundle";
|
|
162
|
+
argv: string[];
|
|
163
|
+
}, {
|
|
164
|
+
name: "show" | "context" | "why" | "context-bundle";
|
|
165
|
+
argv: string[];
|
|
166
|
+
}>, "many">;
|
|
167
|
+
}, "strict", z.ZodTypeAny, {
|
|
168
|
+
project: {
|
|
169
|
+
id: string;
|
|
170
|
+
name: string;
|
|
171
|
+
slug: string;
|
|
172
|
+
kind: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic";
|
|
173
|
+
updated_at: string;
|
|
174
|
+
status: "active" | "archived" | "deleted";
|
|
175
|
+
path: string | null;
|
|
176
|
+
};
|
|
177
|
+
schema: "hasna.projects.project_context_bundle.v1";
|
|
178
|
+
generated_at: string;
|
|
179
|
+
hash: string;
|
|
180
|
+
revision: string;
|
|
181
|
+
freshness: "unknown" | "fresh" | "stale";
|
|
182
|
+
resolution: {
|
|
183
|
+
source: "name" | "path" | "marker" | "id-or-slug";
|
|
184
|
+
conflict: boolean;
|
|
185
|
+
create_allowed: boolean;
|
|
186
|
+
};
|
|
187
|
+
authority: {
|
|
188
|
+
mode: "local" | "api";
|
|
189
|
+
owner: "projects";
|
|
190
|
+
storage: "sqlite" | "cloud" | "self-hosted";
|
|
191
|
+
availability: "available" | "unavailable";
|
|
192
|
+
};
|
|
193
|
+
links: {
|
|
194
|
+
todos: {
|
|
195
|
+
state: "linked" | "partial" | "unlinked";
|
|
196
|
+
project_id: string | null;
|
|
197
|
+
task_list_id: string | null;
|
|
198
|
+
};
|
|
199
|
+
conversations: {
|
|
200
|
+
state: "linked" | "partial" | "unlinked";
|
|
201
|
+
channel: string | null;
|
|
202
|
+
};
|
|
203
|
+
mementos: {
|
|
204
|
+
state: "linked" | "partial" | "unlinked";
|
|
205
|
+
project_id: string | null;
|
|
206
|
+
scope: string | null;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
station: {
|
|
210
|
+
machine_id: string | null;
|
|
211
|
+
station_id: string | null;
|
|
212
|
+
} | null;
|
|
213
|
+
commands: {
|
|
214
|
+
name: "show" | "context" | "why" | "context-bundle";
|
|
215
|
+
argv: string[];
|
|
216
|
+
}[];
|
|
217
|
+
}, {
|
|
218
|
+
project: {
|
|
219
|
+
id: string;
|
|
220
|
+
name: string;
|
|
221
|
+
slug: string;
|
|
222
|
+
kind: "open-source" | "internal-app" | "platform" | "company-website" | "scaffold" | "community" | "project" | "experiment" | "docs" | "remote-only" | "generic";
|
|
223
|
+
updated_at: string;
|
|
224
|
+
status: "active" | "archived" | "deleted";
|
|
225
|
+
path: string | null;
|
|
226
|
+
};
|
|
227
|
+
schema: "hasna.projects.project_context_bundle.v1";
|
|
228
|
+
generated_at: string;
|
|
229
|
+
hash: string;
|
|
230
|
+
revision: string;
|
|
231
|
+
freshness: "unknown" | "fresh" | "stale";
|
|
232
|
+
resolution: {
|
|
233
|
+
source: "name" | "path" | "marker" | "id-or-slug";
|
|
234
|
+
conflict: boolean;
|
|
235
|
+
create_allowed: boolean;
|
|
236
|
+
};
|
|
237
|
+
authority: {
|
|
238
|
+
mode: "local" | "api";
|
|
239
|
+
owner: "projects";
|
|
240
|
+
storage: "sqlite" | "cloud" | "self-hosted";
|
|
241
|
+
availability: "available" | "unavailable";
|
|
242
|
+
};
|
|
243
|
+
links: {
|
|
244
|
+
todos: {
|
|
245
|
+
state: "linked" | "partial" | "unlinked";
|
|
246
|
+
project_id: string | null;
|
|
247
|
+
task_list_id: string | null;
|
|
248
|
+
};
|
|
249
|
+
conversations: {
|
|
250
|
+
state: "linked" | "partial" | "unlinked";
|
|
251
|
+
channel: string | null;
|
|
252
|
+
};
|
|
253
|
+
mementos: {
|
|
254
|
+
state: "linked" | "partial" | "unlinked";
|
|
255
|
+
project_id: string | null;
|
|
256
|
+
scope: string | null;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
station: {
|
|
260
|
+
machine_id: string | null;
|
|
261
|
+
station_id: string | null;
|
|
262
|
+
} | null;
|
|
263
|
+
commands: {
|
|
264
|
+
name: "show" | "context" | "why" | "context-bundle";
|
|
265
|
+
argv: string[];
|
|
266
|
+
}[];
|
|
267
|
+
}>;
|
|
268
|
+
export type ProjectContextBundleV1 = z.infer<typeof projectContextBundleSchema>;
|
|
269
|
+
export type ProjectContextRuntime = "claude" | "codewith" | "agents";
|
|
270
|
+
export type ProjectContextStatus = "fresh" | "stale-source" | "stale-cache";
|
|
271
|
+
export type ProjectContextPhase = "before-compare" | "after-fragment" | "after-target" | "before-manifest";
|
|
272
|
+
export interface ProjectContextPlanInput {
|
|
273
|
+
workspace_root: string;
|
|
274
|
+
runtime: ProjectContextRuntime;
|
|
275
|
+
bundle: ProjectContextBundleV1;
|
|
276
|
+
source_path?: string;
|
|
277
|
+
status?: ProjectContextStatus;
|
|
278
|
+
age_seconds?: number;
|
|
279
|
+
now?: Date;
|
|
280
|
+
force?: boolean;
|
|
281
|
+
codewith_native_imports?: boolean;
|
|
282
|
+
}
|
|
283
|
+
export interface ProjectContextPlan {
|
|
284
|
+
workspace_root: string;
|
|
285
|
+
runtime: ProjectContextRuntime;
|
|
286
|
+
target_path: string;
|
|
287
|
+
target_relative_path: string;
|
|
288
|
+
fragment_path: string;
|
|
289
|
+
manifest_path: string;
|
|
290
|
+
cache_path: string;
|
|
291
|
+
source_path: string;
|
|
292
|
+
bundle: ProjectContextBundleV1;
|
|
293
|
+
fragment: string;
|
|
294
|
+
managed_block: string;
|
|
295
|
+
target_content: string;
|
|
296
|
+
target_previous_content: string | null;
|
|
297
|
+
status: ProjectContextStatus;
|
|
298
|
+
age_seconds: number;
|
|
299
|
+
warnings: string[];
|
|
300
|
+
included_commands: number;
|
|
301
|
+
native_imports: boolean;
|
|
302
|
+
marker: ManagedBlock | null;
|
|
303
|
+
legacy_migration: boolean;
|
|
304
|
+
expected_hashes: Map<string, string | null>;
|
|
305
|
+
}
|
|
306
|
+
export interface ProjectContextApplyOptions {
|
|
307
|
+
workspace_root: string;
|
|
308
|
+
runtime: ProjectContextRuntime;
|
|
309
|
+
bundle_json?: string;
|
|
310
|
+
bundle?: unknown;
|
|
311
|
+
source_path?: string;
|
|
312
|
+
expected_project_id?: string;
|
|
313
|
+
allow_stale_cache?: boolean;
|
|
314
|
+
max_stale_age_seconds?: number;
|
|
315
|
+
now?: Date;
|
|
316
|
+
force?: boolean;
|
|
317
|
+
dry_run?: boolean;
|
|
318
|
+
codewith_native_imports?: boolean;
|
|
319
|
+
test_hooks?: {
|
|
320
|
+
after_lock_open?: () => void;
|
|
321
|
+
atomic_exchange_unavailable?: boolean;
|
|
322
|
+
portable_create_only?: boolean;
|
|
323
|
+
before_stale_lock_remove?: (lockPath: string) => void;
|
|
324
|
+
before_compare?: (context: {
|
|
325
|
+
attempt: number;
|
|
326
|
+
plan: ProjectContextPlan;
|
|
327
|
+
}) => void;
|
|
328
|
+
after_fragment?: (context: {
|
|
329
|
+
attempt: number;
|
|
330
|
+
plan: ProjectContextPlan;
|
|
331
|
+
}) => void;
|
|
332
|
+
before_target_install?: (context: {
|
|
333
|
+
attempt: number;
|
|
334
|
+
plan: ProjectContextPlan;
|
|
335
|
+
temp_path: string;
|
|
336
|
+
}) => void;
|
|
337
|
+
after_target_exchange?: (context: {
|
|
338
|
+
attempt: number;
|
|
339
|
+
plan: ProjectContextPlan;
|
|
340
|
+
}) => void;
|
|
341
|
+
after_target?: (context: {
|
|
342
|
+
attempt: number;
|
|
343
|
+
plan: ProjectContextPlan;
|
|
344
|
+
}) => void;
|
|
345
|
+
before_manifest?: (context: {
|
|
346
|
+
attempt: number;
|
|
347
|
+
plan: ProjectContextPlan;
|
|
348
|
+
}) => void;
|
|
349
|
+
process_start_identity?: (pid: number) => string | null;
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
export interface ProjectContextApplyResult {
|
|
353
|
+
applied: boolean;
|
|
354
|
+
dry_run: boolean;
|
|
355
|
+
workspace_root: string;
|
|
356
|
+
runtime: ProjectContextRuntime;
|
|
357
|
+
project_id: string;
|
|
358
|
+
revision: string;
|
|
359
|
+
hash: string;
|
|
360
|
+
status: ProjectContextStatus;
|
|
361
|
+
age_seconds: number;
|
|
362
|
+
race_retries: number;
|
|
363
|
+
target_path: string;
|
|
364
|
+
fragment_path: string;
|
|
365
|
+
manifest_path: string;
|
|
366
|
+
cache_path: string;
|
|
367
|
+
snapshot_path: string | null;
|
|
368
|
+
warnings: string[];
|
|
369
|
+
}
|
|
370
|
+
interface ManagedBlock {
|
|
371
|
+
start: number;
|
|
372
|
+
end: number;
|
|
373
|
+
id: string;
|
|
374
|
+
revision: string;
|
|
375
|
+
hash: string;
|
|
376
|
+
legacy: boolean;
|
|
377
|
+
}
|
|
378
|
+
export interface ProjectContextSessionRenderInput {
|
|
379
|
+
tool: SessionRenderTool;
|
|
380
|
+
adapter_mode: SessionRenderMode;
|
|
381
|
+
target_home: string;
|
|
382
|
+
project_root?: string;
|
|
383
|
+
files: SessionRenderFile[];
|
|
384
|
+
}
|
|
385
|
+
export interface ProjectContextSessionRenderComposition {
|
|
386
|
+
files: SessionRenderFile[];
|
|
387
|
+
source: SessionRenderManifest["sources"][number];
|
|
388
|
+
project_context: NonNullable<SessionRenderManifest["projectContext"]>;
|
|
389
|
+
compatibility: Record<string, unknown>;
|
|
390
|
+
guard: ProjectContextSessionGuard;
|
|
391
|
+
}
|
|
392
|
+
export interface ProjectContextSessionGuard {
|
|
393
|
+
workspace_root: string;
|
|
394
|
+
runtime: ProjectContextRuntime;
|
|
395
|
+
observed_hashes: Array<{
|
|
396
|
+
path: string;
|
|
397
|
+
sha256: string | null;
|
|
398
|
+
}>;
|
|
399
|
+
}
|
|
400
|
+
export interface ProjectContextWriteCoordination {
|
|
401
|
+
workspace_root: string;
|
|
402
|
+
assert_held: () => void;
|
|
403
|
+
}
|
|
404
|
+
export declare class ProjectContextError extends Error {
|
|
405
|
+
readonly code: string;
|
|
406
|
+
readonly details: Record<string, unknown> | undefined;
|
|
407
|
+
constructor(code: string, message: string, details?: Record<string, unknown>);
|
|
408
|
+
}
|
|
409
|
+
export declare function computeProjectContextSourceHash(value: unknown): string;
|
|
410
|
+
export declare function parseProjectContextBundle(input: string | unknown): ProjectContextBundleV1;
|
|
411
|
+
export declare function planProjectContext(input: ProjectContextPlanInput): ProjectContextPlan;
|
|
412
|
+
export declare function composeProjectContextSessionRender(input: ProjectContextSessionRenderInput): ProjectContextSessionRenderComposition | null;
|
|
413
|
+
export declare function observeProjectContextSessionGuard(input: Pick<ProjectContextSessionRenderInput, "tool" | "target_home" | "project_root">): ProjectContextSessionGuard | null;
|
|
414
|
+
export declare function withProjectContextSessionGuard<T>(guard: ProjectContextSessionGuard | undefined, action: (coordination: ProjectContextWriteCoordination | null) => T, options?: {
|
|
415
|
+
dry_run?: boolean;
|
|
416
|
+
}): T;
|
|
417
|
+
export declare function applyProjectContext(options: ProjectContextApplyOptions): ProjectContextApplyResult;
|
|
418
|
+
export declare function writeProjectContextCoordinatedFile(input: {
|
|
419
|
+
path: string;
|
|
420
|
+
content: string;
|
|
421
|
+
workspace_root: string;
|
|
422
|
+
default_mode?: number;
|
|
423
|
+
expected_hash: string | null | undefined;
|
|
424
|
+
max_observed_bytes?: number | null;
|
|
425
|
+
allow_portable_replacement?: boolean;
|
|
426
|
+
force_portable_file_ops?: boolean;
|
|
427
|
+
}): void;
|
|
428
|
+
export declare function removeProjectContextCoordinatedFile(input: {
|
|
429
|
+
path: string;
|
|
430
|
+
workspace_root: string;
|
|
431
|
+
expected_hash: string;
|
|
432
|
+
max_observed_bytes?: number | null;
|
|
433
|
+
allow_portable_removal?: boolean;
|
|
434
|
+
force_portable_file_ops?: boolean;
|
|
435
|
+
test_hooks?: {
|
|
436
|
+
after_displace?: (displacedPath: string) => void;
|
|
437
|
+
};
|
|
438
|
+
}): void;
|
|
439
|
+
export {};
|
|
440
|
+
//# sourceMappingURL=project-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-context.d.ts","sourceRoot":"","sources":["../../src/lib/project-context.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG1H,eAAO,MAAM,sBAAsB,EAAG,0CAAmD,CAAC;AAC1F,eAAO,MAAM,+BAA+B,QAAW,CAAC;AACxD,eAAO,MAAM,kCAAkC,QAAW,CAAC;AAC3D,eAAO,MAAM,iCAAiC,OAAQ,CAAC;AACvD,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,6BAA6B,2CAA2C,CAAC;AACtF,eAAO,MAAM,6BAA6B,yCAAyC,CAAC;AACpF,eAAO,MAAM,0BAA0B,sCAAsC,CAAC;AAC9E,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AACvE,eAAO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,0BAA0B,GAAG,yBAAyB,CAqIlG;AAupCD,wBAAgB,kCAAkC,CAAC,KAAK,EAAE;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,GAAG,IAAI,CAcP;AAED,wBAAgB,mCAAmC,CAAC,KAAK,EAAE;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,CAAC,EAAE;QACX,cAAc,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;KAClD,CAAC;CACH,GAAG,IAAI,CAkEP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-context.test.d.ts","sourceRoot":"","sources":["../../src/lib/project-context.test.ts"],"names":[],"mappings":""}
|
|
@@ -39,10 +39,45 @@ export interface SessionApplyResult {
|
|
|
39
39
|
export interface SessionApplyOptions {
|
|
40
40
|
dryRun?: boolean;
|
|
41
41
|
force?: boolean;
|
|
42
|
+
test_hooks?: {
|
|
43
|
+
before_apply_writes?: (context: {
|
|
44
|
+
plan: SessionRenderPlan;
|
|
45
|
+
results: SessionApplyFileResult[];
|
|
46
|
+
}) => void;
|
|
47
|
+
force_portable_file_ops?: boolean;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface SessionRestoreOptions {
|
|
51
|
+
dryRun?: boolean;
|
|
52
|
+
test_hooks?: {
|
|
53
|
+
force_portable_file_ops?: boolean;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface SessionRestoreConflict {
|
|
57
|
+
path: string;
|
|
58
|
+
relativePath: string;
|
|
59
|
+
expectedSha256: string | null;
|
|
60
|
+
actualSha256: string | null;
|
|
61
|
+
}
|
|
62
|
+
export interface SessionRestoreFileResult {
|
|
63
|
+
path: string;
|
|
64
|
+
relativePath: string;
|
|
65
|
+
action: "create" | "update" | "delete" | "unchanged";
|
|
66
|
+
previousSha256: string | null;
|
|
67
|
+
restoredSha256: string | null;
|
|
68
|
+
}
|
|
69
|
+
export interface SessionRestoreResult {
|
|
70
|
+
dryRun: boolean;
|
|
71
|
+
restored: boolean;
|
|
72
|
+
snapshotPath: string;
|
|
73
|
+
targetHome: string;
|
|
74
|
+
conflicts: SessionRestoreConflict[];
|
|
75
|
+
files: SessionRestoreFileResult[];
|
|
42
76
|
}
|
|
43
77
|
export declare class SessionApplyError extends Error {
|
|
44
78
|
constructor(message: string);
|
|
45
79
|
}
|
|
46
80
|
export declare function applySessionRender(plan: SessionRenderPlan, options?: SessionApplyOptions): SessionApplyResult;
|
|
47
81
|
export declare function checkSessionRenderDrift(targetHome: string, manifestPath?: string): SessionDriftCheck;
|
|
82
|
+
export declare function restoreSessionRenderSnapshot(snapshotPath: string, options?: SessionRestoreOptions): SessionRestoreResult;
|
|
48
83
|
//# sourceMappingURL=session-apply.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-apply.d.ts","sourceRoot":"","sources":["../../src/lib/session-apply.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session-apply.d.ts","sourceRoot":"","sources":["../../src/lib/session-apply.ts"],"names":[],"mappings":"AAiBA,OAAO,EAIL,KAAK,qBAAqB,EAE1B,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,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B;AA+GD,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAoDpG;AAED,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,CA8BtB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const CODEWITH_NATIVE_IMPORTS_ENV = "HASNA_CONFIGS_CODEWITH_NATIVE_IMPORTS";
|
|
2
|
+
export declare const SESSION_RENDER_MANAGED_MARKER = "Managed by @hasna/configs session render";
|
|
3
|
+
export declare const SESSION_RENDER_SCHEMA = "hasna.configs.session-render/v1";
|
|
4
|
+
/**
|
|
5
|
+
* The renderer's private namespace inside every session target home. Everything
|
|
6
|
+
* the session renderer owns that is not a provider-native file lives here, so
|
|
7
|
+
* these constants are the single source of truth for both rendering and the
|
|
8
|
+
* `apply` ownership guard.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SESSION_RENDER_MANAGED_NAMESPACE = ".hasna";
|
|
11
|
+
export declare const SESSION_RENDER_INSTRUCTIONS_MANAGED_DIR = ".hasna/instructions";
|
|
12
|
+
export declare const SESSION_RENDER_MANIFEST_RELATIVE_PATH = ".hasna/session-render-manifest.json";
|
|
13
|
+
export declare const SESSION_RENDER_SNAPSHOT_RELATIVE_DIR = ".hasna/session-render-snapshots";
|
|
14
|
+
export declare const SESSION_INSTRUCTION_LAYERS: readonly ["global", "tool", "account", "machine", "division", "workspace", "repo", "path", "agent", "session", "local"];
|
|
15
|
+
//# sourceMappingURL=session-render-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-render-contract.d.ts","sourceRoot":"","sources":["../../src/lib/session-render-contract.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,0CAA0C,CAAC;AACnF,eAAO,MAAM,6BAA6B,6CAA6C,CAAC;AACxF,eAAO,MAAM,qBAAqB,oCAAoC,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,WAAW,CAAC;AACzD,eAAO,MAAM,uCAAuC,wBAAqD,CAAC;AAC1G,eAAO,MAAM,qCAAqC,wCAAqE,CAAC;AACxH,eAAO,MAAM,oCAAoC,oCAAiE,CAAC;AAEnH,eAAO,MAAM,0BAA0B,yHAY7B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when the path sits inside (or is) a directory the session renderer owns
|
|
3
|
+
* exclusively. Matching is on whole path segments and is home-agnostic on
|
|
4
|
+
* purpose: the renderer's target homes are provider profile homes
|
|
5
|
+
* (`~/.claude`, `~/.codex`, `~/.hasna/accounts/profiles/<tool>/<account>`, …),
|
|
6
|
+
* not the config home, so anchoring the check to a known home list is exactly
|
|
7
|
+
* the gap this guard closes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function pathIsSessionRenderManagedDir(absolutePath: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* True when some ancestor of the path is a session target home whose render
|
|
12
|
+
* manifest claims that exact file. This is the renderer's own record of what it
|
|
13
|
+
* wrote, so it covers provider-native outputs (`CLAUDE.md`, `AGENTS.md`,
|
|
14
|
+
* `opencode.json`, `.cursor/rules/*.mdc`) without statically reserving
|
|
15
|
+
* directories that the config fan-out also writes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function sessionRenderManifestClaimsPath(absolutePath: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The session renderer owns a path when it is inside one of the renderer's own
|
|
20
|
+
* managed directories, or when a target home's render manifest claims it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function sessionRenderOwnsPath(absolutePath: string): boolean;
|
|
23
|
+
//# sourceMappingURL=session-render-ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-render-ownership.d.ts","sourceRoot":"","sources":["../../src/lib/session-render-ownership.ts"],"names":[],"mappings":"AAiCA;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAS3E;AAiCD;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAe7E;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAEnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-render-ownership.test.d.ts","sourceRoot":"","sources":["../../src/lib/session-render-ownership.test.ts"],"names":[],"mappings":""}
|