@namzu/sdk 52.1.0 → 52.2.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/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/connector/tools/adapter.d.ts +2 -2
- package/dist/contracts/a2a.d.ts +92 -92
- package/dist/manager/resident/learning.d.ts +6 -6
- package/dist/manager/resident/store.d.ts +4 -4
- package/dist/pals/activity/subscription-schema.d.ts +48 -48
- package/dist/pals/communication/ingress-schema.d.ts +192 -192
- package/dist/pals/communication/schema.d.ts +18 -18
- package/dist/peers/protocol.d.ts +36 -36
- package/dist/public-runtime.d.ts +1 -0
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +1 -0
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +1 -0
- package/dist/public-tools.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +1 -0
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +1 -0
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts +2 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +1 -0
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +1 -0
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +1 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/tools/builtins/browser.d.ts +4 -4
- package/dist/tools/builtins/code-analysis.d.ts +49 -0
- package/dist/tools/builtins/code-analysis.d.ts.map +1 -0
- package/dist/tools/builtins/code-analysis.js +409 -0
- package/dist/tools/builtins/code-analysis.js.map +1 -0
- package/dist/tools/builtins/computer-use.d.ts +24 -24
- package/dist/tools/builtins/index.d.ts +1 -0
- package/dist/tools/builtins/index.d.ts.map +1 -1
- package/dist/tools/builtins/index.js +1 -0
- package/dist/tools/builtins/index.js.map +1 -1
- package/dist/tools/builtins/lsp.d.ts +1 -1
- package/dist/tools/builtins/skill.d.ts +2 -2
- package/dist/types/code-analysis/index.d.ts +299 -0
- package/dist/types/code-analysis/index.d.ts.map +1 -0
- package/dist/types/code-analysis/index.js +30 -0
- package/dist/types/code-analysis/index.js.map +1 -0
- package/dist/types/plugin/index.d.ts +6 -6
- package/dist/types/session/records.d.ts +127 -127
- package/dist/types/tool/index.d.ts +9 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/package.json +2 -2
- package/src/public-runtime.ts +25 -0
- package/src/public-tools.ts +5 -0
- package/src/runtime/query/executor.ts +2 -0
- package/src/runtime/query/index.ts +3 -0
- package/src/runtime/query/tooling.ts +2 -0
- package/src/tools/builtins/code-analysis.ts +486 -0
- package/src/tools/builtins/index.ts +5 -0
- package/src/types/code-analysis/index.ts +325 -0
- package/src/types/tool/index.ts +9 -0
|
@@ -155,20 +155,20 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
155
155
|
} & {
|
|
156
156
|
screenshot_id: z.ZodOptional<z.ZodString>;
|
|
157
157
|
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
type: "mouse_click";
|
|
158
159
|
at: {
|
|
159
160
|
x: number;
|
|
160
161
|
y: number;
|
|
161
162
|
};
|
|
162
|
-
type: "mouse_click";
|
|
163
163
|
button: "left" | "right" | "middle";
|
|
164
164
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
165
165
|
screenshot_id?: string | undefined;
|
|
166
166
|
}, {
|
|
167
|
+
type: "mouse_click";
|
|
167
168
|
at: {
|
|
168
169
|
x: number;
|
|
169
170
|
y: number;
|
|
170
171
|
};
|
|
171
|
-
type: "mouse_click";
|
|
172
172
|
button?: "left" | "right" | "middle" | undefined;
|
|
173
173
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
174
174
|
screenshot_id?: string | undefined;
|
|
@@ -242,21 +242,21 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
242
242
|
} & {
|
|
243
243
|
screenshot_id: z.ZodOptional<z.ZodString>;
|
|
244
244
|
}, "strip", z.ZodTypeAny, {
|
|
245
|
+
type: "scroll";
|
|
245
246
|
at: {
|
|
246
247
|
x: number;
|
|
247
248
|
y: number;
|
|
248
249
|
};
|
|
249
|
-
type: "scroll";
|
|
250
250
|
amount: number;
|
|
251
251
|
direction: "up" | "down" | "left" | "right";
|
|
252
252
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
253
253
|
screenshot_id?: string | undefined;
|
|
254
254
|
}, {
|
|
255
|
+
type: "scroll";
|
|
255
256
|
at: {
|
|
256
257
|
x: number;
|
|
257
258
|
y: number;
|
|
258
259
|
};
|
|
259
|
-
type: "scroll";
|
|
260
260
|
amount: number;
|
|
261
261
|
direction: "up" | "down" | "left" | "right";
|
|
262
262
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
@@ -279,8 +279,8 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
279
279
|
} & {
|
|
280
280
|
screenshot_id: z.ZodOptional<z.ZodString>;
|
|
281
281
|
}, "strip", z.ZodTypeAny, {
|
|
282
|
-
type: "type_text";
|
|
283
282
|
text: string;
|
|
283
|
+
type: "type_text";
|
|
284
284
|
at?: {
|
|
285
285
|
x: number;
|
|
286
286
|
y: number;
|
|
@@ -288,8 +288,8 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
288
288
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
289
289
|
screenshot_id?: string | undefined;
|
|
290
290
|
}, {
|
|
291
|
-
type: "type_text";
|
|
292
291
|
text: string;
|
|
292
|
+
type: "type_text";
|
|
293
293
|
at?: {
|
|
294
294
|
x: number;
|
|
295
295
|
y: number;
|
|
@@ -313,8 +313,8 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
313
313
|
} & {
|
|
314
314
|
screenshot_id: z.ZodOptional<z.ZodString>;
|
|
315
315
|
}, "strip", z.ZodTypeAny, {
|
|
316
|
-
keys: string;
|
|
317
316
|
type: "key";
|
|
317
|
+
keys: string;
|
|
318
318
|
at?: {
|
|
319
319
|
x: number;
|
|
320
320
|
y: number;
|
|
@@ -322,8 +322,8 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
322
322
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
323
323
|
screenshot_id?: string | undefined;
|
|
324
324
|
}, {
|
|
325
|
-
keys: string;
|
|
326
325
|
type: "key";
|
|
326
|
+
keys: string;
|
|
327
327
|
at?: {
|
|
328
328
|
x: number;
|
|
329
329
|
y: number;
|
|
@@ -443,19 +443,19 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
443
443
|
/** Accepted only to return an explicit refusal; pointer foreground is unsafe. */
|
|
444
444
|
delivery_mode: z.ZodOptional<z.ZodEnum<["background", "foreground"]>>;
|
|
445
445
|
}, "strip", z.ZodTypeAny, {
|
|
446
|
+
type: "mouse_click";
|
|
446
447
|
at: {
|
|
447
448
|
x: number;
|
|
448
449
|
y: number;
|
|
449
450
|
};
|
|
450
|
-
type: "mouse_click";
|
|
451
451
|
button: "left" | "right" | "middle";
|
|
452
452
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
453
453
|
}, {
|
|
454
|
+
type: "mouse_click";
|
|
454
455
|
at: {
|
|
455
456
|
x: number;
|
|
456
457
|
y: number;
|
|
457
458
|
};
|
|
458
|
-
type: "mouse_click";
|
|
459
459
|
button?: "left" | "right" | "middle" | undefined;
|
|
460
460
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
461
461
|
}>, z.ZodObject<{
|
|
@@ -522,20 +522,20 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
522
522
|
amount: z.ZodNumber;
|
|
523
523
|
delivery_mode: z.ZodOptional<z.ZodEnum<["background", "foreground"]>>;
|
|
524
524
|
}, "strip", z.ZodTypeAny, {
|
|
525
|
+
type: "scroll";
|
|
525
526
|
at: {
|
|
526
527
|
x: number;
|
|
527
528
|
y: number;
|
|
528
529
|
};
|
|
529
|
-
type: "scroll";
|
|
530
530
|
amount: number;
|
|
531
531
|
direction: "up" | "down" | "left" | "right";
|
|
532
532
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
533
533
|
}, {
|
|
534
|
+
type: "scroll";
|
|
534
535
|
at: {
|
|
535
536
|
x: number;
|
|
536
537
|
y: number;
|
|
537
538
|
};
|
|
538
|
-
type: "scroll";
|
|
539
539
|
amount: number;
|
|
540
540
|
direction: "up" | "down" | "left" | "right";
|
|
541
541
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
@@ -555,16 +555,16 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
555
555
|
}>>;
|
|
556
556
|
delivery_mode: z.ZodOptional<z.ZodEnum<["background", "foreground"]>>;
|
|
557
557
|
}, "strip", z.ZodTypeAny, {
|
|
558
|
-
type: "type_text";
|
|
559
558
|
text: string;
|
|
559
|
+
type: "type_text";
|
|
560
560
|
at?: {
|
|
561
561
|
x: number;
|
|
562
562
|
y: number;
|
|
563
563
|
} | undefined;
|
|
564
564
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
565
565
|
}, {
|
|
566
|
-
type: "type_text";
|
|
567
566
|
text: string;
|
|
567
|
+
type: "type_text";
|
|
568
568
|
at?: {
|
|
569
569
|
x: number;
|
|
570
570
|
y: number;
|
|
@@ -585,16 +585,16 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
585
585
|
}>>;
|
|
586
586
|
delivery_mode: z.ZodOptional<z.ZodEnum<["background", "foreground"]>>;
|
|
587
587
|
}, "strip", z.ZodTypeAny, {
|
|
588
|
-
keys: string;
|
|
589
588
|
type: "key";
|
|
589
|
+
keys: string;
|
|
590
590
|
at?: {
|
|
591
591
|
x: number;
|
|
592
592
|
y: number;
|
|
593
593
|
} | undefined;
|
|
594
594
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
595
595
|
}, {
|
|
596
|
-
keys: string;
|
|
597
596
|
type: "key";
|
|
597
|
+
keys: string;
|
|
598
598
|
at?: {
|
|
599
599
|
x: number;
|
|
600
600
|
y: number;
|
|
@@ -651,11 +651,11 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
651
651
|
y: number;
|
|
652
652
|
};
|
|
653
653
|
} | {
|
|
654
|
+
type: "mouse_click";
|
|
654
655
|
at: {
|
|
655
656
|
x: number;
|
|
656
657
|
y: number;
|
|
657
658
|
};
|
|
658
|
-
type: "mouse_click";
|
|
659
659
|
button: "left" | "right" | "middle";
|
|
660
660
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
661
661
|
} | {
|
|
@@ -671,25 +671,25 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
671
671
|
button: "left" | "right" | "middle";
|
|
672
672
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
673
673
|
} | {
|
|
674
|
+
type: "scroll";
|
|
674
675
|
at: {
|
|
675
676
|
x: number;
|
|
676
677
|
y: number;
|
|
677
678
|
};
|
|
678
|
-
type: "scroll";
|
|
679
679
|
amount: number;
|
|
680
680
|
direction: "up" | "down" | "left" | "right";
|
|
681
681
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
682
682
|
} | {
|
|
683
|
-
type: "type_text";
|
|
684
683
|
text: string;
|
|
684
|
+
type: "type_text";
|
|
685
685
|
at?: {
|
|
686
686
|
x: number;
|
|
687
687
|
y: number;
|
|
688
688
|
} | undefined;
|
|
689
689
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
690
690
|
} | {
|
|
691
|
-
keys: string;
|
|
692
691
|
type: "key";
|
|
692
|
+
keys: string;
|
|
693
693
|
at?: {
|
|
694
694
|
x: number;
|
|
695
695
|
y: number;
|
|
@@ -721,11 +721,11 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
721
721
|
y: number;
|
|
722
722
|
};
|
|
723
723
|
} | {
|
|
724
|
+
type: "mouse_click";
|
|
724
725
|
at: {
|
|
725
726
|
x: number;
|
|
726
727
|
y: number;
|
|
727
728
|
};
|
|
728
|
-
type: "mouse_click";
|
|
729
729
|
button?: "left" | "right" | "middle" | undefined;
|
|
730
730
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
731
731
|
} | {
|
|
@@ -741,25 +741,25 @@ declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
741
741
|
button?: "left" | "right" | "middle" | undefined;
|
|
742
742
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
743
743
|
} | {
|
|
744
|
+
type: "scroll";
|
|
744
745
|
at: {
|
|
745
746
|
x: number;
|
|
746
747
|
y: number;
|
|
747
748
|
};
|
|
748
|
-
type: "scroll";
|
|
749
749
|
amount: number;
|
|
750
750
|
direction: "up" | "down" | "left" | "right";
|
|
751
751
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
752
752
|
} | {
|
|
753
|
-
type: "type_text";
|
|
754
753
|
text: string;
|
|
754
|
+
type: "type_text";
|
|
755
755
|
at?: {
|
|
756
756
|
x: number;
|
|
757
757
|
y: number;
|
|
758
758
|
} | undefined;
|
|
759
759
|
delivery_mode?: "background" | "foreground" | undefined;
|
|
760
760
|
} | {
|
|
761
|
-
keys: string;
|
|
762
761
|
type: "key";
|
|
762
|
+
keys: string;
|
|
763
763
|
at?: {
|
|
764
764
|
x: number;
|
|
765
765
|
y: number;
|
|
@@ -3,6 +3,7 @@ export { WriteFileTool } from './write-file.js';
|
|
|
3
3
|
export { EditTool } from './edit.js';
|
|
4
4
|
export { BashTool } from './bash.js';
|
|
5
5
|
export { GlobTool } from './glob.js';
|
|
6
|
+
export { CODE_ANALYSIS_TOOL_NAME, CodeAnalysisTool, getCodeAnalysisTools, } from './code-analysis.js';
|
|
6
7
|
export { LSP_TOOL_NAME, LspTool, getCodeNavigationTools } from './lsp.js';
|
|
7
8
|
export { GrepTool } from './grep.js';
|
|
8
9
|
export { JobTool } from './job.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/builtins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC3F,YAAY,EACX,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,GAChB,MAAM,YAAY,CAAA;AACnB,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,aAAa,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AACzF,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,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AAY,CAAA;AACnB,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,aAAa,GACb,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AACzF,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACpE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AAC/F,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAEjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAsB/D,wBAAgB,eAAe,IAAI,cAAc,EAAE,CAsBlD"}
|
|
@@ -3,6 +3,7 @@ export { WriteFileTool } from './write-file.js';
|
|
|
3
3
|
export { EditTool } from './edit.js';
|
|
4
4
|
export { BashTool } from './bash.js';
|
|
5
5
|
export { GlobTool } from './glob.js';
|
|
6
|
+
export { CODE_ANALYSIS_TOOL_NAME, CodeAnalysisTool, getCodeAnalysisTools, } from './code-analysis.js';
|
|
6
7
|
export { LSP_TOOL_NAME, LspTool, getCodeNavigationTools } from './lsp.js';
|
|
7
8
|
export { GrepTool } from './grep.js';
|
|
8
9
|
export { JobTool } from './job.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/builtins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAg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,mBAAmB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,wEAAwE;AACxE,sEAAsE;AACtE,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,qEAAqE;AACrE,sEAAsE;AACtE,yBAAyB;AACzB,0EAA0E;AAE1E,MAAM,UAAU,eAAe;IAC9B,yEAAyE;IACzE,wEAAwE;IACxE,uEAAuE;IACvE,oEAAoE;IACpE,wEAAwE;IACxE,8DAA8D;IAC9D,EAAE;IACF,mEAAmE;IACnE,sEAAsE;IACtE,OAAO;IACP,OAAO;QACN,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,YAAY;QACZ,iBAAiB;QACjB,cAAc;QACd,aAAa;KACb,CAAA;AACF,CAAC"}
|
|
@@ -2,8 +2,8 @@ import type { CodeNavigationProvider } from '../../types/code-navigation/index.j
|
|
|
2
2
|
export declare const LSP_TOOL_NAME = "lsp";
|
|
3
3
|
export declare const LspTool: import("../../types/tool/index.js").ToolDefinition<{
|
|
4
4
|
path: string;
|
|
5
|
-
operation: "hover" | "references" | "definition";
|
|
6
5
|
line: number;
|
|
6
|
+
operation: "hover" | "references" | "definition";
|
|
7
7
|
character: number;
|
|
8
8
|
} | {
|
|
9
9
|
operation: "symbols";
|
|
@@ -71,12 +71,12 @@ export declare const SKILL_TOOL_NAME = "skill";
|
|
|
71
71
|
* tools run. {@link SkillTool} is this with no options.
|
|
72
72
|
*/
|
|
73
73
|
export declare function createSkillTool(options?: SkillToolOptions): import("../../public-types.js").ToolDefinition<{
|
|
74
|
-
name?: string | undefined;
|
|
75
74
|
cursor?: string | undefined;
|
|
75
|
+
name?: string | undefined;
|
|
76
76
|
}>;
|
|
77
77
|
/** The `skill` tool with no host options: the listing carries the registry's `location`. */
|
|
78
78
|
export declare const SkillTool: import("../../public-types.js").ToolDefinition<{
|
|
79
|
-
name?: string | undefined;
|
|
80
79
|
cursor?: string | undefined;
|
|
80
|
+
name?: string | undefined;
|
|
81
81
|
}>;
|
|
82
82
|
//# sourceMappingURL=skill.d.ts.map
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The seam a semantic code index arrives on.
|
|
3
|
+
*
|
|
4
|
+
* Declared in the SDK and implemented in `@namzu/analysis`, the same split
|
|
5
|
+
* `CodeNavigationProvider` uses with `@namzu/lsp`: the kernel owns the shape a
|
|
6
|
+
* tool programs against, the optional package owns the parser and the store
|
|
7
|
+
* that answer. A host constructs one and puts it on the tool context — there
|
|
8
|
+
* is no discovery step.
|
|
9
|
+
*
|
|
10
|
+
* Kept here rather than imported from `@namzu/analysis` because the
|
|
11
|
+
* dependency direction forbids it: `sdk ← analysis`, never the other way.
|
|
12
|
+
*
|
|
13
|
+
* ## What this answers that `grep` and a language server do not
|
|
14
|
+
*
|
|
15
|
+
* `grep` finds a string and says nothing of the function around it. A
|
|
16
|
+
* language server resolves a symbol the project's own types can see, and has
|
|
17
|
+
* nothing to say about a 40 MB bundle with no types and a hundred
|
|
18
|
+
* single-letter names. This index is for the second case: *which function
|
|
19
|
+
* contains this literal, what is its exact source, and who calls it by name*,
|
|
20
|
+
* over code nobody wrote for you to read.
|
|
21
|
+
*
|
|
22
|
+
* ## Positions
|
|
23
|
+
*
|
|
24
|
+
* Lines and columns are ONE-based, and columns count UTF-16 code units, which
|
|
25
|
+
* is what a JavaScript string index is. A character outside the Basic
|
|
26
|
+
* Multilingual Plane therefore takes two columns. `start` / `end` are the
|
|
27
|
+
* same UTF-16 offsets into the file's text, half-open. A line ends at `\n`.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* How much of the question the answer covers.
|
|
31
|
+
*
|
|
32
|
+
* Two cases, and the second carries its reasons. `partial` is not a failure —
|
|
33
|
+
* the answer is true as far as it goes — but a caller deciding "nothing
|
|
34
|
+
* calls this" from a partial answer is guessing, and the reasons say what is
|
|
35
|
+
* missing (a file that did not parse, a file that changed since it was
|
|
36
|
+
* indexed, a page cut off by `limit`).
|
|
37
|
+
*/
|
|
38
|
+
export type AnalysisCoverage = {
|
|
39
|
+
readonly status: 'complete';
|
|
40
|
+
} | {
|
|
41
|
+
readonly status: 'partial';
|
|
42
|
+
readonly reasons: readonly string[];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The evidence behind an answer, in three parts.
|
|
46
|
+
*
|
|
47
|
+
* - `observed`: what the index read out of the files, stated as fact.
|
|
48
|
+
* - `inferred`: what was concluded rather than read. A callee matched by
|
|
49
|
+
* its TEXT is an inference — the index does no scope analysis, so two
|
|
50
|
+
* unrelated functions called `run` are the same callee to it.
|
|
51
|
+
* - `coverage`: whether the answer is the whole answer.
|
|
52
|
+
*
|
|
53
|
+
* Every successful result carries one. An answer without it reads as
|
|
54
|
+
* certain, and the cases this package exists for are the ones where it is
|
|
55
|
+
* not.
|
|
56
|
+
*/
|
|
57
|
+
export interface AnalysisEvidence {
|
|
58
|
+
readonly observed: readonly string[];
|
|
59
|
+
readonly inferred: readonly string[];
|
|
60
|
+
readonly coverage: AnalysisCoverage;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* What a query answers. Three cases, closed, as with `CodeNavigationResult`:
|
|
64
|
+
* `unsupported` is "this index does not do that", `failed` is "something
|
|
65
|
+
* broke", and neither is an empty page. An empty page means "I looked and
|
|
66
|
+
* there are none", the answer a deletion depends on.
|
|
67
|
+
*/
|
|
68
|
+
export type CodeAnalysisResult<T> = {
|
|
69
|
+
readonly kind: 'ok';
|
|
70
|
+
readonly value: T;
|
|
71
|
+
readonly evidence: AnalysisEvidence;
|
|
72
|
+
} | {
|
|
73
|
+
readonly kind: 'unsupported';
|
|
74
|
+
readonly reason: string;
|
|
75
|
+
} | {
|
|
76
|
+
readonly kind: 'failed';
|
|
77
|
+
readonly error: string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* One page of a larger answer. `total` is the count across ALL pages, so a
|
|
81
|
+
* caller can tell a complete list from the first slice of a long one;
|
|
82
|
+
* `nextCursor` is absent on the last page and is opaque — pass it back
|
|
83
|
+
* unchanged.
|
|
84
|
+
*/
|
|
85
|
+
export interface AnalysisPage<T> {
|
|
86
|
+
readonly items: readonly T[];
|
|
87
|
+
readonly total: number;
|
|
88
|
+
readonly nextCursor?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* What every request may carry beyond its own fields.
|
|
92
|
+
*
|
|
93
|
+
* `signal` stops the call: an index run in progress is abandoned (what it had
|
|
94
|
+
* already committed stays, so the next call continues from there), and a call
|
|
95
|
+
* still queued behind another never starts. Without it nothing a user does,
|
|
96
|
+
* Esc included, can stop a multi-second index of a large tree.
|
|
97
|
+
*/
|
|
98
|
+
export interface AnalysisCallOptions {
|
|
99
|
+
readonly signal?: AbortSignal;
|
|
100
|
+
}
|
|
101
|
+
/** The paging arguments every list-returning request takes. */
|
|
102
|
+
export interface AnalysisPaging extends AnalysisCallOptions {
|
|
103
|
+
/** Items per page. The provider clamps it to its own maximum. */
|
|
104
|
+
readonly limit?: number;
|
|
105
|
+
/** The previous page's `nextCursor`. */
|
|
106
|
+
readonly cursor?: string;
|
|
107
|
+
}
|
|
108
|
+
export type AnalysisFunctionKind = 'declaration' | 'expression' | 'arrow' | 'method' | 'getter' | 'setter' | 'constructor';
|
|
109
|
+
/**
|
|
110
|
+
* A function, located. `id` is valid until its file changes and is then
|
|
111
|
+
* re-issued: do not keep one across an `index` that re-read the file.
|
|
112
|
+
*/
|
|
113
|
+
export interface AnalysisFunction {
|
|
114
|
+
readonly id: number;
|
|
115
|
+
/** `null` for an anonymous function with nothing to infer a name from. */
|
|
116
|
+
readonly name: string | null;
|
|
117
|
+
readonly kind: AnalysisFunctionKind;
|
|
118
|
+
/** Absolute path. */
|
|
119
|
+
readonly path: string;
|
|
120
|
+
readonly line: number;
|
|
121
|
+
readonly column: number;
|
|
122
|
+
readonly endLine: number;
|
|
123
|
+
readonly start: number;
|
|
124
|
+
readonly end: number;
|
|
125
|
+
}
|
|
126
|
+
/** A piece of a file's source, with the honesty about a cut. */
|
|
127
|
+
export interface AnalysisSourceSlice {
|
|
128
|
+
readonly text: string;
|
|
129
|
+
/** The full length in UTF-16 units, whether or not all of it is in `text`. */
|
|
130
|
+
readonly chars: number;
|
|
131
|
+
/** `true` when `text` is shorter than `chars` because of the size cap. */
|
|
132
|
+
readonly truncated: boolean;
|
|
133
|
+
}
|
|
134
|
+
export interface IndexRequest extends AnalysisCallOptions {
|
|
135
|
+
/** Absolute directory the index belongs to. */
|
|
136
|
+
readonly root: string;
|
|
137
|
+
/**
|
|
138
|
+
* Index only this file or directory under `root`, instead of all of it.
|
|
139
|
+
*
|
|
140
|
+
* The way to make progress on a root too big to index whole (a home
|
|
141
|
+
* directory): a call that stops at its limits says so, and the next step is
|
|
142
|
+
* a narrower `scope`. Work from earlier calls is kept.
|
|
143
|
+
*/
|
|
144
|
+
readonly scope?: string;
|
|
145
|
+
/** Re-read every file, ignoring size / mtime / hash. */
|
|
146
|
+
readonly force?: boolean;
|
|
147
|
+
}
|
|
148
|
+
export interface IndexSummary {
|
|
149
|
+
readonly root: string;
|
|
150
|
+
/** Whether the index lives on disk; `false` for an in-memory fallback. */
|
|
151
|
+
readonly persisted: boolean;
|
|
152
|
+
readonly files: {
|
|
153
|
+
readonly indexed: number;
|
|
154
|
+
/** Parsed this call (new or changed). */
|
|
155
|
+
readonly parsed: number;
|
|
156
|
+
/** Seen and left alone: same size and mtime, or same content hash. */
|
|
157
|
+
readonly unchanged: number;
|
|
158
|
+
readonly removed: number;
|
|
159
|
+
readonly skipped: number;
|
|
160
|
+
readonly withParseErrors: number;
|
|
161
|
+
};
|
|
162
|
+
/** Why files were skipped, as reason → count. */
|
|
163
|
+
readonly skippedReasons: Readonly<Record<string, number>>;
|
|
164
|
+
readonly functions: number;
|
|
165
|
+
readonly strings: number;
|
|
166
|
+
readonly calls: number;
|
|
167
|
+
readonly durationMs: number;
|
|
168
|
+
/**
|
|
169
|
+
* Why this call stopped before covering `scope`, when it did: a time or
|
|
170
|
+
* directory limit. Present means the index is partial; the text names the
|
|
171
|
+
* next step.
|
|
172
|
+
*/
|
|
173
|
+
readonly truncated?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface FindLiteralRequest extends AnalysisPaging {
|
|
176
|
+
readonly root: string;
|
|
177
|
+
/** The substring to look for inside string and template literals. */
|
|
178
|
+
readonly text: string;
|
|
179
|
+
/** Absolute file or directory to restrict the search to. */
|
|
180
|
+
readonly path?: string;
|
|
181
|
+
/** Default `true`. */
|
|
182
|
+
readonly caseSensitive?: boolean;
|
|
183
|
+
}
|
|
184
|
+
export interface AnalysisLiteralHit {
|
|
185
|
+
readonly path: string;
|
|
186
|
+
readonly line: number;
|
|
187
|
+
readonly column: number;
|
|
188
|
+
readonly start: number;
|
|
189
|
+
readonly end: number;
|
|
190
|
+
readonly kind: 'string' | 'template' | 'key';
|
|
191
|
+
/** The literal's value, cut to a preview. */
|
|
192
|
+
readonly value: string;
|
|
193
|
+
readonly valueTruncated: boolean;
|
|
194
|
+
/** The innermost function around it; absent at the top level of a file. */
|
|
195
|
+
readonly function?: AnalysisFunction;
|
|
196
|
+
/**
|
|
197
|
+
* Present when the file this came from no longer matches the index: the
|
|
198
|
+
* position may be off (`changed`) or the file may be gone (`deleted`).
|
|
199
|
+
*/
|
|
200
|
+
readonly stale?: 'changed' | 'deleted';
|
|
201
|
+
}
|
|
202
|
+
export interface EnclosingFunctionRequest extends AnalysisCallOptions {
|
|
203
|
+
readonly root: string;
|
|
204
|
+
readonly path: string;
|
|
205
|
+
readonly line: number;
|
|
206
|
+
readonly column?: number;
|
|
207
|
+
/** Cap on the source slice, in UTF-16 units. */
|
|
208
|
+
readonly maxChars?: number;
|
|
209
|
+
}
|
|
210
|
+
export interface AnalysisEnclosingFunction {
|
|
211
|
+
/** `null` when the position is not inside any function — a real answer. */
|
|
212
|
+
readonly function: AnalysisFunction | null;
|
|
213
|
+
/** The function's parents, innermost first. */
|
|
214
|
+
readonly parents: readonly AnalysisFunction[];
|
|
215
|
+
readonly source?: AnalysisSourceSlice;
|
|
216
|
+
}
|
|
217
|
+
export interface FunctionSourceRequest extends AnalysisPaging {
|
|
218
|
+
readonly root: string;
|
|
219
|
+
/** A function id from an earlier answer. */
|
|
220
|
+
readonly id?: number;
|
|
221
|
+
/** Alternatively, a file and a name; several functions can share one. */
|
|
222
|
+
readonly path?: string;
|
|
223
|
+
readonly name?: string;
|
|
224
|
+
readonly maxChars?: number;
|
|
225
|
+
}
|
|
226
|
+
export interface AnalysisFunctionSource {
|
|
227
|
+
readonly function: AnalysisFunction;
|
|
228
|
+
readonly parents: readonly AnalysisFunction[];
|
|
229
|
+
readonly source: AnalysisSourceSlice;
|
|
230
|
+
}
|
|
231
|
+
export interface CallersOfRequest extends AnalysisPaging {
|
|
232
|
+
readonly root: string;
|
|
233
|
+
/** The callee text: `foo`, `obj.foo`, `this.foo`. */
|
|
234
|
+
readonly name: string;
|
|
235
|
+
/**
|
|
236
|
+
* `file` looks in `path` only and is the default, because a callee matched
|
|
237
|
+
* by text is far more likely to be the one you mean inside one file than
|
|
238
|
+
* across a bundle of unrelated modules that reuse short names.
|
|
239
|
+
*/
|
|
240
|
+
readonly scope?: 'file' | 'workspace';
|
|
241
|
+
readonly path?: string;
|
|
242
|
+
/**
|
|
243
|
+
* `exact` matches the callee text as written. `member` also matches any
|
|
244
|
+
* `<expression>.name`, which finds method calls whose receiver is unknown.
|
|
245
|
+
*/
|
|
246
|
+
readonly match?: 'exact' | 'member';
|
|
247
|
+
}
|
|
248
|
+
export interface AnalysisCallSite {
|
|
249
|
+
readonly path: string;
|
|
250
|
+
readonly line: number;
|
|
251
|
+
readonly column: number;
|
|
252
|
+
readonly callee: string;
|
|
253
|
+
readonly kind: 'call' | 'new';
|
|
254
|
+
readonly argumentCount: number;
|
|
255
|
+
/** The function the call sits in; absent at the top level of a file. */
|
|
256
|
+
readonly caller?: AnalysisFunction;
|
|
257
|
+
/** See {@link AnalysisLiteralHit.stale}. */
|
|
258
|
+
readonly stale?: 'changed' | 'deleted';
|
|
259
|
+
}
|
|
260
|
+
export interface ImportsRequest extends AnalysisPaging {
|
|
261
|
+
readonly root: string;
|
|
262
|
+
readonly path: string;
|
|
263
|
+
}
|
|
264
|
+
export type AnalysisModuleEdge = {
|
|
265
|
+
readonly direction: 'import';
|
|
266
|
+
readonly kind: 'static' | 'type' | 'require' | 'dynamic';
|
|
267
|
+
readonly source: string;
|
|
268
|
+
readonly names: readonly string[];
|
|
269
|
+
readonly line: number;
|
|
270
|
+
readonly column: number;
|
|
271
|
+
} | {
|
|
272
|
+
readonly direction: 'export';
|
|
273
|
+
readonly kind: 'named' | 'default' | 'reexport' | 'star';
|
|
274
|
+
readonly name: string;
|
|
275
|
+
readonly source?: string;
|
|
276
|
+
readonly line: number;
|
|
277
|
+
readonly column: number;
|
|
278
|
+
};
|
|
279
|
+
export interface CodeAnalysisProvider {
|
|
280
|
+
/**
|
|
281
|
+
* Build or refresh the index for a directory. Incremental: a file whose
|
|
282
|
+
* size and mtime are unchanged is not read, and one whose content hash is
|
|
283
|
+
* unchanged is not parsed.
|
|
284
|
+
*/
|
|
285
|
+
index(request: IndexRequest): Promise<CodeAnalysisResult<IndexSummary>>;
|
|
286
|
+
/** Where a string appears, and the function around each hit. */
|
|
287
|
+
findLiteral(request: FindLiteralRequest): Promise<CodeAnalysisResult<AnalysisPage<AnalysisLiteralHit>>>;
|
|
288
|
+
/** The function containing a position, with its source and parent chain. */
|
|
289
|
+
enclosingFunction(request: EnclosingFunctionRequest): Promise<CodeAnalysisResult<AnalysisEnclosingFunction>>;
|
|
290
|
+
/** A function's exact source, by id or by file and name. */
|
|
291
|
+
functionSource(request: FunctionSourceRequest): Promise<CodeAnalysisResult<AnalysisPage<AnalysisFunctionSource>>>;
|
|
292
|
+
/** Call sites of a name. Matched by text, not by scope; see the evidence. */
|
|
293
|
+
callersOf(request: CallersOfRequest): Promise<CodeAnalysisResult<AnalysisPage<AnalysisCallSite>>>;
|
|
294
|
+
/** One file's imports and exports. */
|
|
295
|
+
imports(request: ImportsRequest): Promise<CodeAnalysisResult<AnalysisPage<AnalysisModuleEdge>>>;
|
|
296
|
+
/** Close whatever backs it. Not optional: an open database is a held file. */
|
|
297
|
+
dispose(): Promise<void>;
|
|
298
|
+
}
|
|
299
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/code-analysis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GACzB;IAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GAC/B;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAA;AAEtE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAA;CACnC;AAED;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,M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AO,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAC,CAAA;IACzD,4DAA4D;IAC5D,cAAc,CACb,OAAO,EAAE,qBAAqB,GAC5B,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAA;IACpE,6EAA6E;IAC7E,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAA;IACjG,sCAAsC;IACtC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAA;IAC/F,8EAA8E;IAC9E,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACxB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The seam a semantic code index arrives on.
|
|
3
|
+
*
|
|
4
|
+
* Declared in the SDK and implemented in `@namzu/analysis`, the same split
|
|
5
|
+
* `CodeNavigationProvider` uses with `@namzu/lsp`: the kernel owns the shape a
|
|
6
|
+
* tool programs against, the optional package owns the parser and the store
|
|
7
|
+
* that answer. A host constructs one and puts it on the tool context — there
|
|
8
|
+
* is no discovery step.
|
|
9
|
+
*
|
|
10
|
+
* Kept here rather than imported from `@namzu/analysis` because the
|
|
11
|
+
* dependency direction forbids it: `sdk ← analysis`, never the other way.
|
|
12
|
+
*
|
|
13
|
+
* ## What this answers that `grep` and a language server do not
|
|
14
|
+
*
|
|
15
|
+
* `grep` finds a string and says nothing of the function around it. A
|
|
16
|
+
* language server resolves a symbol the project's own types can see, and has
|
|
17
|
+
* nothing to say about a 40 MB bundle with no types and a hundred
|
|
18
|
+
* single-letter names. This index is for the second case: *which function
|
|
19
|
+
* contains this literal, what is its exact source, and who calls it by name*,
|
|
20
|
+
* over code nobody wrote for you to read.
|
|
21
|
+
*
|
|
22
|
+
* ## Positions
|
|
23
|
+
*
|
|
24
|
+
* Lines and columns are ONE-based, and columns count UTF-16 code units, which
|
|
25
|
+
* is what a JavaScript string index is. A character outside the Basic
|
|
26
|
+
* Multilingual Plane therefore takes two columns. `start` / `end` are the
|
|
27
|
+
* same UTF-16 offsets into the file's text, half-open. A line ends at `\n`.
|
|
28
|
+
*/
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/code-analysis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
|