pi-context-kit 0.4.2 → 0.4.4

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +22 -8
  2. package/LICENSE +1 -1
  3. package/README.md +162 -151
  4. package/context-kit.schema.json +62 -78
  5. package/extensions/index.ts +279 -256
  6. package/node_modules/pi-hl-utils/LICENSE +21 -0
  7. package/node_modules/pi-hl-utils/package.json +47 -0
  8. package/node_modules/pi-hl-utils/src/errors.ts +9 -0
  9. package/node_modules/pi-hl-utils/src/evidence.ts +363 -0
  10. package/node_modules/pi-hl-utils/src/expand-on-click.ts +90 -0
  11. package/node_modules/pi-hl-utils/src/layered-settings.ts +513 -0
  12. package/node_modules/pi-hl-utils/src/null-optional-arguments.ts +147 -0
  13. package/node_modules/pi-hl-utils/src/pi-agent-session-discovery.ts +48 -0
  14. package/node_modules/pi-hl-utils/src/record.ts +3 -0
  15. package/node_modules/pi-hl-utils/src/settings-command.ts +213 -0
  16. package/node_modules/pi-hl-utils/src/settings-menu.ts +477 -0
  17. package/node_modules/pi-hl-utils/src/token-calibration.ts +39 -0
  18. package/node_modules/pi-hl-utils/src/ui.ts +355 -0
  19. package/package.json +42 -44
  20. package/src/background.ts +2 -3
  21. package/src/command.ts +17 -0
  22. package/src/config.ts +3 -207
  23. package/src/context-kit-settings.ts +152 -0
  24. package/src/context.ts +43 -16
  25. package/src/files.ts +6 -13
  26. package/src/handoff.ts +3 -7
  27. package/src/maintain.ts +6 -19
  28. package/src/menu.ts +159 -0
  29. package/src/migrate.ts +99 -19
  30. package/src/note.ts +5 -6
  31. package/src/prune.ts +2 -1
  32. package/src/recall.ts +14 -37
  33. package/src/settings-file.ts +13 -101
  34. package/src/shake.ts +6 -12
  35. package/src/stale.ts +22 -26
  36. package/src/status.ts +2 -6
  37. package/src/tool-calls.ts +2 -3
  38. package/README.zh-CN.md +0 -387
  39. package/src/panel.ts +0 -89
@@ -2,11 +2,10 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://unpkg.com/pi-context-kit/context-kit.schema.json",
4
4
  "title": "pi-context-kit settings",
5
- "description": "~/.pi/agent/context-kit.json, or .pi/context-kit.json in a trusted project.",
5
+ "description": "The \"context-kit\" namespace of Pi's settings.json: ~/.pi/agent/settings.json, or .pi/settings.json in a trusted project.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
8
  "properties": {
9
- "$schema": { "type": "string" },
10
9
  "enabled": {
11
10
  "description": "false stops context maintenance and handoff notes. recall stays available.",
12
11
  "type": "boolean",
@@ -17,7 +16,10 @@
17
16
  "default": "75%",
18
17
  "oneOf": [
19
18
  { "type": "integer", "minimum": 1 },
20
- { "type": "string", "pattern": "^(0*100(\\.0+)?|0*[1-9]\\d?(\\.\\d+)?|0+\\.\\d*[1-9]\\d*)%$" },
19
+ {
20
+ "type": "string",
21
+ "pattern": "^(0*100(\\.0+)?|0*[1-9]\\d?(\\.\\d+)?|0+\\.\\d*[1-9]\\d*)%$"
22
+ },
21
23
  { "const": "pi" }
22
24
  ]
23
25
  },
@@ -26,81 +28,63 @@
26
28
  "enum": ["balanced", "frugal", "pi-summary"],
27
29
  "default": "balanced"
28
30
  },
