pi-goosedump 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/index.ts +34 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Once installed, pi-goosedump registers a tool and a slash command:
|
|
|
21
21
|
|
|
22
22
|
### Tool: `goosedump`
|
|
23
23
|
|
|
24
|
-
The agent can browse session
|
|
24
|
+
The agent can browse the current session by default or a named session with `contextId`:
|
|
25
25
|
|
|
26
26
|
| Action | Description |
|
|
27
27
|
| -------- | ---------------------------------------- |
|
|
@@ -34,9 +34,10 @@ Examples:
|
|
|
34
34
|
|
|
35
35
|
```
|
|
36
36
|
goosedump({ action: "list" })
|
|
37
|
+
goosedump({ action: "search", query: "bug fix" })
|
|
37
38
|
goosedump({ action: "search", contextId: "abc123", query: "bug fix" })
|
|
38
|
-
goosedump({ action: "expand",
|
|
39
|
-
goosedump({ action: "view"
|
|
39
|
+
goosedump({ action: "expand", ids: ["entry-a", "entry-b"] })
|
|
40
|
+
goosedump({ action: "view" })
|
|
40
41
|
```
|
|
41
42
|
|
|
42
43
|
### Command: `/goosedump`
|
package/index.ts
CHANGED
|
@@ -551,13 +551,14 @@ export function createGoosedumpIntegration(
|
|
|
551
551
|
name: 'goosedump',
|
|
552
552
|
label: 'goosedump',
|
|
553
553
|
description:
|
|
554
|
-
'Browse coding agent session history. List all sessions, or view/search
|
|
554
|
+
'Browse coding agent session history. List all sessions, or view/search the current or a named session. Supports ranked search, compact overview, and result expansion. Default scope is active lineage.',
|
|
555
555
|
promptSnippet:
|
|
556
|
-
'goosedump({ action: "search",
|
|
556
|
+
'goosedump({ action: "search", query, contextId?, scope?, page? }) - search session history; omit contextId for current session',
|
|
557
557
|
promptGuidelines: [
|
|
558
558
|
'When researching past conversation history, use goosedump to find relevant context.',
|
|
559
559
|
'Start with compact ranked search (compact: true) for quick overview, then expand interesting entries.',
|
|
560
560
|
'Default scope is "lineage" (current branch); use scope: "all" to include all entries in the session.',
|
|
561
|
+
'Omit contextId to search, expand, or view the current Pi session; use list first for other sessions.',
|
|
561
562
|
],
|
|
562
563
|
parameters: Type.Object({
|
|
563
564
|
action: Type.Union(
|
|
@@ -574,7 +575,8 @@ export function createGoosedumpIntegration(
|
|
|
574
575
|
),
|
|
575
576
|
contextId: Type.Optional(
|
|
576
577
|
Type.String({
|
|
577
|
-
description:
|
|
578
|
+
description:
|
|
579
|
+
'Context/session ID (defaults to current session for search, expand, view)',
|
|
578
580
|
}),
|
|
579
581
|
),
|
|
580
582
|
query: Type.Optional(
|
|
@@ -605,7 +607,7 @@ export function createGoosedumpIntegration(
|
|
|
605
607
|
}),
|
|
606
608
|
),
|
|
607
609
|
}),
|
|
608
|
-
async execute(_id, params, _signal, _onUpdate,
|
|
610
|
+
async execute(_id, params, _signal, _onUpdate, ctx): Promise<AgentToolResult<void>> {
|
|
609
611
|
if (!goosedumpEnabled || !goosedumpReady) {
|
|
610
612
|
return {
|
|
611
613
|
content: [
|
|
@@ -641,9 +643,15 @@ export function createGoosedumpIntegration(
|
|
|
641
643
|
}
|
|
642
644
|
|
|
643
645
|
case 'search': {
|
|
644
|
-
|
|
646
|
+
const contextId = params.contextId ?? currentSessionContextId(ctx);
|
|
647
|
+
if (!contextId) {
|
|
645
648
|
return {
|
|
646
|
-
content: [
|
|
649
|
+
content: [
|
|
650
|
+
{
|
|
651
|
+
type: 'text',
|
|
652
|
+
text: 'contextId is required for search when no current session is available',
|
|
653
|
+
},
|
|
654
|
+
],
|
|
647
655
|
details: undefined,
|
|
648
656
|
};
|
|
649
657
|
}
|
|
@@ -655,7 +663,7 @@ export function createGoosedumpIntegration(
|
|
|
655
663
|
};
|
|
656
664
|
}
|
|
657
665
|
|
|
658
|
-
const result = goosedumpContext(
|
|
666
|
+
const result = goosedumpContext(contextId, {
|
|
659
667
|
scope: params.scope ?? 'lineage',
|
|
660
668
|
grep: params.query,
|
|
661
669
|
compact: params.compact ?? true,
|
|
@@ -683,9 +691,15 @@ export function createGoosedumpIntegration(
|
|
|
683
691
|
}
|
|
684
692
|
|
|
685
693
|
case 'expand': {
|
|
686
|
-
|
|
694
|
+
const contextId = params.contextId ?? currentSessionContextId(ctx);
|
|
695
|
+
if (!contextId) {
|
|
687
696
|
return {
|
|
688
|
-
content: [
|
|
697
|
+
content: [
|
|
698
|
+
{
|
|
699
|
+
type: 'text',
|
|
700
|
+
text: 'contextId is required for expand when no current session is available',
|
|
701
|
+
},
|
|
702
|
+
],
|
|
689
703
|
details: undefined,
|
|
690
704
|
};
|
|
691
705
|
}
|
|
@@ -700,7 +714,7 @@ export function createGoosedumpIntegration(
|
|
|
700
714
|
}
|
|
701
715
|
|
|
702
716
|
const messages = goosedumpExpand(
|
|
703
|
-
|
|
717
|
+
contextId,
|
|
704
718
|
params.ids,
|
|
705
719
|
params.scope ?? 'lineage',
|
|
706
720
|
);
|
|
@@ -719,23 +733,27 @@ export function createGoosedumpIntegration(
|
|
|
719
733
|
}
|
|
720
734
|
|
|
721
735
|
case 'view': {
|
|
722
|
-
|
|
736
|
+
const contextId = params.contextId ?? currentSessionContextId(ctx);
|
|
737
|
+
if (!contextId) {
|
|
723
738
|
return {
|
|
724
|
-
content: [
|
|
739
|
+
content: [
|
|
740
|
+
{
|
|
741
|
+
type: 'text',
|
|
742
|
+
text: 'contextId is required for view when no current session is available',
|
|
743
|
+
},
|
|
744
|
+
],
|
|
725
745
|
details: undefined,
|
|
726
746
|
};
|
|
727
747
|
}
|
|
728
748
|
|
|
729
|
-
const result = goosedumpContext(
|
|
749
|
+
const result = goosedumpContext(contextId, {
|
|
730
750
|
scope: params.scope ?? 'lineage',
|
|
731
751
|
compact: false,
|
|
732
752
|
});
|
|
733
753
|
|
|
734
754
|
if (result.messages.length === 0) {
|
|
735
755
|
return {
|
|
736
|
-
content: [
|
|
737
|
-
{ type: 'text', text: `Session "${params.contextId}" has no messages.` },
|
|
738
|
-
],
|
|
756
|
+
content: [{ type: 'text', text: `Session "${contextId}" has no messages.` }],
|
|
739
757
|
details: undefined,
|
|
740
758
|
};
|
|
741
759
|
}
|