@kawacode/mcp 6.9.5 → 7.0.1
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/CLAUDE.md.example +23 -0
- package/README.md +88 -1
- package/build/index.js +20 -15
- package/build/index.js.map +1 -1
- package/build/prompts/intent-first-workflow.js +1 -2
- package/build/prompts/intent-first-workflow.js.map +1 -1
- package/build/tools/_mangled-args.d.ts +63 -0
- package/build/tools/_mangled-args.js +116 -0
- package/build/tools/_mangled-args.js.map +1 -0
- package/build/tools/_mangled-args.test.js +110 -0
- package/build/tools/_mangled-args.test.js.map +1 -0
- package/build/tools/activate-intent.d.ts +5 -52
- package/build/tools/activate-intent.js +14 -7
- package/build/tools/activate-intent.js.map +1 -1
- package/build/tools/arbiter-apply.d.ts +0 -52
- package/build/tools/arbiter-apply.js +0 -3
- package/build/tools/arbiter-apply.js.map +1 -1
- package/build/tools/arbiter-resolve.d.ts +0 -52
- package/build/tools/arbiter-resolve.js +0 -3
- package/build/tools/arbiter-resolve.js.map +1 -1
- package/build/tools/check-active-intent.d.ts +0 -52
- package/build/tools/check-active-intent.js +2 -24
- package/build/tools/check-active-intent.js.map +1 -1
- package/build/tools/complete-intent.d.ts +4 -56
- package/build/tools/complete-intent.js +15 -44
- package/build/tools/complete-intent.js.map +1 -1
- package/build/tools/create-intent.d.ts +0 -52
- package/build/tools/create-intent.js +0 -4
- package/build/tools/create-intent.js.map +1 -1
- package/build/tools/detect-intent-conflicts.d.ts +0 -52
- package/build/tools/detect-intent-conflicts.js +0 -3
- package/build/tools/detect-intent-conflicts.js.map +1 -1
- package/build/tools/edit-session-decision.d.ts +0 -52
- package/build/tools/edit-session-decision.js +0 -3
- package/build/tools/edit-session-decision.js.map +1 -1
- package/build/tools/get-decision-detail.d.ts +19 -55
- package/build/tools/get-decision-detail.js +12 -7
- package/build/tools/get-decision-detail.js.map +1 -1
- package/build/tools/get-intents-for-file.d.ts +35 -53
- package/build/tools/get-intents-for-file.js +61 -26
- package/build/tools/get-intents-for-file.js.map +1 -1
- package/build/tools/get-project-decisions.d.ts +0 -52
- package/build/tools/get-project-decisions.js +0 -3
- package/build/tools/get-project-decisions.js.map +1 -1
- package/build/tools/get-relevant-context.d.ts +0 -52
- package/build/tools/get-relevant-context.js +0 -3
- package/build/tools/get-relevant-context.js.map +1 -1
- package/build/tools/get-resolution-context.d.ts +0 -52
- package/build/tools/get-resolution-context.js +0 -4
- package/build/tools/get-resolution-context.js.map +1 -1
- package/build/tools/get-session-decisions.d.ts +10 -53
- package/build/tools/get-session-decisions.js +2 -4
- package/build/tools/get-session-decisions.js.map +1 -1
- package/build/tools/index.d.ts +11 -631
- package/build/tools/index.js +2 -9
- package/build/tools/index.js.map +1 -1
- package/build/tools/infer-history.js +4 -19
- package/build/tools/infer-history.js.map +1 -1
- package/build/tools/list-team-intents.d.ts +4 -56
- package/build/tools/list-team-intents.js +0 -3
- package/build/tools/list-team-intents.js.map +1 -1
- package/build/tools/log-work.d.ts +0 -52
- package/build/tools/log-work.js +0 -3
- package/build/tools/log-work.js.map +1 -1
- package/build/tools/pre-edit-acknowledge.d.ts +0 -52
- package/build/tools/pre-edit-acknowledge.js +0 -2
- package/build/tools/pre-edit-acknowledge.js.map +1 -1
- package/build/tools/pre-edit-decision-check.d.ts +0 -52
- package/build/tools/pre-edit-decision-check.js +0 -4
- package/build/tools/pre-edit-decision-check.js.map +1 -1
- package/build/tools/record-decision.d.ts +2 -52
- package/build/tools/record-decision.js +6 -5
- package/build/tools/record-decision.js.map +1 -1
- package/build/tools/resume-intent.d.ts +0 -52
- package/build/tools/resume-intent.js +6 -4
- package/build/tools/resume-intent.js.map +1 -1
- package/build/tools/update-intent.d.ts +0 -52
- package/build/tools/update-intent.js +1 -5
- package/build/tools/update-intent.js.map +1 -1
- package/build/types/refs.d.ts +73 -0
- package/build/types/refs.js +73 -0
- package/build/types/refs.js.map +1 -0
- package/package.json +1 -1
- package/build/tools/_fork-fields.d.ts +0 -84
- package/build/tools/_fork-fields.js +0 -65
- package/build/tools/_fork-fields.js.map +0 -1
- package/build/tools/_salvage-mangled-args.d.ts +0 -38
- package/build/tools/_salvage-mangled-args.js +0 -87
- package/build/tools/_salvage-mangled-args.js.map +0 -1
- package/build/tools/_salvage-mangled-args.test.js +0 -73
- package/build/tools/_salvage-mangled-args.test.js.map +0 -1
- package/build/tools/evolve-decisions.d.ts +0 -90
- package/build/tools/evolve-decisions.js +0 -40
- package/build/tools/evolve-decisions.js.map +0 -1
- package/build/tools/get-intents-for-lines.d.ts +0 -123
- package/build/tools/get-intents-for-lines.js +0 -67
- package/build/tools/get-intents-for-lines.js.map +0 -1
- package/build/tools/update-features.d.ts +0 -31
- package/build/tools/update-features.js +0 -51
- package/build/tools/update-features.js.map +0 -1
- /package/build/tools/{_salvage-mangled-args.test.d.ts → _mangled-args.test.d.ts} +0 -0
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Zod schema fragment for the forkAuthor + workspaceId attribution
|
|
3
|
-
* fields added in REPO_FORKS_IMPLEMENTATION_PLAN_PHASE_1.md §5.
|
|
4
|
-
*
|
|
5
|
-
* Every MCP tool that accepts `repoOrigin` spreads `forkFieldsExtensions`
|
|
6
|
-
* into its Zod input schema and forwards `extractForkFields(input)` to the
|
|
7
|
-
* IPC payload. Both fields are OPTIONAL — Muninn resolves them
|
|
8
|
-
* automatically from `repoPath` (fork detection + workspace registry, §4.2 +
|
|
9
|
-
* §4.3). Callers only need to pass them in advanced override / testing
|
|
10
|
-
* scenarios where the desktop app's auto-resolution should be bypassed.
|
|
11
|
-
*
|
|
12
|
-
* Keep the field shape in lockstep with:
|
|
13
|
-
* - kawa.api/src/models/intents.model.ts / decisions.model.ts
|
|
14
|
-
* - kawa.muninn/src-tauri/src/gardener/handlers/intent.rs (OutboundIdentity)
|
|
15
|
-
*
|
|
16
|
-
* Drift across repos will cause silent rejection (Yup validators strip
|
|
17
|
-
* unknown fields on the API side) or runtime errors on the Muninn side.
|
|
18
|
-
*/
|
|
19
|
-
import { z } from 'zod';
|
|
20
|
-
/**
|
|
21
|
-
* Fork attribution payload. Optional in its entirety; when present, all
|
|
22
|
-
* three subfields are required (so the API can persist a coherent record).
|
|
23
|
-
*/
|
|
24
|
-
export declare const forkAuthorSchema: z.ZodObject<{
|
|
25
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
26
|
-
user: z.ZodString;
|
|
27
|
-
forkOrigin: z.ZodString;
|
|
28
|
-
}, "strip", z.ZodTypeAny, {
|
|
29
|
-
platform: "github" | "gitlab";
|
|
30
|
-
user: string;
|
|
31
|
-
forkOrigin: string;
|
|
32
|
-
}, {
|
|
33
|
-
platform: "github" | "gitlab";
|
|
34
|
-
user: string;
|
|
35
|
-
forkOrigin: string;
|
|
36
|
-
}>;
|
|
37
|
-
export type ForkAuthor = z.infer<typeof forkAuthorSchema>;
|
|
38
|
-
/**
|
|
39
|
-
* Spread into each tool's Zod input schema. The two fields are independent —
|
|
40
|
-
* a tool can accept `workspaceId` alone (override for the override target)
|
|
41
|
-
* without `forkAuthor` (canonical clone) and vice versa.
|
|
42
|
-
*/
|
|
43
|
-
export declare const forkFieldsExtensions: {
|
|
44
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
45
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
46
|
-
user: z.ZodString;
|
|
47
|
-
forkOrigin: z.ZodString;
|
|
48
|
-
}, "strip", z.ZodTypeAny, {
|
|
49
|
-
platform: "github" | "gitlab";
|
|
50
|
-
user: string;
|
|
51
|
-
forkOrigin: string;
|
|
52
|
-
}, {
|
|
53
|
-
platform: "github" | "gitlab";
|
|
54
|
-
user: string;
|
|
55
|
-
forkOrigin: string;
|
|
56
|
-
}>>;
|
|
57
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Subset of a tool input shape carrying just the §5 fields.
|
|
61
|
-
*
|
|
62
|
-
* Tools have many other fields; this is the narrow type the
|
|
63
|
-
* `extractForkFields` helper accepts so it stays usable across all 20 tools
|
|
64
|
-
* without each one importing a full input type.
|
|
65
|
-
*/
|
|
66
|
-
export interface ForkFieldsInput {
|
|
67
|
-
forkAuthor?: ForkAuthor;
|
|
68
|
-
workspaceId?: string;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Pluck the §5 fields off a tool input for IPC payload forwarding.
|
|
72
|
-
*
|
|
73
|
-
* Returns an object suitable for spreading into the `request(...)` call:
|
|
74
|
-
*
|
|
75
|
-
* await request('intent', 'create', {
|
|
76
|
-
* repoOrigin: actualOrigin,
|
|
77
|
-
* ...extractForkFields(input),
|
|
78
|
-
* ...
|
|
79
|
-
* })
|
|
80
|
-
*
|
|
81
|
-
* Fields are only included when defined, so canonical-clone callers don't
|
|
82
|
-
* spam Muninn with explicit nulls.
|
|
83
|
-
*/
|
|
84
|
-
export declare function extractForkFields(input: ForkFieldsInput): ForkFieldsInput;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Zod schema fragment for the forkAuthor + workspaceId attribution
|
|
3
|
-
* fields added in REPO_FORKS_IMPLEMENTATION_PLAN_PHASE_1.md §5.
|
|
4
|
-
*
|
|
5
|
-
* Every MCP tool that accepts `repoOrigin` spreads `forkFieldsExtensions`
|
|
6
|
-
* into its Zod input schema and forwards `extractForkFields(input)` to the
|
|
7
|
-
* IPC payload. Both fields are OPTIONAL — Muninn resolves them
|
|
8
|
-
* automatically from `repoPath` (fork detection + workspace registry, §4.2 +
|
|
9
|
-
* §4.3). Callers only need to pass them in advanced override / testing
|
|
10
|
-
* scenarios where the desktop app's auto-resolution should be bypassed.
|
|
11
|
-
*
|
|
12
|
-
* Keep the field shape in lockstep with:
|
|
13
|
-
* - kawa.api/src/models/intents.model.ts / decisions.model.ts
|
|
14
|
-
* - kawa.muninn/src-tauri/src/gardener/handlers/intent.rs (OutboundIdentity)
|
|
15
|
-
*
|
|
16
|
-
* Drift across repos will cause silent rejection (Yup validators strip
|
|
17
|
-
* unknown fields on the API side) or runtime errors on the Muninn side.
|
|
18
|
-
*/
|
|
19
|
-
import { z } from 'zod';
|
|
20
|
-
/**
|
|
21
|
-
* Fork attribution payload. Optional in its entirety; when present, all
|
|
22
|
-
* three subfields are required (so the API can persist a coherent record).
|
|
23
|
-
*/
|
|
24
|
-
export const forkAuthorSchema = z
|
|
25
|
-
.object({
|
|
26
|
-
platform: z.enum(['github', 'gitlab']),
|
|
27
|
-
user: z.string(),
|
|
28
|
-
forkOrigin: z.string(),
|
|
29
|
-
})
|
|
30
|
-
.describe('Fork attribution; usually resolved by Muninn automatically — pass only for override / testing.');
|
|
31
|
-
/**
|
|
32
|
-
* Spread into each tool's Zod input schema. The two fields are independent —
|
|
33
|
-
* a tool can accept `workspaceId` alone (override for the override target)
|
|
34
|
-
* without `forkAuthor` (canonical clone) and vice versa.
|
|
35
|
-
*/
|
|
36
|
-
export const forkFieldsExtensions = {
|
|
37
|
-
forkAuthor: forkAuthorSchema.optional(),
|
|
38
|
-
workspaceId: z
|
|
39
|
-
.string()
|
|
40
|
-
.optional()
|
|
41
|
-
.describe('Workspace identifier; usually resolved by Muninn automatically — pass only for override / testing.'),
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Pluck the §5 fields off a tool input for IPC payload forwarding.
|
|
45
|
-
*
|
|
46
|
-
* Returns an object suitable for spreading into the `request(...)` call:
|
|
47
|
-
*
|
|
48
|
-
* await request('intent', 'create', {
|
|
49
|
-
* repoOrigin: actualOrigin,
|
|
50
|
-
* ...extractForkFields(input),
|
|
51
|
-
* ...
|
|
52
|
-
* })
|
|
53
|
-
*
|
|
54
|
-
* Fields are only included when defined, so canonical-clone callers don't
|
|
55
|
-
* spam Muninn with explicit nulls.
|
|
56
|
-
*/
|
|
57
|
-
export function extractForkFields(input) {
|
|
58
|
-
const out = {};
|
|
59
|
-
if (input.forkAuthor !== undefined)
|
|
60
|
-
out.forkAuthor = input.forkAuthor;
|
|
61
|
-
if (input.workspaceId !== undefined)
|
|
62
|
-
out.workspaceId = input.workspaceId;
|
|
63
|
-
return out;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=_fork-fields.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_fork-fields.js","sourceRoot":"","sources":["../../src/tools/_fork-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC;KACD,QAAQ,CACP,gGAAgG,CACjG,CAAA;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE;IACvC,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,oGAAoG,CACrG;CACJ,CAAA;AAcD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAsB;IACtD,MAAM,GAAG,GAAoB,EAAE,CAAA;IAC/B,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;QAAE,GAAG,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAA;IACrE,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS;QAAE,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAA;IACxE,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recovery for tool-call args mangled by a mis-closed parameter tag.
|
|
3
|
-
*
|
|
4
|
-
* When an LLM emits a parameter block that is opened correctly but closed with
|
|
5
|
-
* `</fieldName>` instead of the required closing tag — and the NEXT parameter is
|
|
6
|
-
* opened without the required prefix — the harness's tool-call parser never sees
|
|
7
|
-
* a parameter boundary. Everything up to the next well-formed close is folded
|
|
8
|
-
* into the preceding field's string value. What reaches this process is
|
|
9
|
-
* perfectly valid JSON in which one field carries a self-describing tail:
|
|
10
|
-
*
|
|
11
|
-
* { consequences: 'real text</consequences>\n<parameter name="symptom">real symptom' }
|
|
12
|
-
*
|
|
13
|
-
* There is no second wire format to parse — the tail is simply data. But it is
|
|
14
|
-
* losslessly recoverable, because it names the field it was meant for and
|
|
15
|
-
* carries that field's value verbatim.
|
|
16
|
-
*
|
|
17
|
-
* This is deliberately a compensating path (the project otherwise forbids
|
|
18
|
-
* fallbacks): left alone, the corruption reaches the store, syncs, and becomes
|
|
19
|
-
* immutable, which has already cost several supersede cycles. Recovery is
|
|
20
|
-
* strictly guarded and always logged, never silent.
|
|
21
|
-
*/
|
|
22
|
-
export interface SalvageEntry {
|
|
23
|
-
/** The field whose value was recovered. */
|
|
24
|
-
field: string;
|
|
25
|
-
/** The field that had absorbed it. */
|
|
26
|
-
fromField: string;
|
|
27
|
-
}
|
|
28
|
-
export interface SalvageResult {
|
|
29
|
-
args: Record<string, unknown>;
|
|
30
|
-
salvaged: SalvageEntry[];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Peel absorbed fields out of `args`. Returns a new object; `args` is untouched.
|
|
34
|
-
*
|
|
35
|
-
* `knownFields` are the schema field names of the tool being called — recovery
|
|
36
|
-
* is refused for anything not in that set.
|
|
37
|
-
*/
|
|
38
|
-
export declare function salvageMangledArgs(args: Record<string, unknown>, knownFields: readonly string[]): SalvageResult;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recovery for tool-call args mangled by a mis-closed parameter tag.
|
|
3
|
-
*
|
|
4
|
-
* When an LLM emits a parameter block that is opened correctly but closed with
|
|
5
|
-
* `</fieldName>` instead of the required closing tag — and the NEXT parameter is
|
|
6
|
-
* opened without the required prefix — the harness's tool-call parser never sees
|
|
7
|
-
* a parameter boundary. Everything up to the next well-formed close is folded
|
|
8
|
-
* into the preceding field's string value. What reaches this process is
|
|
9
|
-
* perfectly valid JSON in which one field carries a self-describing tail:
|
|
10
|
-
*
|
|
11
|
-
* { consequences: 'real text</consequences>\n<parameter name="symptom">real symptom' }
|
|
12
|
-
*
|
|
13
|
-
* There is no second wire format to parse — the tail is simply data. But it is
|
|
14
|
-
* losslessly recoverable, because it names the field it was meant for and
|
|
15
|
-
* carries that field's value verbatim.
|
|
16
|
-
*
|
|
17
|
-
* This is deliberately a compensating path (the project otherwise forbids
|
|
18
|
-
* fallbacks): left alone, the corruption reaches the store, syncs, and becomes
|
|
19
|
-
* immutable, which has already cost several supersede cycles. Recovery is
|
|
20
|
-
* strictly guarded and always logged, never silent.
|
|
21
|
-
*/
|
|
22
|
-
/** `</host>` + optional whitespace + a parameter opening + everything after it. */
|
|
23
|
-
const MANGLED_TAIL = /<\/([A-Za-z_][\w-]*)>\s*<parameter name="([A-Za-z_]\w*)">([\s\S]*)$/;
|
|
24
|
-
/**
|
|
25
|
-
* Arrays and objects arrive as JSON text; anything else is a plain string.
|
|
26
|
-
* Only attempt a parse when the value actually looks structured, so a string
|
|
27
|
-
* like "123" or "true" is never silently coerced to another type.
|
|
28
|
-
*/
|
|
29
|
-
function parseSalvagedValue(raw) {
|
|
30
|
-
const trimmed = raw.trim();
|
|
31
|
-
if (trimmed.startsWith('[') || trimmed.startsWith('{')) {
|
|
32
|
-
try {
|
|
33
|
-
return JSON.parse(trimmed);
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
// Not valid JSON after all — keep the text rather than dropping it.
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return trimmed;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Peel absorbed fields out of `args`. Returns a new object; `args` is untouched.
|
|
43
|
-
*
|
|
44
|
-
* `knownFields` are the schema field names of the tool being called — recovery
|
|
45
|
-
* is refused for anything not in that set.
|
|
46
|
-
*/
|
|
47
|
-
export function salvageMangledArgs(args, knownFields) {
|
|
48
|
-
const known = new Set(knownFields);
|
|
49
|
-
const out = { ...args };
|
|
50
|
-
const salvaged = [];
|
|
51
|
-
// A single malformed emission can chain: field A absorbs B, whose value in
|
|
52
|
-
// turn absorbs C. Keep peeling until a pass finds nothing new.
|
|
53
|
-
let progressed = true;
|
|
54
|
-
while (progressed) {
|
|
55
|
-
progressed = false;
|
|
56
|
-
for (const [hostField, hostValue] of Object.entries(out)) {
|
|
57
|
-
if (typeof hostValue !== 'string')
|
|
58
|
-
continue;
|
|
59
|
-
const match = hostValue.match(MANGLED_TAIL);
|
|
60
|
-
if (!match || match.index === undefined)
|
|
61
|
-
continue;
|
|
62
|
-
const [, closingTag, targetField, rawValue] = match;
|
|
63
|
-
// Three guards, all required. Any miss means this is probably genuine
|
|
64
|
-
// prose (a decision *documenting* this very bug legitimately contains
|
|
65
|
-
// these markers), so leave it alone and let normal validation decide.
|
|
66
|
-
//
|
|
67
|
-
// 1. the bogus closing tag names the host field — evidence of a
|
|
68
|
-
// mis-closed host parameter rather than incidental mention
|
|
69
|
-
if (closingTag !== hostField)
|
|
70
|
-
continue;
|
|
71
|
-
// 2. the absorbed field is real for this tool
|
|
72
|
-
if (!known.has(targetField))
|
|
73
|
-
continue;
|
|
74
|
-
// 3. it was not otherwise supplied — never overwrite genuine input
|
|
75
|
-
const existing = out[targetField];
|
|
76
|
-
if (existing !== undefined && existing !== null && existing !== '')
|
|
77
|
-
continue;
|
|
78
|
-
out[hostField] = hostValue.slice(0, match.index).trimEnd();
|
|
79
|
-
out[targetField] = parseSalvagedValue(rawValue);
|
|
80
|
-
salvaged.push({ field: targetField, fromField: hostField });
|
|
81
|
-
progressed = true;
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return { args: out, salvaged };
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=_salvage-mangled-args.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_salvage-mangled-args.js","sourceRoot":"","sources":["../../src/tools/_salvage-mangled-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,mFAAmF;AACnF,MAAM,YAAY,GAAG,qEAAqE,CAAA;AAc1F;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,GAAW;IACrC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IAC1B,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,oEAAoE;QACtE,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAA6B,EAC7B,WAA8B;IAE9B,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAA;IAClC,MAAM,GAAG,GAA4B,EAAE,GAAG,IAAI,EAAE,CAAA;IAChD,MAAM,QAAQ,GAAmB,EAAE,CAAA;IAEnC,2EAA2E;IAC3E,+DAA+D;IAC/D,IAAI,UAAU,GAAG,IAAI,CAAA;IACrB,OAAO,UAAU,EAAE,CAAC;QAClB,UAAU,GAAG,KAAK,CAAA;QAElB,KAAK,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACzD,IAAI,OAAO,SAAS,KAAK,QAAQ;gBAAE,SAAQ;YAE3C,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;YAC3C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;gBAAE,SAAQ;YAEjD,MAAM,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAA;YAEnD,sEAAsE;YACtE,sEAAsE;YACtE,sEAAsE;YACtE,EAAE;YACF,iEAAiE;YACjE,+DAA+D;YAC/D,IAAI,UAAU,KAAK,SAAS;gBAAE,SAAQ;YACtC,+CAA+C;YAC/C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;gBAAE,SAAQ;YACrC,oEAAoE;YACpE,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,CAAA;YACjC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,EAAE;gBAAE,SAAQ;YAE5E,GAAG,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAA;YAC1D,GAAG,CAAC,WAAW,CAAC,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;YAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAA;YAC3D,UAAU,GAAG,IAAI,CAAA;YACjB,MAAK;QACP,CAAC;IACH,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAA;AAChC,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { test } from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { salvageMangledArgs } from './_salvage-mangled-args.js';
|
|
4
|
-
const FIELDS = ['summary', 'rationale', 'consequences', 'symptom', 'appliesWhen', 'alternatives', 'relatedFiles'];
|
|
5
|
-
test('recovers a string field absorbed by a mis-closed host parameter', () => {
|
|
6
|
-
const { args, salvaged } = salvageMangledArgs({
|
|
7
|
-
consequences: 'Real consequences text.</consequences>\n<parameter name="symptom">Real symptom text.',
|
|
8
|
-
}, FIELDS);
|
|
9
|
-
assert.equal(args.consequences, 'Real consequences text.');
|
|
10
|
-
assert.equal(args.symptom, 'Real symptom text.');
|
|
11
|
-
assert.deepEqual(salvaged, [{ field: 'symptom', fromField: 'consequences' }]);
|
|
12
|
-
});
|
|
13
|
-
test('JSON-parses an absorbed array value', () => {
|
|
14
|
-
const { args } = salvageMangledArgs({
|
|
15
|
-
consequences: 'Text.</consequences>\n<parameter name="alternatives">["option A", "option B"]',
|
|
16
|
-
}, FIELDS);
|
|
17
|
-
assert.equal(args.consequences, 'Text.');
|
|
18
|
-
assert.deepEqual(args.alternatives, ['option A', 'option B']);
|
|
19
|
-
});
|
|
20
|
-
test('unwinds a chain of consecutive mangled parameters', () => {
|
|
21
|
-
const { args, salvaged } = salvageMangledArgs({
|
|
22
|
-
consequences: 'C text.</consequences>\n<parameter name="symptom">S text.</symptom>\n<parameter name="appliesWhen">A text.',
|
|
23
|
-
}, FIELDS);
|
|
24
|
-
assert.equal(args.consequences, 'C text.');
|
|
25
|
-
assert.equal(args.symptom, 'S text.');
|
|
26
|
-
assert.equal(args.appliesWhen, 'A text.');
|
|
27
|
-
assert.equal(salvaged.length, 2);
|
|
28
|
-
});
|
|
29
|
-
test('does NOT salvage when the closing tag does not name the host field', () => {
|
|
30
|
-
// Genuine prose that merely mentions the markers — e.g. a decision recorded
|
|
31
|
-
// *about* this bug. Left untouched.
|
|
32
|
-
const original = 'Docs: a value may end with </consequences>\n<parameter name="symptom">like so.';
|
|
33
|
-
const { args, salvaged } = salvageMangledArgs({ rationale: original }, FIELDS);
|
|
34
|
-
assert.equal(args.rationale, original);
|
|
35
|
-
assert.equal(args.symptom, undefined);
|
|
36
|
-
assert.deepEqual(salvaged, []);
|
|
37
|
-
});
|
|
38
|
-
test('does NOT salvage an unknown target field', () => {
|
|
39
|
-
const original = 'Text.</consequences>\n<parameter name="notARealField">value';
|
|
40
|
-
const { args, salvaged } = salvageMangledArgs({ consequences: original }, FIELDS);
|
|
41
|
-
assert.equal(args.consequences, original);
|
|
42
|
-
assert.deepEqual(salvaged, []);
|
|
43
|
-
});
|
|
44
|
-
test('never overwrites a target the caller actually supplied', () => {
|
|
45
|
-
const original = 'Text.</consequences>\n<parameter name="symptom">absorbed symptom';
|
|
46
|
-
const { args, salvaged } = salvageMangledArgs({ consequences: original, symptom: 'genuine symptom' }, FIELDS);
|
|
47
|
-
assert.equal(args.symptom, 'genuine symptom');
|
|
48
|
-
assert.equal(args.consequences, original);
|
|
49
|
-
assert.deepEqual(salvaged, []);
|
|
50
|
-
});
|
|
51
|
-
test('leaves clean args untouched and reports no salvage', () => {
|
|
52
|
-
const input = { summary: 'A summary', alternatives: ['x'], relatedFiles: ['a.ts'] };
|
|
53
|
-
const { args, salvaged } = salvageMangledArgs(input, FIELDS);
|
|
54
|
-
assert.deepEqual(args, input);
|
|
55
|
-
assert.deepEqual(salvaged, []);
|
|
56
|
-
});
|
|
57
|
-
test('does not mutate the caller-supplied args object', () => {
|
|
58
|
-
const input = {
|
|
59
|
-
consequences: 'Text.</consequences>\n<parameter name="symptom">S.',
|
|
60
|
-
};
|
|
61
|
-
salvageMangledArgs(input, FIELDS);
|
|
62
|
-
assert.equal(input.consequences, 'Text.</consequences>\n<parameter name="symptom">S.');
|
|
63
|
-
});
|
|
64
|
-
test('keeps the raw text when an absorbed structured value is not valid JSON', () => {
|
|
65
|
-
const { args } = salvageMangledArgs({ consequences: 'Text.</consequences>\n<parameter name="alternatives">[not, valid, json' }, FIELDS);
|
|
66
|
-
assert.equal(args.alternatives, '[not, valid, json');
|
|
67
|
-
});
|
|
68
|
-
test('ignores non-string fields', () => {
|
|
69
|
-
const { args, salvaged } = salvageMangledArgs({ relatedFiles: ['a.ts', 'b.ts'], summary: 'clean' }, FIELDS);
|
|
70
|
-
assert.deepEqual(args.relatedFiles, ['a.ts', 'b.ts']);
|
|
71
|
-
assert.deepEqual(salvaged, []);
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=_salvage-mangled-args.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_salvage-mangled-args.test.js","sourceRoot":"","sources":["../../src/tools/_salvage-mangled-args.test.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const evolveDecisionsSchema: z.ZodObject<{
|
|
3
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
4
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
5
|
-
user: z.ZodString;
|
|
6
|
-
forkOrigin: z.ZodString;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
platform: "github" | "gitlab";
|
|
9
|
-
user: string;
|
|
10
|
-
forkOrigin: string;
|
|
11
|
-
}, {
|
|
12
|
-
platform: "github" | "gitlab";
|
|
13
|
-
user: string;
|
|
14
|
-
forkOrigin: string;
|
|
15
|
-
}>>;
|
|
16
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
17
|
-
stories: z.ZodArray<z.ZodAny, "many">;
|
|
18
|
-
repoPath: z.ZodOptional<z.ZodString>;
|
|
19
|
-
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
stories: any[];
|
|
22
|
-
repoOrigin?: string | undefined;
|
|
23
|
-
repoPath?: string | undefined;
|
|
24
|
-
forkAuthor?: {
|
|
25
|
-
platform: "github" | "gitlab";
|
|
26
|
-
user: string;
|
|
27
|
-
forkOrigin: string;
|
|
28
|
-
} | undefined;
|
|
29
|
-
workspaceId?: string | undefined;
|
|
30
|
-
}, {
|
|
31
|
-
stories: any[];
|
|
32
|
-
repoOrigin?: string | undefined;
|
|
33
|
-
repoPath?: string | undefined;
|
|
34
|
-
forkAuthor?: {
|
|
35
|
-
platform: "github" | "gitlab";
|
|
36
|
-
user: string;
|
|
37
|
-
forkOrigin: string;
|
|
38
|
-
} | undefined;
|
|
39
|
-
workspaceId?: string | undefined;
|
|
40
|
-
}>;
|
|
41
|
-
export type EvolveDecisionsInput = z.infer<typeof evolveDecisionsSchema>;
|
|
42
|
-
export interface EvolveDecisionsResponse {
|
|
43
|
-
started: boolean;
|
|
44
|
-
message: string;
|
|
45
|
-
}
|
|
46
|
-
export declare function evolveDecisions(input: EvolveDecisionsInput): Promise<EvolveDecisionsResponse>;
|
|
47
|
-
export declare const evolveDecisionsTool: {
|
|
48
|
-
name: string;
|
|
49
|
-
description: string;
|
|
50
|
-
inputSchema: z.ZodObject<{
|
|
51
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
52
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
53
|
-
user: z.ZodString;
|
|
54
|
-
forkOrigin: z.ZodString;
|
|
55
|
-
}, "strip", z.ZodTypeAny, {
|
|
56
|
-
platform: "github" | "gitlab";
|
|
57
|
-
user: string;
|
|
58
|
-
forkOrigin: string;
|
|
59
|
-
}, {
|
|
60
|
-
platform: "github" | "gitlab";
|
|
61
|
-
user: string;
|
|
62
|
-
forkOrigin: string;
|
|
63
|
-
}>>;
|
|
64
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
65
|
-
stories: z.ZodArray<z.ZodAny, "many">;
|
|
66
|
-
repoPath: z.ZodOptional<z.ZodString>;
|
|
67
|
-
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
68
|
-
}, "strip", z.ZodTypeAny, {
|
|
69
|
-
stories: any[];
|
|
70
|
-
repoOrigin?: string | undefined;
|
|
71
|
-
repoPath?: string | undefined;
|
|
72
|
-
forkAuthor?: {
|
|
73
|
-
platform: "github" | "gitlab";
|
|
74
|
-
user: string;
|
|
75
|
-
forkOrigin: string;
|
|
76
|
-
} | undefined;
|
|
77
|
-
workspaceId?: string | undefined;
|
|
78
|
-
}, {
|
|
79
|
-
stories: any[];
|
|
80
|
-
repoOrigin?: string | undefined;
|
|
81
|
-
repoPath?: string | undefined;
|
|
82
|
-
forkAuthor?: {
|
|
83
|
-
platform: "github" | "gitlab";
|
|
84
|
-
user: string;
|
|
85
|
-
forkOrigin: string;
|
|
86
|
-
} | undefined;
|
|
87
|
-
workspaceId?: string | undefined;
|
|
88
|
-
}>;
|
|
89
|
-
handler: typeof evolveDecisions;
|
|
90
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { request } from '../services/muninn-ipc.js';
|
|
3
|
-
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
4
|
-
export const evolveDecisionsSchema = z.object({
|
|
5
|
-
stories: z.array(z.any()).describe('Array of story objects from a previous infer_history run'),
|
|
6
|
-
repoPath: z.string().optional().describe('Local path to the repository root (required for auto-persist after evolution)'),
|
|
7
|
-
repoOrigin: z.string().optional().describe('Git remote origin URL (auto-detected from repoPath if not provided)'),
|
|
8
|
-
...forkFieldsExtensions,
|
|
9
|
-
});
|
|
10
|
-
export async function evolveDecisions(input) {
|
|
11
|
-
const res = await request('inference', 'evolve', {
|
|
12
|
-
stories: input.stories,
|
|
13
|
-
repoPath: input.repoPath,
|
|
14
|
-
repoOrigin: input.repoOrigin,
|
|
15
|
-
...extractForkFields(input),
|
|
16
|
-
});
|
|
17
|
-
return {
|
|
18
|
-
started: res.started,
|
|
19
|
-
message: res.message || 'Evolution pipeline started. Progress updates will be sent as the pipeline runs.'
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export const evolveDecisionsTool = {
|
|
23
|
-
name: 'evolve_decisions',
|
|
24
|
-
description: `Curate a set of previously extracted stories so that only the decisions still worth keeping are persisted.
|
|
25
|
-
|
|
26
|
-
When to use:
|
|
27
|
-
- After running \`infer_history\` in story-only mode (rare — \`infer_history\` already chains this step automatically).
|
|
28
|
-
- When you have a pre-existing set of stories you want to re-curate without re-running history extraction.
|
|
29
|
-
|
|
30
|
-
Inputs:
|
|
31
|
-
- \`stories\`: array of story objects from a previous \`infer_history\` run.
|
|
32
|
-
- \`repoPath\` (optional): when provided, curated results are persisted as intents and decisions for the repo after curation finishes.
|
|
33
|
-
|
|
34
|
-
Behavior:
|
|
35
|
-
- Runs asynchronously — returns immediately with a started/pending status while progress is reported separately. Progress and the final persisted counts are reported in the Kawa Code app, not returned to this call.
|
|
36
|
-
- The model used for curation is configured in the Kawa Code app and is not selectable per call.`,
|
|
37
|
-
inputSchema: evolveDecisionsSchema,
|
|
38
|
-
handler: evolveDecisions
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=evolve-decisions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"evolve-decisions.js","sourceRoot":"","sources":["../../src/tools/evolve-decisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE3E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,0DAA0D,CAAC;IAC9F,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+EAA+E,CAAC;IACzH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qEAAqE,CAAC;IACjH,GAAG,oBAAoB;CACxB,CAAC,CAAA;AASF,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAA2B;IAC/D,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE;QAC/C,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,GAAG,iBAAiB,CAAC,KAAK,CAAC;KAC5B,CAAC,CAAA;IAEF,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,iFAAiF;KAC1G,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE;;;;;;;;;;;;iGAYkF;IAC/F,WAAW,EAAE,qBAAqB;IAClC,OAAO,EAAE,eAAe;CACzB,CAAA"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const getIntentsForLinesSchema: z.ZodObject<{
|
|
3
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
4
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
5
|
-
user: z.ZodString;
|
|
6
|
-
forkOrigin: z.ZodString;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
platform: "github" | "gitlab";
|
|
9
|
-
user: string;
|
|
10
|
-
forkOrigin: string;
|
|
11
|
-
}, {
|
|
12
|
-
platform: "github" | "gitlab";
|
|
13
|
-
user: string;
|
|
14
|
-
forkOrigin: string;
|
|
15
|
-
}>>;
|
|
16
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
17
|
-
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
18
|
-
repoPath: z.ZodString;
|
|
19
|
-
filePath: z.ZodString;
|
|
20
|
-
startLine: z.ZodNumber;
|
|
21
|
-
endLine: z.ZodNumber;
|
|
22
|
-
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
repoPath: string;
|
|
24
|
-
filePath: string;
|
|
25
|
-
startLine: number;
|
|
26
|
-
endLine: number;
|
|
27
|
-
repoOrigin?: string | undefined;
|
|
28
|
-
forkAuthor?: {
|
|
29
|
-
platform: "github" | "gitlab";
|
|
30
|
-
user: string;
|
|
31
|
-
forkOrigin: string;
|
|
32
|
-
} | undefined;
|
|
33
|
-
workspaceId?: string | undefined;
|
|
34
|
-
}, {
|
|
35
|
-
repoPath: string;
|
|
36
|
-
filePath: string;
|
|
37
|
-
startLine: number;
|
|
38
|
-
endLine: number;
|
|
39
|
-
repoOrigin?: string | undefined;
|
|
40
|
-
forkAuthor?: {
|
|
41
|
-
platform: "github" | "gitlab";
|
|
42
|
-
user: string;
|
|
43
|
-
forkOrigin: string;
|
|
44
|
-
} | undefined;
|
|
45
|
-
workspaceId?: string | undefined;
|
|
46
|
-
}>;
|
|
47
|
-
export type GetIntentsForLinesInput = z.infer<typeof getIntentsForLinesSchema>;
|
|
48
|
-
export interface LineRangeIntent {
|
|
49
|
-
intentId: string;
|
|
50
|
-
title: string;
|
|
51
|
-
author?: string;
|
|
52
|
-
status: string;
|
|
53
|
-
description: string;
|
|
54
|
-
branch: string;
|
|
55
|
-
forkedFrom?: string;
|
|
56
|
-
overlappingLines: {
|
|
57
|
-
blockStartLine: number;
|
|
58
|
-
blockEndLine: number;
|
|
59
|
-
overlapStart: number;
|
|
60
|
-
overlapEnd: number;
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
export interface GetIntentsForLinesResponse {
|
|
64
|
-
filePath: string;
|
|
65
|
-
queryRange: {
|
|
66
|
-
startLine: number;
|
|
67
|
-
endLine: number;
|
|
68
|
-
};
|
|
69
|
-
intents: LineRangeIntent[];
|
|
70
|
-
hasOverlap: boolean;
|
|
71
|
-
warning?: string;
|
|
72
|
-
}
|
|
73
|
-
export declare function getIntentsForLines(input: GetIntentsForLinesInput): Promise<GetIntentsForLinesResponse>;
|
|
74
|
-
export declare const getIntentsForLinesTool: {
|
|
75
|
-
name: string;
|
|
76
|
-
description: string;
|
|
77
|
-
inputSchema: z.ZodObject<{
|
|
78
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
79
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
80
|
-
user: z.ZodString;
|
|
81
|
-
forkOrigin: z.ZodString;
|
|
82
|
-
}, "strip", z.ZodTypeAny, {
|
|
83
|
-
platform: "github" | "gitlab";
|
|
84
|
-
user: string;
|
|
85
|
-
forkOrigin: string;
|
|
86
|
-
}, {
|
|
87
|
-
platform: "github" | "gitlab";
|
|
88
|
-
user: string;
|
|
89
|
-
forkOrigin: string;
|
|
90
|
-
}>>;
|
|
91
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
92
|
-
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
93
|
-
repoPath: z.ZodString;
|
|
94
|
-
filePath: z.ZodString;
|
|
95
|
-
startLine: z.ZodNumber;
|
|
96
|
-
endLine: z.ZodNumber;
|
|
97
|
-
}, "strip", z.ZodTypeAny, {
|
|
98
|
-
repoPath: string;
|
|
99
|
-
filePath: string;
|
|
100
|
-
startLine: number;
|
|
101
|
-
endLine: number;
|
|
102
|
-
repoOrigin?: string | undefined;
|
|
103
|
-
forkAuthor?: {
|
|
104
|
-
platform: "github" | "gitlab";
|
|
105
|
-
user: string;
|
|
106
|
-
forkOrigin: string;
|
|
107
|
-
} | undefined;
|
|
108
|
-
workspaceId?: string | undefined;
|
|
109
|
-
}, {
|
|
110
|
-
repoPath: string;
|
|
111
|
-
filePath: string;
|
|
112
|
-
startLine: number;
|
|
113
|
-
endLine: number;
|
|
114
|
-
repoOrigin?: string | undefined;
|
|
115
|
-
forkAuthor?: {
|
|
116
|
-
platform: "github" | "gitlab";
|
|
117
|
-
user: string;
|
|
118
|
-
forkOrigin: string;
|
|
119
|
-
} | undefined;
|
|
120
|
-
workspaceId?: string | undefined;
|
|
121
|
-
}>;
|
|
122
|
-
handler: typeof getIntentsForLines;
|
|
123
|
-
};
|