cwtools-shared 0.3.0 → 0.5.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/catalog.d.ts +17 -0
- package/dist/catalog.js +30 -0
- package/dist/debug/zz.d.ts +1 -0
- package/dist/debug/zz.js +12 -0
- package/dist/generated/mcpTools.d.ts +4 -4
- package/dist/generated/mcpTools.js +4 -4
- package/dist/host/capabilities.js +4 -0
- package/dist/host/diagnostics.d.ts +3 -0
- package/dist/host/filesystem.d.ts +2 -0
- package/dist/host/hostServices.d.ts +42 -0
- package/dist/host/indexing.d.ts +3 -0
- package/dist/host/readiness.js +10 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.js +18 -1
- package/dist/knowledge/interfaceKnowledge.d.ts +8 -0
- package/dist/knowledge/interfaceKnowledge.js +222 -0
- package/dist/project/descriptor.d.ts +12 -0
- package/dist/project/descriptor.js +69 -0
- package/dist/project/init.d.ts +11 -0
- package/dist/project/init.js +356 -0
- package/dist/project/knowledge.d.ts +6 -0
- package/dist/project/knowledge.js +20 -8
- package/dist/project/profile.d.ts +62 -7
- package/dist/project/profile.js +4 -3
- package/dist/project/profileBuilder.d.ts +31 -0
- package/dist/project/profileBuilder.js +989 -0
- package/dist/tools/archetypeArtifacts.d.ts +29 -0
- package/dist/tools/archetypeArtifacts.js +136 -0
- package/dist/tools/archetypeSlots.d.ts +32 -0
- package/dist/tools/archetypeSlots.js +257 -0
- package/dist/tools/archetypeTools.d.ts +4 -0
- package/dist/tools/archetypeTools.js +118 -0
- package/dist/tools/callHandler.js +11 -7
- package/dist/tools/catalog.d.ts +4094 -0
- package/dist/tools/catalog.js +5031 -0
- package/dist/tools/domainTools.d.ts +8 -0
- package/dist/tools/domainTools.js +222 -0
- package/dist/tools/mcpSchema.d.ts +8 -11
- package/dist/tools/mcpSchema.js +28 -8
- package/dist/tools/mediaWrites.d.ts +52 -0
- package/dist/tools/mediaWrites.js +322 -0
- package/dist/tools/names.d.ts +4 -4
- package/dist/tools/names.js +13 -0
- package/dist/tools/pdxWriteCore.d.ts +51 -0
- package/dist/tools/pdxWriteCore.js +628 -0
- package/dist/tools/pdxWrites.d.ts +88 -0
- package/dist/tools/pdxWrites.js +629 -0
- package/dist/tools/scopeBridge.d.ts +36 -0
- package/dist/tools/scopeBridge.js +173 -0
- package/dist/tools/symbols.js +22 -2
- package/dist/tools/toolHandlers.js +98 -8
- package/package.json +12 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { HostServices } from '../host/hostServices';
|
|
2
|
+
import type { SharedToolResult } from './schema';
|
|
3
|
+
import { type TypedPdxCandidate } from './pdxWriteCore';
|
|
4
|
+
/**
|
|
5
|
+
* Transport-neutral typed PDXScript writes plus the candidate transaction that
|
|
6
|
+
* serialises them, so the MCP server and the VS Code agent share one contract.
|
|
7
|
+
*
|
|
8
|
+
* A candidate is built in memory, staged in a transaction, validated against the
|
|
9
|
+
* host language server, and only then committed; every commit is lock-serialised
|
|
10
|
+
* and rolled back when the post-write diagnostics regress. Workspace containment
|
|
11
|
+
* is re-checked on the resolved path, so a staged file can never escape it.
|
|
12
|
+
*/
|
|
13
|
+
export interface DomainWriteContext {
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}
|
|
16
|
+
export interface CandidateTransactionArgs {
|
|
17
|
+
action: 'begin' | 'status' | 'validate' | 'commit' | 'discard';
|
|
18
|
+
transactionId?: string;
|
|
19
|
+
validationPassed?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface TypedPdxWriteResult {
|
|
22
|
+
success: boolean;
|
|
23
|
+
mode: 'preview' | 'stage';
|
|
24
|
+
transactionId?: string;
|
|
25
|
+
candidate?: TypedPdxCandidate;
|
|
26
|
+
message?: string;
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface OverlayValidationFile {
|
|
30
|
+
uri: string;
|
|
31
|
+
ok: boolean;
|
|
32
|
+
contentHash?: string;
|
|
33
|
+
diagnostics: Array<{
|
|
34
|
+
code: string;
|
|
35
|
+
severity: string;
|
|
36
|
+
message: string;
|
|
37
|
+
line: number;
|
|
38
|
+
column: number;
|
|
39
|
+
}>;
|
|
40
|
+
error?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface OverlayValidation {
|
|
43
|
+
validationLevel?: string;
|
|
44
|
+
limitations?: string[];
|
|
45
|
+
files: OverlayValidationFile[];
|
|
46
|
+
}
|
|
47
|
+
export interface CandidateTransactionResult {
|
|
48
|
+
success: boolean;
|
|
49
|
+
action: string;
|
|
50
|
+
transactionId?: string;
|
|
51
|
+
state?: string;
|
|
52
|
+
files: string[];
|
|
53
|
+
bytes: number;
|
|
54
|
+
commit?: {
|
|
55
|
+
committed: boolean;
|
|
56
|
+
state: string;
|
|
57
|
+
files: string[];
|
|
58
|
+
rollback: {
|
|
59
|
+
attempted: boolean;
|
|
60
|
+
succeeded: boolean;
|
|
61
|
+
paths: string[];
|
|
62
|
+
errors: Array<{
|
|
63
|
+
path: string;
|
|
64
|
+
error: string;
|
|
65
|
+
}>;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
diagnosticDeltas?: Record<string, DiagnosticDelta>;
|
|
69
|
+
overlayValidation?: OverlayValidation;
|
|
70
|
+
infrastructureError?: string;
|
|
71
|
+
error?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface DiagnosticSnapshotEntry {
|
|
74
|
+
code: string;
|
|
75
|
+
severity: string;
|
|
76
|
+
message: string;
|
|
77
|
+
line: number;
|
|
78
|
+
column: number;
|
|
79
|
+
}
|
|
80
|
+
export interface DiagnosticDelta {
|
|
81
|
+
comparable: boolean;
|
|
82
|
+
added: DiagnosticSnapshotEntry[];
|
|
83
|
+
removed: DiagnosticSnapshotEntry[];
|
|
84
|
+
}
|
|
85
|
+
export declare const TYPED_PDX_WRITE_FIELDS: readonly ["filePath", "operation", "expectedHash", "mode", "transactionId"];
|
|
86
|
+
export declare function typedPdxWriteWithHost(host: HostServices, args: Record<string, unknown>, context?: DomainWriteContext): Promise<SharedToolResult<TypedPdxWriteResult>>;
|
|
87
|
+
export declare const CANDIDATE_TRANSACTION_FIELDS: readonly ["action", "transactionId", "validationPassed"];
|
|
88
|
+
export declare function candidateTransactionWithHost(host: HostServices, args: Record<string, unknown>, context?: DomainWriteContext): Promise<SharedToolResult<CandidateTransactionResult>>;
|