29
- "advanced": {
30
- "type": "object",
31
- "additionalProperties": false,
32
- "properties": {
33
- "methodOrder": {
34
- "description": "Replaces the method order of the strategy. Methods after \"soft\" never run.",
35
- "type": "array",
36
- "items": { "enum": ["handoff", "shake", "soft"] }
37
- },
38
- "background": {
39
- "description": "Write the handoff note in the background before the threshold. The strategy sets the default.",
40
- "type": "boolean"
41
- },
42
- "supersedeReads": {
43
- "description": "Replace an older read of a file that was read again.",
44
- "type": "boolean",
45
- "default": true
46
- },
47
- "progressRatio": {
48
- "description": "Each method must bring the context to this fraction of the threshold, or the next method runs.",
49
- "type": "number",
50
- "exclusiveMinimum": 0,
51
- "maximum": 1,
52
- "default": 0.8
53
- },
54
- "prune": {
55
- "type": "object",
56
- "additionalProperties": false,
57
- "properties": {
58
- "enabled": { "type": "boolean", "default": true },
59
- "protectTokens": {
60
- "description": "The newest tool outputs, up to this many tokens, are never pruned.",
61
- "type": "integer",
62
- "minimum": 0,
63
- "default": 40000
64
- },
65
- "minSavings": {
66
- "description": "Prune only when this many tokens or more are removed.",
67
- "type": "integer",
68
- "minimum": 0,
69
- "default": 20000
70
- },
71
- "minTokens": {
72
- "description": "Tool outputs smaller than this are never pruned.",
73
- "type": "integer",
74
- "minimum": 0,
75
- "default": 50
76
- }
77
- }
78
- },
79
- "shake": {
80
- "type": "object",
81
- "additionalProperties": false,
82
- "properties": {
83
- "protectTokens": {
84
- "description": "The newest context, up to this many tokens, is never shaken.",
85
- "type": "integer",
86
- "minimum": 0,
87
- "default": 16000
88
- },
89
- "minSavings": {
90
- "description": "Shake only when this many tokens or more are removed.",
91
- "type": "integer",
92
- "minimum": 0,
93
- "default": 4000
94
- },
95
- "blockMinTokens": {
96
- "description": "Code and XML blocks smaller than this are never shaken.",
97
- "type": "integer",
98
- "minimum": 0,
99
- "default": 400
100
- }
101
- }
102
- }
103
- }
31
+ "methodOrder": {
32
+ "description": "Replaces the method order of the strategy. Methods after \"soft\" never run.",
33
+ "type": "array",
34
+ "items": { "enum": ["handoff", "shake", "soft"] }
35
+ },
36
+ "background": {
37
+ "description": "Write the handoff note in the background before the threshold. The strategy sets the default.",
38
+ "type": "boolean"
39
+ },
40
+ "supersedeReads": {
41
+ "description": "Replace an older read of a file that was read again.",
42
+ "type": "boolean",
43
+ "default": true
44
+ },
45
+ "progressRatio": {
46
+ "description": "Each method must bring the context to this fraction of the threshold, or the next method runs.",
47
+ "type": "number",
48
+ "exclusiveMinimum": 0,
49
+ "maximum": 1,
50
+ "default": 0.8
51
+ },
52
+ "pruneEnabled": { "type": "boolean", "default": true },
53
+ "pruneProtectTokens": {
54
+ "description": "The newest tool outputs, up to this many tokens, are never pruned.",
55
+ "type": "integer",
56
+ "minimum": 0,
57
+ "default": 40000
58
+ },
59
+ "pruneMinSavings": {
60
+ "description": "Prune only when this many tokens or more are removed.",
61
+ "type": "integer",
62
+ "minimum": 0,
63
+ "default": 20000
64
+ },
65
+ "pruneMinTokens": {
66
+ "description": "Tool outputs smaller than this are never pruned.",
67
+ "type": "integer",
68
+ "minimum": 0,
69
+ "default": 50
70
+ },
71
+ "shakeProtectTokens": {
72
+ "description": "The newest context, up to this many tokens, is never shaken.",
73
+ "type": "integer",
74
+ "minimum": 0,
75
+ "default": 16000
76
+ },
77
+ "shakeMinSavings": {
78
+ "description": "Shake only when this many tokens or more are removed.",
79
+ "type": "integer",
80
+ "minimum": 0,
81
+ "default": 4000
82
+ },
83
+ "shakeBlockMinTokens": {
84
+ "description": "Code and XML blocks smaller than this are never shaken.",
85
+ "type": "integer",
86
+ "minimum": 0,
87
+ "default": 400
104
88
  }
105
89
  }
106
90
  }