human-to-code 0.1.13 → 0.1.14
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 +4 -39
- package/dist/agents/direct/application.d.ts +7 -0
- package/dist/agents/direct/application.d.ts.map +1 -0
- package/dist/agents/direct/application.js +30 -0
- package/dist/agents/direct/application.js.map +1 -0
- package/dist/agents/direct/discovery.d.ts +4 -0
- package/dist/agents/direct/discovery.d.ts.map +1 -0
- package/dist/agents/direct/discovery.js +101 -0
- package/dist/agents/direct/discovery.js.map +1 -0
- package/dist/agents/direct/file-memory.d.ts +20 -0
- package/dist/agents/direct/file-memory.d.ts.map +1 -0
- package/dist/agents/direct/file-memory.js +174 -0
- package/dist/agents/direct/file-memory.js.map +1 -0
- package/dist/agents/direct/generation-client.d.ts +4 -0
- package/dist/agents/direct/generation-client.d.ts.map +1 -0
- package/dist/agents/direct/generation-client.js +56 -0
- package/dist/agents/direct/generation-client.js.map +1 -0
- package/dist/agents/direct/index.d.ts +10 -0
- package/dist/agents/direct/index.d.ts.map +1 -0
- package/dist/agents/direct/index.js +10 -0
- package/dist/agents/direct/index.js.map +1 -0
- package/dist/agents/direct/languages.d.ts +5 -0
- package/dist/agents/direct/languages.d.ts.map +1 -0
- package/dist/agents/direct/languages.js +17 -0
- package/dist/agents/direct/languages.js.map +1 -0
- package/dist/agents/direct/marker-parser.d.ts +8 -0
- package/dist/agents/direct/marker-parser.d.ts.map +1 -0
- package/dist/agents/direct/marker-parser.js +68 -0
- package/dist/agents/direct/marker-parser.js.map +1 -0
- package/dist/agents/direct/presentation.d.ts +4 -0
- package/dist/agents/direct/presentation.d.ts.map +1 -0
- package/dist/agents/direct/presentation.js +28 -0
- package/dist/agents/direct/presentation.js.map +1 -0
- package/dist/agents/direct/types.d.ts +74 -0
- package/dist/agents/direct/types.d.ts.map +1 -0
- package/dist/agents/direct/types.js +2 -0
- package/dist/agents/direct/types.js.map +1 -0
- package/dist/agents/guided/api-grounding.d.ts +6 -0
- package/dist/agents/guided/api-grounding.d.ts.map +1 -0
- package/dist/agents/guided/api-grounding.js +158 -0
- package/dist/agents/guided/api-grounding.js.map +1 -0
- package/dist/agents/guided/index.d.ts +7 -0
- package/dist/agents/guided/index.d.ts.map +1 -0
- package/dist/agents/guided/index.js +7 -0
- package/dist/agents/guided/index.js.map +1 -0
- package/dist/agents/guided/patch-diff.d.ts +4 -0
- package/dist/agents/guided/patch-diff.d.ts.map +1 -0
- package/dist/agents/guided/patch-diff.js +31 -0
- package/dist/agents/guided/patch-diff.js.map +1 -0
- package/dist/agents/guided/types.d.ts +55 -0
- package/dist/agents/guided/types.d.ts.map +1 -0
- package/dist/agents/guided/types.js +2 -0
- package/dist/agents/guided/types.js.map +1 -0
- package/dist/agents/guided/workflow.d.ts +17 -0
- package/dist/agents/guided/workflow.d.ts.map +1 -0
- package/dist/agents/guided/workflow.js +1360 -0
- package/dist/agents/guided/workflow.js.map +1 -0
- package/dist/agents/guided/workspace-policy.d.ts +9 -0
- package/dist/agents/guided/workspace-policy.d.ts.map +1 -0
- package/dist/agents/guided/workspace-policy.js +83 -0
- package/dist/agents/guided/workspace-policy.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -55
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/pipeline/simple.d.ts +3 -160
- package/dist/pipeline/simple.d.ts.map +1 -1
- package/dist/pipeline/simple.js +3 -502
- package/dist/pipeline/simple.js.map +1 -1
- package/dist/pipeline/workflow.d.ts +5 -66
- package/dist/pipeline/workflow.d.ts.map +1 -1
- package/dist/pipeline/workflow.js +5 -1642
- package/dist/pipeline/workflow.js.map +1 -1
- package/dist/prompts/direct-conversion.d.ts +13 -0
- package/dist/prompts/direct-conversion.d.ts.map +1 -0
- package/dist/prompts/direct-conversion.js +35 -0
- package/dist/prompts/direct-conversion.js.map +1 -0
- package/dist/prompts/guided-patch.d.ts +14 -0
- package/dist/prompts/guided-patch.d.ts.map +1 -0
- package/dist/prompts/guided-patch.js +41 -0
- package/dist/prompts/guided-patch.js.map +1 -0
- package/dist/prompts/guided-repair.d.ts +12 -0
- package/dist/prompts/guided-repair.d.ts.map +1 -0
- package/dist/prompts/guided-repair.js +30 -0
- package/dist/prompts/guided-repair.js.map +1 -0
- package/dist/prompts/index.d.ts +6 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +6 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/provider-output.d.ts +4 -0
- package/dist/prompts/provider-output.d.ts.map +1 -0
- package/dist/prompts/provider-output.js +12 -0
- package/dist/prompts/provider-output.js.map +1 -0
- package/dist/providers/providers.d.ts.map +1 -1
- package/dist/providers/providers.js +2 -10
- package/dist/providers/providers.js.map +1 -1
- package/docs/ARCHITECTURE.md +30 -29
- package/docs/MODULES.md +46 -10
- package/docs/SCALABILITY.md +10 -9
- package/docs/roadmap/README.md +1 -1
- package/docs/roadmap/ruby.md +1 -1
- package/package.json +1 -6
- package/dist/pipeline/agent-tools.d.ts +0 -348
- package/dist/pipeline/agent-tools.d.ts.map +0 -1
- package/dist/pipeline/agent-tools.js +0 -542
- package/dist/pipeline/agent-tools.js.map +0 -1
- package/dist/pipeline/agent-tui.d.ts +0 -15
- package/dist/pipeline/agent-tui.d.ts.map +0 -1
- package/dist/pipeline/agent-tui.js +0 -133
- package/dist/pipeline/agent-tui.js.map +0 -1
- package/dist/pipeline/deep-agent.d.ts +0 -61
- package/dist/pipeline/deep-agent.d.ts.map +0 -1
- package/dist/pipeline/deep-agent.js +0 -395
- package/dist/pipeline/deep-agent.js.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,cAAc,qBAAqB,CAAC;AA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AC;AAC7C,cAAc,6BAA6B,CAAC;AAE5C,8EAA8E;AAC9E,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AAEvC,+EAA+E;AAC/E,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AAEnC,6EAA6E;AAC7E,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,163 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* This is the lightweight, direct path: discover human-language units, show a
|
|
5
|
-
* receipt (requests / provider / model), and on confirmation write real code.
|
|
6
|
-
* Two unit kinds are supported:
|
|
7
|
-
*
|
|
8
|
-
* 1. A whole `*.human` file (not `*.strict.human`) -> sibling `<base>.<ext>`.
|
|
9
|
-
* 2. An inline `@human` marker inside an existing source file -> the marker
|
|
10
|
-
* region is replaced in place with generated code.
|
|
11
|
-
*
|
|
12
|
-
* It talks to a local Ollama endpoint directly (no extra dependency) so it works
|
|
13
|
-
* out of the box; the `generateCode` seam can be swapped for another provider.
|
|
2
|
+
* @deprecated Compatibility entry point. New code should import the direct
|
|
3
|
+
* conversion agent from `src/agents/direct/index.ts`.
|
|
14
4
|
*/
|
|
15
|
-
|
|
16
|
-
import { type StaticFileMemoryEntry } from "./file-memory.ts";
|
|
17
|
-
export interface LanguageProfile {
|
|
18
|
-
/** Output file extension without a dot. */
|
|
19
|
-
ext: string;
|
|
20
|
-
/** Human label used in prompts. */
|
|
21
|
-
label: string;
|
|
22
|
-
}
|
|
23
|
-
/** Operator-declared config language -> output extension and label. */
|
|
24
|
-
export declare const LANGUAGE_PROFILES: Record<string, LanguageProfile>;
|
|
25
|
-
export declare function languageProfile(language: string): LanguageProfile;
|
|
26
|
-
export interface ConversionUnit {
|
|
27
|
-
kind: "file" | "inline";
|
|
28
|
-
/** Project-relative source path. */
|
|
29
|
-
sourcePath: string;
|
|
30
|
-
/** Absolute source path. */
|
|
31
|
-
absoluteSource: string;
|
|
32
|
-
/** The extracted human-language instruction. */
|
|
33
|
-
prompt: string;
|
|
34
|
-
/** For `file` units, the project-relative output path to write. */
|
|
35
|
-
outputPath?: string;
|
|
36
|
-
/** For `inline` units, the character range of the marker to replace. */
|
|
37
|
-
range?: {
|
|
38
|
-
start: number;
|
|
39
|
-
end: number;
|
|
40
|
-
};
|
|
41
|
-
/** 1-based source line of the marker, for progress display. */
|
|
42
|
-
line?: number;
|
|
43
|
-
/** Short human-readable description for the receipt. */
|
|
44
|
-
describe: string;
|
|
45
|
-
}
|
|
46
|
-
export type FileMemoryEntry = StaticFileMemoryEntry;
|
|
47
|
-
export declare class FileMemoryConflictError extends Error {
|
|
48
|
-
constructor(message: string);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Ephemeral memory for static declarations and earlier inline replacements in
|
|
52
|
-
* one source file.
|
|
53
|
-
*
|
|
54
|
-
* The memory is derived deterministically from marker ranges and generated
|
|
55
|
-
* replacements. It is never written to disk and lives only for one conversion
|
|
56
|
-
* command. A virtual copy of the file lets later line numbers account for
|
|
57
|
-
* earlier replacements that added or removed lines.
|
|
58
|
-
*/
|
|
59
|
-
export declare class FileMemory {
|
|
60
|
-
#private;
|
|
61
|
-
readonly sourcePath: string;
|
|
62
|
-
constructor(sourcePath: string, sourceText: string);
|
|
63
|
-
get entries(): readonly FileMemoryEntry[];
|
|
64
|
-
rememberReplacement(range: {
|
|
65
|
-
start: number;
|
|
66
|
-
end: number;
|
|
67
|
-
}, code: string): void;
|
|
68
|
-
/** Render deterministic, read-only context for the next marker prompt. */
|
|
69
|
-
render(): string;
|
|
70
|
-
/**
|
|
71
|
-
* Remove only exact repeated FileMemory prefixes from a model response, then
|
|
72
|
-
* reject any remaining declaration that conflicts with remembered code.
|
|
73
|
-
* This is deterministic host cleanup, not an AI rewrite.
|
|
74
|
-
*
|
|
75
|
-
* Signature-only fragments (e.g. `function add(a, b) {`) are never treated
|
|
76
|
-
* as repeats: a new block legitimately starts with the same signature, and
|
|
77
|
-
* stripping it would leave a decapitated body.
|
|
78
|
-
*/
|
|
79
|
-
normalizeReplacement(code: string): string;
|
|
80
|
-
}
|
|
81
|
-
export interface UnitGenerationContext {
|
|
82
|
-
inline: boolean;
|
|
83
|
-
/** Static declarations and earlier replacements in this unit's file. */
|
|
84
|
-
fileMemory?: string;
|
|
85
|
-
}
|
|
86
|
-
export interface GeneratedConversionUnit {
|
|
87
|
-
unit: ConversionUnit;
|
|
88
|
-
code: string;
|
|
89
|
-
/** Set when this unit could not be generated; the others are unaffected. */
|
|
90
|
-
error?: string;
|
|
91
|
-
}
|
|
92
|
-
/** Live progress for one unit during a deterministic conversion run. */
|
|
93
|
-
export type ConversionProgress = {
|
|
94
|
-
kind: "start";
|
|
95
|
-
unit: ConversionUnit;
|
|
96
|
-
attempt: number;
|
|
97
|
-
} | {
|
|
98
|
-
kind: "done";
|
|
99
|
-
unit: ConversionUnit;
|
|
100
|
-
} | {
|
|
101
|
-
kind: "skip";
|
|
102
|
-
unit: ConversionUnit;
|
|
103
|
-
reason: string;
|
|
104
|
-
};
|
|
105
|
-
export interface GenerateUnitsOptions {
|
|
106
|
-
/** Extra generation attempts when a unit trips the FileMemory guard or the provider errors. */
|
|
107
|
-
retries?: number;
|
|
108
|
-
onProgress?: (event: ConversionProgress) => void;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Generate units in semantic order. Inline markers in a file run top-to-bottom
|
|
112
|
-
* and receive deterministic FileMemory from earlier replacements. No source
|
|
113
|
-
* file is changed here; callers apply inline replacements in reverse offset
|
|
114
|
-
* order afterward.
|
|
115
|
-
*
|
|
116
|
-
* Each unit is isolated: a provider error or a FileMemory conflict on one unit
|
|
117
|
-
* is retried, then recorded as a skipped unit (with a reason) so the remaining
|
|
118
|
-
* units still convert. Only a security stop aborts the whole run.
|
|
119
|
-
*/
|
|
120
|
-
export declare function generateConversionUnits(units: readonly ConversionUnit[], generator: (unit: ConversionUnit, context: UnitGenerationContext) => Promise<string>, options?: GenerateUnitsOptions): Promise<GeneratedConversionUnit[]>;
|
|
121
|
-
interface InlineMarker {
|
|
122
|
-
prompt: string;
|
|
123
|
-
start: number;
|
|
124
|
-
end: number;
|
|
125
|
-
}
|
|
126
|
-
/** Find every `@human` marker in a source text with its exact character range. */
|
|
127
|
-
export declare function extractInlineMarkers(text: string): InlineMarker[];
|
|
128
|
-
/**
|
|
129
|
-
* Discover all conversion units under `root`: whole `.human` files plus inline
|
|
130
|
-
* `@human` markers in recognized source files. Deterministic and bounded.
|
|
131
|
-
*/
|
|
132
|
-
export declare function discoverUnits(root: string, language: string): Promise<ConversionUnit[]>;
|
|
133
|
-
/** Render the invoice/receipt shown before any code is written. */
|
|
134
|
-
export declare function renderReceipt(units: readonly ConversionUnit[], provider: string, model: string, language: string, engine?: "agent" | "simple"): string;
|
|
135
|
-
/** Remove a single fenced code block wrapper if the model added one. */
|
|
136
|
-
export declare function stripCodeFence(output: string): string;
|
|
137
|
-
export interface GenerateOptions {
|
|
138
|
-
language: string;
|
|
139
|
-
provider: string;
|
|
140
|
-
model: string;
|
|
141
|
-
baseUrl?: string;
|
|
142
|
-
apiKey?: string;
|
|
143
|
-
/** Whether this request replaces one inline @human marker. */
|
|
144
|
-
inline?: boolean;
|
|
145
|
-
/** Deterministic earlier replacements from the same file. */
|
|
146
|
-
fileMemory?: string;
|
|
147
|
-
signal?: AbortSignal;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Generate raw code for one prompt. Talks to a local Ollama `/api/chat`
|
|
151
|
-
* endpoint by default; an OpenAI-compatible chat endpoint is used when the
|
|
152
|
-
* configured provider is `openai`.
|
|
153
|
-
*/
|
|
154
|
-
export declare function generateCode(prompt: string, options: GenerateOptions): Promise<string>;
|
|
155
|
-
export interface AppliedUnit {
|
|
156
|
-
unit: ConversionUnit;
|
|
157
|
-
writtenPath: string;
|
|
158
|
-
}
|
|
159
|
-
/** Write generated code for one unit and return the path that changed. */
|
|
160
|
-
export declare function applyUnit(root: string, unit: ConversionUnit, code: string): Promise<string>;
|
|
161
|
-
export declare function pathExists(target: string): Promise<boolean>;
|
|
162
|
-
export { dirname };
|
|
5
|
+
export * from "../agents/direct/index.ts";
|
|
163
6
|
//# sourceMappingURL=simple.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../src/pipeline/simple.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../src/pipeline/simple.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,2BAA2B,CAAC"}
|