@kawacode/mcp 6.9.4 → 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 -18
- package/build/index.js.map +1 -1
- package/build/prompts/intent-first-workflow.js +6 -8
- package/build/prompts/intent-first-workflow.js.map +1 -1
- package/build/services/muninn-ipc.js +6 -2
- package/build/services/muninn-ipc.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 +8 -52
- package/build/tools/activate-intent.js +26 -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 -675
- package/build/tools/index.js +2 -11
- package/build/tools/index.js.map +1 -1
- package/build/tools/infer-history.js +5 -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 +9 -60
- package/build/tools/resume-intent.js +40 -23
- 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 -96
- package/build/tools/evolve-decisions.js +0 -42
- package/build/tools/evolve-decisions.js.map +0 -1
- package/build/tools/get-intent-changes.d.ts +0 -101
- package/build/tools/get-intent-changes.js +0 -61
- package/build/tools/get-intent-changes.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
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { resolveMangledArgs, describeChainedArgs } from './_mangled-args.js';
|
|
4
|
+
const FIELDS = [
|
|
5
|
+
'summary',
|
|
6
|
+
'rationale',
|
|
7
|
+
'consequences',
|
|
8
|
+
'symptom',
|
|
9
|
+
'appliesWhen',
|
|
10
|
+
'alternatives',
|
|
11
|
+
'relatedFiles',
|
|
12
|
+
'supersedes',
|
|
13
|
+
];
|
|
14
|
+
test('recovers a single string field absorbed by a mis-closed host parameter', () => {
|
|
15
|
+
const { args, salvaged, chained } = resolveMangledArgs({
|
|
16
|
+
consequences: 'Real consequences text.</consequences>\n<parameter name="symptom">Real symptom text.',
|
|
17
|
+
}, FIELDS);
|
|
18
|
+
assert.equal(args.consequences, 'Real consequences text.');
|
|
19
|
+
assert.equal(args.symptom, 'Real symptom text.');
|
|
20
|
+
assert.deepEqual(salvaged, [{ field: 'symptom', fromField: 'consequences' }]);
|
|
21
|
+
assert.deepEqual(chained, []);
|
|
22
|
+
});
|
|
23
|
+
test('JSON-parses an absorbed array value', () => {
|
|
24
|
+
const { args } = resolveMangledArgs({
|
|
25
|
+
consequences: 'Text.</consequences>\n<parameter name="alternatives">["option A", "option B"]',
|
|
26
|
+
}, FIELDS);
|
|
27
|
+
assert.equal(args.consequences, 'Text.');
|
|
28
|
+
assert.deepEqual(args.alternatives, ['option A', 'option B']);
|
|
29
|
+
});
|
|
30
|
+
test('refuses a chain instead of unwinding it', () => {
|
|
31
|
+
// Prod shape (decision 048c8de5): the inner parameter closed correctly, so the
|
|
32
|
+
// array and the next field ran together. Separating them is reconstruction.
|
|
33
|
+
const original = 'R text.</rationale>\n<parameter name="supersedes">["146172a8"]</parameter>\n<parameter name="alternatives">["keep DELETE on abandon"]';
|
|
34
|
+
const { args, salvaged, chained } = resolveMangledArgs({ rationale: original }, FIELDS);
|
|
35
|
+
assert.equal(args.rationale, original, 'left untouched — the caller refuses the call');
|
|
36
|
+
assert.equal(args.supersedes, undefined);
|
|
37
|
+
assert.deepEqual(salvaged, []);
|
|
38
|
+
assert.deepEqual(chained, [{ field: 'rationale', absorbed: 'supersedes' }]);
|
|
39
|
+
});
|
|
40
|
+
test('refuses when the recovered value keeps a trailing close tag', () => {
|
|
41
|
+
// Prod shape (decision e484aadb): the last field kept its own close plus the
|
|
42
|
+
// emission's block closers.
|
|
43
|
+
const { salvaged, chained } = resolveMangledArgs({
|
|
44
|
+
consequences: 'C text.</consequences>\n<parameter name="relatedFiles">["deploy.sh"]</parameter>\n</invoke>',
|
|
45
|
+
}, FIELDS);
|
|
46
|
+
assert.deepEqual(salvaged, []);
|
|
47
|
+
assert.equal(chained.length, 1);
|
|
48
|
+
});
|
|
49
|
+
test('refuses when the emission was cut off mid-tag', () => {
|
|
50
|
+
// Prod shape (decision 077c1809).
|
|
51
|
+
const { salvaged, chained } = resolveMangledArgs({ rationale: 'R text.</rationale>\n<parameter name="symptom">S text.</symptom>\n<paramet' }, FIELDS);
|
|
52
|
+
assert.deepEqual(salvaged, []);
|
|
53
|
+
assert.equal(chained.length, 1);
|
|
54
|
+
});
|
|
55
|
+
test('does NOT touch prose that merely mentions the markers', () => {
|
|
56
|
+
// A decision (or intent description) recorded *about* this bug. Two such
|
|
57
|
+
// records exist in prod and must keep passing through untouched.
|
|
58
|
+
const original = 'Docs: a value may end with </consequences>\n<parameter name="symptom">like so.';
|
|
59
|
+
const { args, salvaged, chained } = resolveMangledArgs({ rationale: original }, FIELDS);
|
|
60
|
+
assert.equal(args.rationale, original);
|
|
61
|
+
assert.equal(args.symptom, undefined);
|
|
62
|
+
assert.deepEqual(salvaged, []);
|
|
63
|
+
assert.deepEqual(chained, []);
|
|
64
|
+
});
|
|
65
|
+
test('does NOT act on an unknown target field', () => {
|
|
66
|
+
const original = 'Text.</consequences>\n<parameter name="notARealField">value';
|
|
67
|
+
const { args, salvaged, chained } = resolveMangledArgs({ consequences: original }, FIELDS);
|
|
68
|
+
assert.equal(args.consequences, original);
|
|
69
|
+
assert.deepEqual(salvaged, []);
|
|
70
|
+
assert.deepEqual(chained, []);
|
|
71
|
+
});
|
|
72
|
+
test('never overwrites a target the caller actually supplied', () => {
|
|
73
|
+
const original = 'Text.</consequences>\n<parameter name="symptom">absorbed symptom';
|
|
74
|
+
const { args, salvaged } = resolveMangledArgs({ consequences: original, symptom: 'genuine symptom' }, FIELDS);
|
|
75
|
+
assert.equal(args.symptom, 'genuine symptom');
|
|
76
|
+
assert.equal(args.consequences, original);
|
|
77
|
+
assert.deepEqual(salvaged, []);
|
|
78
|
+
});
|
|
79
|
+
test('leaves clean args untouched and reports nothing', () => {
|
|
80
|
+
const input = { summary: 'A summary', alternatives: ['x'], relatedFiles: ['a.ts'] };
|
|
81
|
+
const { args, salvaged, chained } = resolveMangledArgs(input, FIELDS);
|
|
82
|
+
assert.deepEqual(args, input);
|
|
83
|
+
assert.deepEqual(salvaged, []);
|
|
84
|
+
assert.deepEqual(chained, []);
|
|
85
|
+
});
|
|
86
|
+
test('does not mutate the caller-supplied args object', () => {
|
|
87
|
+
const input = {
|
|
88
|
+
consequences: 'Text.</consequences>\n<parameter name="symptom">S.',
|
|
89
|
+
};
|
|
90
|
+
resolveMangledArgs(input, FIELDS);
|
|
91
|
+
assert.equal(input.consequences, 'Text.</consequences>\n<parameter name="symptom">S.');
|
|
92
|
+
});
|
|
93
|
+
test('keeps the raw text when an absorbed structured value is not valid JSON', () => {
|
|
94
|
+
const { args } = resolveMangledArgs({ consequences: 'Text.</consequences>\n<parameter name="alternatives">[not, valid, json' }, FIELDS);
|
|
95
|
+
assert.equal(args.alternatives, '[not, valid, json');
|
|
96
|
+
});
|
|
97
|
+
test('ignores non-string fields', () => {
|
|
98
|
+
const { args, salvaged } = resolveMangledArgs({ relatedFiles: ['a.ts', 'b.ts'], summary: 'clean' }, FIELDS);
|
|
99
|
+
assert.deepEqual(args.relatedFiles, ['a.ts', 'b.ts']);
|
|
100
|
+
assert.deepEqual(salvaged, []);
|
|
101
|
+
});
|
|
102
|
+
test('the chained refusal names the host and the first absorbed field', () => {
|
|
103
|
+
const message = describeChainedArgs('record_decision', [
|
|
104
|
+
{ field: 'rationale', absorbed: 'supersedes' },
|
|
105
|
+
]);
|
|
106
|
+
assert.match(message, /record_decision/);
|
|
107
|
+
assert.match(message, /"rationale" absorbed "supersedes"/);
|
|
108
|
+
assert.match(message, /nothing was recorded/);
|
|
109
|
+
});
|
|
110
|
+
//# sourceMappingURL=_mangled-args.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_mangled-args.test.js","sourceRoot":"","sources":["../../src/tools/_mangled-args.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,E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C,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EACpD,MAAM,CACP,CAAA;IAED,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IACrD,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AAChC,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,iEAAiE,EAAE,GAAG,EAAE;IAC3E,MAAM,OAAO,GAAG,mBAAmB,CAAC,iBAAiB,EAAE;QACrD,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE;KAC/C,CAAC,CAAA;IAEF,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAA;IACxC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,mCAAmC,CAAC,CAAA;IAC1D,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAA;AAC/C,CAAC,CAAC,CAAA"}
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { IntentRef } from '../types/refs.js';
|
|
2
3
|
export declare const activateIntentSchema: 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
4
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
18
5
|
repoPath: z.ZodString;
|
|
19
6
|
intentId: z.ZodString;
|
|
@@ -21,22 +8,10 @@ export declare const activateIntentSchema: z.ZodObject<{
|
|
|
21
8
|
repoPath: string;
|
|
22
9
|
intentId: string;
|
|
23
10
|
repoOrigin?: string | undefined;
|
|
24
|
-
forkAuthor?: {
|
|
25
|
-
platform: "github" | "gitlab";
|
|
26
|
-
user: string;
|
|
27
|
-
forkOrigin: string;
|
|
28
|
-
} | undefined;
|
|
29
|
-
workspaceId?: string | undefined;
|
|
30
11
|
}, {
|
|
31
12
|
repoPath: string;
|
|
32
13
|
intentId: string;
|
|
33
14
|
repoOrigin?: string | undefined;
|
|
34
|
-
forkAuthor?: {
|
|
35
|
-
platform: "github" | "gitlab";
|
|
36
|
-
user: string;
|
|
37
|
-
forkOrigin: string;
|
|
38
|
-
} | undefined;
|
|
39
|
-
workspaceId?: string | undefined;
|
|
40
15
|
}>;
|
|
41
16
|
export type ActivateIntentInput = z.infer<typeof activateIntentSchema>;
|
|
42
17
|
export interface ActivateIntentResponse {
|
|
@@ -44,6 +19,13 @@ export interface ActivateIntentResponse {
|
|
|
44
19
|
intentId: string;
|
|
45
20
|
action?: 'activated' | 'already_active';
|
|
46
21
|
previousActiveId?: string;
|
|
22
|
+
/** The now-current intent, named. Absent when Kawa Code could not resolve it. */
|
|
23
|
+
activeIntent?: IntentRef;
|
|
24
|
+
/** The intent this replaced, named. Absent when there was none, or it did not resolve. */
|
|
25
|
+
previousActive?: IntentRef;
|
|
26
|
+
/** True when activation was refused because the intent is frozen (stale beyond the freeze window). */
|
|
27
|
+
frozen?: boolean;
|
|
28
|
+
error?: string;
|
|
47
29
|
message: string;
|
|
48
30
|
}
|
|
49
31
|
export declare function activateIntent(input: ActivateIntentInput): Promise<ActivateIntentResponse>;
|
|
@@ -51,20 +33,6 @@ export declare const activateIntentTool: {
|
|
|
51
33
|
name: string;
|
|
52
34
|
description: string;
|
|
53
35
|
inputSchema: z.ZodObject<{
|
|
54
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
55
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
56
|
-
user: z.ZodString;
|
|
57
|
-
forkOrigin: z.ZodString;
|
|
58
|
-
}, "strip", z.ZodTypeAny, {
|
|
59
|
-
platform: "github" | "gitlab";
|
|
60
|
-
user: string;
|
|
61
|
-
forkOrigin: string;
|
|
62
|
-
}, {
|
|
63
|
-
platform: "github" | "gitlab";
|
|
64
|
-
user: string;
|
|
65
|
-
forkOrigin: string;
|
|
66
|
-
}>>;
|
|
67
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
68
36
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
69
37
|
repoPath: z.ZodString;
|
|
70
38
|
intentId: z.ZodString;
|
|
@@ -72,22 +40,10 @@ export declare const activateIntentTool: {
|
|
|
72
40
|
repoPath: string;
|
|
73
41
|
intentId: string;
|
|
74
42
|
repoOrigin?: string | undefined;
|
|
75
|
-
forkAuthor?: {
|
|
76
|
-
platform: "github" | "gitlab";
|
|
77
|
-
user: string;
|
|
78
|
-
forkOrigin: string;
|
|
79
|
-
} | undefined;
|
|
80
|
-
workspaceId?: string | undefined;
|
|
81
43
|
}, {
|
|
82
44
|
repoPath: string;
|
|
83
45
|
intentId: string;
|
|
84
46
|
repoOrigin?: string | undefined;
|
|
85
|
-
forkAuthor?: {
|
|
86
|
-
platform: "github" | "gitlab";
|
|
87
|
-
user: string;
|
|
88
|
-
forkOrigin: string;
|
|
89
|
-
} | undefined;
|
|
90
|
-
workspaceId?: string | undefined;
|
|
91
47
|
}>;
|
|
92
48
|
handler: typeof activateIntent;
|
|
93
49
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
-
import {
|
|
4
|
+
import { nameIntent, toIntentRef } from '../types/refs.js';
|
|
5
5
|
export const activateIntentSchema = z.object({
|
|
6
6
|
repoOrigin: z.string().optional().describe('Git remote origin URL. Auto-detected from repoPath via git if not provided.'),
|
|
7
7
|
repoPath: z.string().describe('Local path to the repository root'),
|
|
8
8
|
intentId: z.string().describe('The cloud ID (preferred) or local UUID of the existing intent to activate.'),
|
|
9
|
-
...forkFieldsExtensions,
|
|
10
9
|
});
|
|
11
10
|
export async function activateIntent(input) {
|
|
12
11
|
const actualOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -19,25 +18,45 @@ export async function activateIntent(input) {
|
|
|
19
18
|
intentId: input.intentId,
|
|
20
19
|
action: 'already_active',
|
|
21
20
|
previousActiveId,
|
|
22
|
-
|
|
21
|
+
// Intent ids are NEVER truncated: they are Mongo ObjectIds whose leading
|
|
22
|
+
// bytes are a timestamp, so a prefix does not identify a single intent.
|
|
23
|
+
// Here there is no title to lead with, so the full id is the answer.
|
|
24
|
+
message: `Intent ${input.intentId} is already your current intent`,
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
// Move THIS session's `current` pointer to the target intent. Under the
|
|
26
28
|
// multi-active model (no lock) this never conflicts — other sessions keep
|
|
27
29
|
// their own current pointers, and the API holds the full active set.
|
|
28
|
-
await request('intent', 'set-active', {
|
|
30
|
+
const res = await request('intent', 'set-active', {
|
|
29
31
|
repoOrigin: actualOrigin,
|
|
30
32
|
intentId: input.intentId,
|
|
31
|
-
...extractForkFields(input),
|
|
32
33
|
});
|
|
34
|
+
// A failed set-active must not be reported as an activation. The main case is
|
|
35
|
+
// the freeze gate: reactivating an intent stale beyond the freeze window is
|
|
36
|
+
// refused (`frozen: true`), so surface that instead of a false success.
|
|
37
|
+
if (res?.success === false) {
|
|
38
|
+
return {
|
|
39
|
+
success: false,
|
|
40
|
+
intentId: input.intentId,
|
|
41
|
+
frozen: res.frozen === true,
|
|
42
|
+
error: res.error || 'Could not activate this intent.',
|
|
43
|
+
message: res.error || `Could not activate intent ${input.intentId}.`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// Kawa Code resolves both ends of the switch, so the message can name them.
|
|
47
|
+
const activeIntent = toIntentRef(res?.activeIntent);
|
|
48
|
+
const previousActive = toIntentRef(res?.previousActive);
|
|
49
|
+
const activeName = nameIntent(activeIntent, input.intentId);
|
|
33
50
|
return {
|
|
34
51
|
success: true,
|
|
35
52
|
intentId: input.intentId,
|
|
36
53
|
action: 'activated',
|
|
37
54
|
previousActiveId: previousActiveId || undefined,
|
|
55
|
+
activeIntent: activeIntent ?? undefined,
|
|
56
|
+
previousActive: previousActive ?? undefined,
|
|
38
57
|
message: previousActiveId
|
|
39
|
-
? `Switched current intent to ${
|
|
40
|
-
: `Activated intent ${
|
|
58
|
+
? `Switched current intent to ${activeName} (was: ${nameIntent(previousActive, previousActiveId)})`
|
|
59
|
+
: `Activated intent ${activeName}`,
|
|
41
60
|
};
|
|
42
61
|
}
|
|
43
62
|
export const activateIntentTool = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activate-intent.js","sourceRoot":"","sources":["../../src/tools/activate-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"activate-intent.js","sourceRoot":"","sources":["../../src/tools/activate-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAa,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAErE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,UAAU,EAAE,CAAC,CAAC,MAAM,E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E,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,IAAI;YAC3B,KAAK,EAAE,GAAG,CAAC,KAAK,IAAI,iCAAiC;YACrD,OAAO,EAAE,GAAG,CAAC,KAAK,IAAI,6BAA6B,KAAK,CAAC,QAAQ,GAAG;SACrE,CAAA;IACH,CAAC;IAED,4EAA4E;IAC5E,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,YAAY,CAAC,CAAA;IACnD,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE,cAAc,CAAC,CAAA;IACvD,MAAM,UAAU,GAAG,UAAU,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IAE3D,OAAO;QACL,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM,EAAE,WAAW;QACnB,gBAAgB,EAAE,gBAAgB,IAAI,SAAS;QAC/C,YAAY,EAAE,YAAY,IAAI,SAAS;QACvC,cAAc,EAAE,cAAc,IAAI,SAAS;QAC3C,OAAO,EAAE,gBAAgB;YACvB,CAAC,CAAC,8BAA8B,UAAU,UAAU,UAAU,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAAG;YACnG,CAAC,CAAC,oBAAoB,UAAU,EAAE;KACrC,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;uBAoBQ;IACrB,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,cAAc;CACxB,CAAA"}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const arbiterApplySchema: 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
3
|
repoPath: z.ZodString;
|
|
18
4
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
19
5
|
intentId: z.ZodOptional<z.ZodString>;
|
|
@@ -38,12 +24,6 @@ export declare const arbiterApplySchema: z.ZodObject<{
|
|
|
38
24
|
ranges: number[][];
|
|
39
25
|
}[];
|
|
40
26
|
repoOrigin?: string | undefined;
|
|
41
|
-
forkAuthor?: {
|
|
42
|
-
platform: "github" | "gitlab";
|
|
43
|
-
user: string;
|
|
44
|
-
forkOrigin: string;
|
|
45
|
-
} | undefined;
|
|
46
|
-
workspaceId?: string | undefined;
|
|
47
27
|
intentId?: string | undefined;
|
|
48
28
|
}, {
|
|
49
29
|
repoPath: string;
|
|
@@ -53,12 +33,6 @@ export declare const arbiterApplySchema: z.ZodObject<{
|
|
|
53
33
|
ranges: number[][];
|
|
54
34
|
}[];
|
|
55
35
|
repoOrigin?: string | undefined;
|
|
56
|
-
forkAuthor?: {
|
|
57
|
-
platform: "github" | "gitlab";
|
|
58
|
-
user: string;
|
|
59
|
-
forkOrigin: string;
|
|
60
|
-
} | undefined;
|
|
61
|
-
workspaceId?: string | undefined;
|
|
62
36
|
intentId?: string | undefined;
|
|
63
37
|
}>;
|
|
64
38
|
export type ArbiterApplyInput = z.infer<typeof arbiterApplySchema>;
|
|
@@ -67,20 +41,6 @@ export declare const arbiterApplyTool: {
|
|
|
67
41
|
name: string;
|
|
68
42
|
description: string;
|
|
69
43
|
inputSchema: z.ZodObject<{
|
|
70
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
71
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
72
|
-
user: z.ZodString;
|
|
73
|
-
forkOrigin: z.ZodString;
|
|
74
|
-
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
platform: "github" | "gitlab";
|
|
76
|
-
user: string;
|
|
77
|
-
forkOrigin: string;
|
|
78
|
-
}, {
|
|
79
|
-
platform: "github" | "gitlab";
|
|
80
|
-
user: string;
|
|
81
|
-
forkOrigin: string;
|
|
82
|
-
}>>;
|
|
83
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
84
44
|
repoPath: z.ZodString;
|
|
85
45
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
86
46
|
intentId: z.ZodOptional<z.ZodString>;
|
|
@@ -105,12 +65,6 @@ export declare const arbiterApplyTool: {
|
|
|
105
65
|
ranges: number[][];
|
|
106
66
|
}[];
|
|
107
67
|
repoOrigin?: string | undefined;
|
|
108
|
-
forkAuthor?: {
|
|
109
|
-
platform: "github" | "gitlab";
|
|
110
|
-
user: string;
|
|
111
|
-
forkOrigin: string;
|
|
112
|
-
} | undefined;
|
|
113
|
-
workspaceId?: string | undefined;
|
|
114
68
|
intentId?: string | undefined;
|
|
115
69
|
}, {
|
|
116
70
|
repoPath: string;
|
|
@@ -120,12 +74,6 @@ export declare const arbiterApplyTool: {
|
|
|
120
74
|
ranges: number[][];
|
|
121
75
|
}[];
|
|
122
76
|
repoOrigin?: string | undefined;
|
|
123
|
-
forkAuthor?: {
|
|
124
|
-
platform: "github" | "gitlab";
|
|
125
|
-
user: string;
|
|
126
|
-
forkOrigin: string;
|
|
127
|
-
} | undefined;
|
|
128
|
-
workspaceId?: string | undefined;
|
|
129
77
|
intentId?: string | undefined;
|
|
130
78
|
}>;
|
|
131
79
|
handler: typeof arbiterApply;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
-
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
5
4
|
/**
|
|
6
5
|
* arbiter_apply — thin forwarder to Muninn `arbiter:apply` (Arbiter v2).
|
|
7
6
|
* Judges → adversarially verifies → auto-applies only the trivial tier, and ONLY
|
|
@@ -30,7 +29,6 @@ export const arbiterApplySchema = z.object({
|
|
|
30
29
|
overlaps: z
|
|
31
30
|
.array(overlapSchema)
|
|
32
31
|
.describe('The overlaps to resolve — each { peerUid, filePath, ranges } from the Stop collision report.'),
|
|
33
|
-
...forkFieldsExtensions,
|
|
34
32
|
});
|
|
35
33
|
export async function arbiterApply(input) {
|
|
36
34
|
const repoOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -39,7 +37,6 @@ export async function arbiterApply(input) {
|
|
|
39
37
|
repoPath: input.repoPath,
|
|
40
38
|
intentId: input.intentId,
|
|
41
39
|
overlaps: input.overlaps,
|
|
42
|
-
...extractForkFields(input),
|
|
43
40
|
});
|
|
44
41
|
return res;
|
|
45
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arbiter-apply.js","sourceRoot":"","sources":["../../src/tools/arbiter-apply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"arbiter-apply.js","sourceRoot":"","sources":["../../src/tools/arbiter-apply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE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G,uGAAuG;QACvG,yGAAyG;QACzG,0GAA0G;QAC1G,0GAA0G;QAC1G,qCAAqC;IACvC,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,YAAY;CACtB,CAAA"}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const arbiterResolveSchema: 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
3
|
repoPath: z.ZodString;
|
|
18
4
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
19
5
|
intentId: z.ZodOptional<z.ZodString>;
|
|
@@ -38,12 +24,6 @@ export declare const arbiterResolveSchema: z.ZodObject<{
|
|
|
38
24
|
ranges: number[][];
|
|
39
25
|
}[];
|
|
40
26
|
repoOrigin?: string | undefined;
|
|
41
|
-
forkAuthor?: {
|
|
42
|
-
platform: "github" | "gitlab";
|
|
43
|
-
user: string;
|
|
44
|
-
forkOrigin: string;
|
|
45
|
-
} | undefined;
|
|
46
|
-
workspaceId?: string | undefined;
|
|
47
27
|
intentId?: string | undefined;
|
|
48
28
|
}, {
|
|
49
29
|
repoPath: string;
|
|
@@ -53,12 +33,6 @@ export declare const arbiterResolveSchema: z.ZodObject<{
|
|
|
53
33
|
ranges: number[][];
|
|
54
34
|
}[];
|
|
55
35
|
repoOrigin?: string | undefined;
|
|
56
|
-
forkAuthor?: {
|
|
57
|
-
platform: "github" | "gitlab";
|
|
58
|
-
user: string;
|
|
59
|
-
forkOrigin: string;
|
|
60
|
-
} | undefined;
|
|
61
|
-
workspaceId?: string | undefined;
|
|
62
36
|
intentId?: string | undefined;
|
|
63
37
|
}>;
|
|
64
38
|
export type ArbiterResolveInput = z.infer<typeof arbiterResolveSchema>;
|
|
@@ -67,20 +41,6 @@ export declare const arbiterResolveTool: {
|
|
|
67
41
|
name: string;
|
|
68
42
|
description: string;
|
|
69
43
|
inputSchema: z.ZodObject<{
|
|
70
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
71
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
72
|
-
user: z.ZodString;
|
|
73
|
-
forkOrigin: z.ZodString;
|
|
74
|
-
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
platform: "github" | "gitlab";
|
|
76
|
-
user: string;
|
|
77
|
-
forkOrigin: string;
|
|
78
|
-
}, {
|
|
79
|
-
platform: "github" | "gitlab";
|
|
80
|
-
user: string;
|
|
81
|
-
forkOrigin: string;
|
|
82
|
-
}>>;
|
|
83
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
84
44
|
repoPath: z.ZodString;
|
|
85
45
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
86
46
|
intentId: z.ZodOptional<z.ZodString>;
|
|
@@ -105,12 +65,6 @@ export declare const arbiterResolveTool: {
|
|
|
105
65
|
ranges: number[][];
|
|
106
66
|
}[];
|
|
107
67
|
repoOrigin?: string | undefined;
|
|
108
|
-
forkAuthor?: {
|
|
109
|
-
platform: "github" | "gitlab";
|
|
110
|
-
user: string;
|
|
111
|
-
forkOrigin: string;
|
|
112
|
-
} | undefined;
|
|
113
|
-
workspaceId?: string | undefined;
|
|
114
68
|
intentId?: string | undefined;
|
|
115
69
|
}, {
|
|
116
70
|
repoPath: string;
|
|
@@ -120,12 +74,6 @@ export declare const arbiterResolveTool: {
|
|
|
120
74
|
ranges: number[][];
|
|
121
75
|
}[];
|
|
122
76
|
repoOrigin?: string | undefined;
|
|
123
|
-
forkAuthor?: {
|
|
124
|
-
platform: "github" | "gitlab";
|
|
125
|
-
user: string;
|
|
126
|
-
forkOrigin: string;
|
|
127
|
-
} | undefined;
|
|
128
|
-
workspaceId?: string | undefined;
|
|
129
77
|
intentId?: string | undefined;
|
|
130
78
|
}>;
|
|
131
79
|
handler: typeof arbiterResolve;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { request } from '../services/muninn-ipc.js';
|
|
3
3
|
import { resolveOrigin } from './resolve-origin.js';
|
|
4
|
-
import { forkFieldsExtensions, extractForkFields } from './_fork-fields.js';
|
|
5
4
|
/**
|
|
6
5
|
* arbiter_resolve — thin forwarder to Muninn `arbiter:resolve` (Arbiter v2).
|
|
7
6
|
* Suggest-only: judges live code overlaps with peers and returns verdicts; never
|
|
@@ -30,7 +29,6 @@ export const arbiterResolveSchema = z.object({
|
|
|
30
29
|
overlaps: z
|
|
31
30
|
.array(overlapSchema)
|
|
32
31
|
.describe('The overlaps to judge — each { peerUid, filePath, ranges } from the Stop collision report.'),
|
|
33
|
-
...forkFieldsExtensions,
|
|
34
32
|
});
|
|
35
33
|
export async function arbiterResolve(input) {
|
|
36
34
|
const repoOrigin = resolveOrigin(input.repoOrigin, input.repoPath);
|
|
@@ -39,7 +37,6 @@ export async function arbiterResolve(input) {
|
|
|
39
37
|
repoPath: input.repoPath,
|
|
40
38
|
intentId: input.intentId,
|
|
41
39
|
overlaps: input.overlaps,
|
|
42
|
-
...extractForkFields(input),
|
|
43
40
|
});
|
|
44
41
|
return res;
|
|
45
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arbiter-resolve.js","sourceRoot":"","sources":["../../src/tools/arbiter-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACn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CAAA;IAClE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE;QAC9C,UAAU;QACV,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,8FAA8F;QAC9F,mGAAmG;QACnG,sGAAsG;QACtG,8FAA8F;QAC9F,gGAAgG;QAChG,sGAAsG;QACtG,yCAAyC;IAC3C,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,cAAc;CACxB,CAAA"}
|
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const checkActiveIntentSchema: 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
3
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
18
4
|
repoPath: z.ZodString;
|
|
19
5
|
}, "strip", z.ZodTypeAny, {
|
|
20
6
|
repoPath: string;
|
|
21
7
|
repoOrigin?: string | undefined;
|
|
22
|
-
forkAuthor?: {
|
|
23
|
-
platform: "github" | "gitlab";
|
|
24
|
-
user: string;
|
|
25
|
-
forkOrigin: string;
|
|
26
|
-
} | undefined;
|
|
27
|
-
workspaceId?: string | undefined;
|
|
28
8
|
}, {
|
|
29
9
|
repoPath: string;
|
|
30
10
|
repoOrigin?: string | undefined;
|
|
31
|
-
forkAuthor?: {
|
|
32
|
-
platform: "github" | "gitlab";
|
|
33
|
-
user: string;
|
|
34
|
-
forkOrigin: string;
|
|
35
|
-
} | undefined;
|
|
36
|
-
workspaceId?: string | undefined;
|
|
37
11
|
}>;
|
|
38
12
|
export type CheckActiveIntentInput = z.infer<typeof checkActiveIntentSchema>;
|
|
39
13
|
export interface IntentBlock {
|
|
@@ -83,40 +57,14 @@ export declare const checkActiveIntentTool: {
|
|
|
83
57
|
name: string;
|
|
84
58
|
description: string;
|
|
85
59
|
inputSchema: z.ZodObject<{
|
|
86
|
-
forkAuthor: z.ZodOptional<z.ZodObject<{
|
|
87
|
-
platform: z.ZodEnum<["github", "gitlab"]>;
|
|
88
|
-
user: z.ZodString;
|
|
89
|
-
forkOrigin: z.ZodString;
|
|
90
|
-
}, "strip", z.ZodTypeAny, {
|
|
91
|
-
platform: "github" | "gitlab";
|
|
92
|
-
user: string;
|
|
93
|
-
forkOrigin: string;
|
|
94
|
-
}, {
|
|
95
|
-
platform: "github" | "gitlab";
|
|
96
|
-
user: string;
|
|
97
|
-
forkOrigin: string;
|
|
98
|
-
}>>;
|
|
99
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
100
60
|
repoOrigin: z.ZodOptional<z.ZodString>;
|
|
101
61
|
repoPath: z.ZodString;
|
|
102
62
|
}, "strip", z.ZodTypeAny, {
|
|
103
63
|
repoPath: string;
|
|
104
64
|
repoOrigin?: string | undefined;
|
|
105
|
-
forkAuthor?: {
|
|
106
|
-
platform: "github" | "gitlab";
|
|
107
|
-
user: string;
|
|
108
|
-
forkOrigin: string;
|
|
109
|
-
} | undefined;
|
|
110
|
-
workspaceId?: string | undefined;
|
|
111
65
|
}, {
|
|
112
66
|
repoPath: string;
|
|
113
67
|
repoOrigin?: string | undefined;
|
|
114
|
-
forkAuthor?: {
|
|
115
|
-
platform: "github" | "gitlab";
|
|
116
|
-
user: string;
|
|
117
|
-
forkOrigin: string;
|
|
118
|
-
} | undefined;
|
|
119
|
-
workspaceId?: string | undefined;
|
|
120
68
|
}>;
|
|
121
69
|
handler: typeof checkActiveIntent;
|
|
122
70
|
};
|