pi-smart-compact 7.15.1 → 7.18.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 +75 -0
- package/README.md +166 -285
- package/SECURITY.md +14 -5
- package/SUPPORT.md +18 -5
- package/dist/app/run-smart-compact.d.ts.map +1 -1
- package/dist/app/steps/extract.d.ts.map +1 -1
- package/dist/app/steps/persist.d.ts.map +1 -1
- package/dist/app/steps/recover.d.ts.map +1 -1
- package/dist/app/steps/state.d.ts.map +1 -1
- package/dist/app/steps/synthesize.d.ts.map +1 -1
- package/dist/constants.d.ts +60 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/domain/keywords.d.ts +20 -0
- package/dist/domain/keywords.d.ts.map +1 -0
- package/dist/domain/tool-semantics.d.ts +45 -0
- package/dist/domain/tool-semantics.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1624 -1226
- package/dist/infra/ai-messages.d.ts +40 -0
- package/dist/infra/ai-messages.d.ts.map +1 -0
- package/dist/infra/paths.d.ts +2 -0
- package/dist/infra/paths.d.ts.map +1 -1
- package/dist/infra/services.d.ts +1 -0
- package/dist/infra/services.d.ts.map +1 -1
- package/dist/phases/explore.d.ts +1 -1
- package/dist/phases/explore.d.ts.map +1 -1
- package/dist/phases/synthesize.d.ts +7 -0
- package/dist/phases/synthesize.d.ts.map +1 -1
- package/dist/phases/verify.d.ts.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/overlays.d.ts +7 -0
- package/dist/ui/overlays.d.ts.map +1 -1
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/damage.d.ts +14 -0
- package/dist/utils/damage.d.ts.map +1 -1
- package/dist/utils/extraction.d.ts.map +1 -1
- package/dist/utils/fingerprint.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts +33 -0
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/pruning.d.ts.map +1 -1
- package/dist/utils/session-log.d.ts.map +1 -1
- package/dist/utils/state.d.ts +7 -0
- package/dist/utils/state.d.ts.map +1 -1
- package/dist/utils/tokens.d.ts.map +1 -1
- package/docs/RELEASE.md +1 -1
- package/docs/assets/banner.svg +71 -0
- package/package.json +2 -2
package/SECURITY.md
CHANGED
|
@@ -4,9 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
Security fixes target the latest published version of `pi-smart-compact`.
|
|
6
6
|
|
|
7
|
+
| Version | Supported |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Latest `7.x` | ✅ |
|
|
10
|
+
| Older | ❌ |
|
|
11
|
+
|
|
7
12
|
## Reporting a vulnerability
|
|
8
13
|
|
|
9
|
-
Please do **not** open a public issue for vulnerabilities, leaked secrets, or
|
|
14
|
+
Please do **not** open a public issue for vulnerabilities, leaked secrets, or
|
|
15
|
+
private-session data exposure.
|
|
10
16
|
|
|
11
17
|
Report privately through GitHub Security Advisories:
|
|
12
18
|
|
|
@@ -14,15 +20,18 @@ Report privately through GitHub Security Advisories:
|
|
|
14
20
|
|
|
15
21
|
If advisories are unavailable, contact the maintainer listed in `package.json`.
|
|
16
22
|
|
|
17
|
-
## Data handling
|
|
23
|
+
## Data handling
|
|
18
24
|
|
|
19
|
-
`pi-smart-compact` processes Pi session content to produce compaction summaries.
|
|
25
|
+
`pi-smart-compact` processes Pi session content to produce compaction summaries.
|
|
26
|
+
Depending on the session, this may include repository paths, command output,
|
|
27
|
+
tool results, and user-provided context.
|
|
20
28
|
|
|
21
29
|
Operational guidance:
|
|
22
30
|
|
|
23
31
|
- Do not paste secrets into sessions you plan to compact.
|
|
24
32
|
- Redact private logs before attaching them to issues.
|
|
25
33
|
- Treat generated compaction summaries as potentially sensitive project context.
|
|
26
|
-
- Review provider/model configuration before enabling auto-triggered compaction.
|
|
34
|
+
- Review provider / model configuration before enabling auto-triggered compaction.
|
|
27
35
|
|
|
28
|
-
Runtime artifacts are written under `~/.pi/agent/`; see
|
|
36
|
+
Runtime artifacts are written under `~/.pi/agent/`; see the
|
|
37
|
+
[runtime artifacts table](./README.md#runtime-artifacts) in the README.
|
package/SUPPORT.md
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
# Support
|
|
2
2
|
|
|
3
|
-
For usage questions or bug reports specific to `pi-smart-compact`, open an
|
|
3
|
+
For usage questions or bug reports specific to `pi-smart-compact`, open an
|
|
4
|
+
issue in this repository:
|
|
4
5
|
|
|
5
6
|
<https://github.com/alpertarhan/pi-smart-compact/issues>
|
|
6
7
|
|
|
7
|
-
For Pi Coding Agent core behavior that reproduces without this extension,
|
|
8
|
+
For Pi Coding Agent core behavior that reproduces **without** this extension,
|
|
9
|
+
use the upstream Pi repository:
|
|
8
10
|
|
|
9
11
|
<https://github.com/earendil-works/pi>
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Before you file
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
Helpful things to include:
|
|
16
|
+
|
|
17
|
+
- `pi-smart-compact` version (from `package.json` or `/smart-compact` output)
|
|
14
18
|
- Pi Coding Agent version
|
|
15
|
-
- the
|
|
19
|
+
- the integration surface used (`/smart-compact`, `smart_compact`, or auto-trigger)
|
|
16
20
|
- relevant non-secret `smartCompact` configuration
|
|
17
21
|
- redacted error output or logs
|
|
22
|
+
|
|
23
|
+
## Self-service diagnostics
|
|
24
|
+
|
|
25
|
+
- `/smart-compact metrics` — profile / provider comparison from the metrics log
|
|
26
|
+
- `/smart-compact dashboard` — interactive TUI dashboard (overview, latest run, current session, recent runs)
|
|
27
|
+
- `/smart-compact dashboard` → *Write HTML dashboard* — a local `~/.pi/agent/.cache/smart-compact-report.html`
|
|
28
|
+
|
|
29
|
+
For security issues, see [`SECURITY.md`](./SECURITY.md) — please do **not**
|
|
30
|
+
open a public issue for vulnerabilities.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-smart-compact.d.ts","sourceRoot":"","sources":["../../src/app/run-smart-compact.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AAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmL9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../src/app/steps/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../src/app/steps/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAkB/D,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,GAAG,WAAW,CA0J1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../../src/app/steps/persist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAc,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../../src/app/steps/persist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAc,MAAM,gBAAgB,CAAC;AAUpE;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,CAGxD;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,CAkCvD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,UAAU,GAAG,iBAAiB,CAcxE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,CAmBpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recover.d.ts","sourceRoot":"","sources":["../../../src/app/steps/recover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"recover.d.ts","sourceRoot":"","sources":["../../../src/app/steps/recover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOjE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,UAAU,GAAG,WAAW,CAgB7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/app/steps/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/app/steps/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAY9D,wBAAgB,UAAU,CAAC,EAAE,EAAE,UAAU,GAAG,QAAQ,CAqFnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../../src/app/steps/synthesize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGpE,wBAAsB,qBAAqB,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../../src/app/steps/synthesize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGpE,wBAAsB,qBAAqB,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAoNnF"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { CompressionProfile, ProfileConfig } from "./types.ts";
|
|
|
8
8
|
* `package.json#version`. Do not hand-edit this line for releases; bump
|
|
9
9
|
* package.json and run `bun run sync-version`.
|
|
10
10
|
*/
|
|
11
|
-
export declare const VERSION = "7.
|
|
11
|
+
export declare const VERSION = "7.18.0";
|
|
12
12
|
export declare const CHARS_PER_TOKEN = 3.8;
|
|
13
13
|
export declare const COMPACT_SYSTEM_PREFIX: string;
|
|
14
14
|
export declare const PROFILES: Record<CompressionProfile, ProfileConfig>;
|
|
@@ -22,6 +22,7 @@ export declare const DEFAULT_CONFIG: {
|
|
|
22
22
|
backupEnabled: boolean;
|
|
23
23
|
backupDir: string;
|
|
24
24
|
minContextPercent: number;
|
|
25
|
+
pinPaths: string[];
|
|
25
26
|
};
|
|
26
27
|
export declare const NO_OP_RE: RegExp;
|
|
27
28
|
export declare const SHIFT_RE: RegExp;
|
|
@@ -49,11 +50,66 @@ export declare const MIN_TOKEN_THRESHOLD = 5000;
|
|
|
49
50
|
export declare const MAX_EXPLORATION_ROUNDS = 8;
|
|
50
51
|
export declare const BACKUP_MAX_FILES = 20;
|
|
51
52
|
export declare const BACKUP_MAX_AGE_MS: number;
|
|
52
|
-
export declare const
|
|
53
|
-
export declare const
|
|
54
|
-
export declare const
|
|
53
|
+
export declare const FIVE_MINUTES_MS: number;
|
|
54
|
+
export declare const ONE_HOUR_MS: number;
|
|
55
|
+
export declare const SEVEN_DAYS_MS: number;
|
|
56
|
+
export declare const THIRTY_DAYS_MS: number;
|
|
57
|
+
export declare const EXTRACTION_CACHE_PREFIX = "compact-extraction-";
|
|
58
|
+
export declare const ID_PREFIX: {
|
|
59
|
+
readonly PROJECT: "proj-";
|
|
60
|
+
readonly COMPACT_SESSION: "sc-";
|
|
61
|
+
readonly MULTI_TOOL_USE_SYNTHETIC: "mtu_";
|
|
62
|
+
readonly OPEN_LOOP: "loop-";
|
|
63
|
+
readonly DECISION: "decision-";
|
|
64
|
+
readonly ERROR: "error-";
|
|
65
|
+
};
|
|
66
|
+
export declare const TUNING: {
|
|
67
|
+
readonly EMA_PREV: 0.7;
|
|
68
|
+
readonly EMA_SAMPLE: 0.3;
|
|
69
|
+
readonly CALIBRATION_CLAMP_MIN: 0.3;
|
|
70
|
+
readonly CALIBRATION_CLAMP_MAX: 3;
|
|
71
|
+
readonly CONFIDENCE_HIGH: 0.85;
|
|
72
|
+
readonly CONFIDENCE_MEDIUM: 0.8;
|
|
73
|
+
readonly CONFIDENCE_LOW: 0.6;
|
|
74
|
+
};
|
|
75
|
+
export declare const TRUNC: {
|
|
76
|
+
readonly MESSAGE: 300;
|
|
77
|
+
readonly ERROR_DETAIL: 500;
|
|
78
|
+
readonly DECISION_SUMMARY: 200;
|
|
79
|
+
readonly USER_RESPONSE: 300;
|
|
80
|
+
readonly CONSTRAINT_TEXT: 300;
|
|
81
|
+
readonly OPEN_LOOP_SUMMARY: 120;
|
|
82
|
+
readonly TIMELINE_EVENT: 150;
|
|
83
|
+
readonly TIMELINE_ERROR: 100;
|
|
84
|
+
readonly SNIPPET: 80;
|
|
85
|
+
readonly PREVIEW: 150;
|
|
86
|
+
readonly PREVIEW_MID: 200;
|
|
87
|
+
readonly DETAIL: 300;
|
|
88
|
+
readonly PREVIEW_LONG: 400;
|
|
89
|
+
readonly PREVIEW_XL: 500;
|
|
90
|
+
readonly CHUNK_FALLBACK: 180;
|
|
91
|
+
readonly DECISION_DETAIL: 60;
|
|
92
|
+
readonly TOPIC_LABEL: 100;
|
|
93
|
+
readonly PROJ_ID_HASH: 12;
|
|
94
|
+
readonly CONV_HASH: 8;
|
|
95
|
+
readonly RESULT_GAPS: 5;
|
|
96
|
+
readonly SESSION_ID_DISPLAY: 20;
|
|
97
|
+
readonly ERROR_SNIPPET: 30;
|
|
98
|
+
readonly TIMELINE_DISPLAY: 10;
|
|
99
|
+
readonly EXPLORE_RESULTS: 15;
|
|
100
|
+
readonly BACKUP_PREVIEW_LINES: 5;
|
|
101
|
+
readonly FINGERPRINT_SEG: 2;
|
|
102
|
+
};
|
|
55
103
|
export declare const DAMAGE_RECENT_MSG_WINDOW = 15;
|
|
56
104
|
export declare const MAX_TOOL_OUTPUT_CHARS = 800;
|
|
105
|
+
/** Shell-output patterns signalling a likely error even in a non-`isError` result. */
|
|
106
|
+
export declare const LIKELY_ERROR_RE: RegExp;
|
|
107
|
+
/** catalogErrors only scans outputs shorter than this — pruning must not truncate below it. */
|
|
108
|
+
export declare const ERROR_SCAN_MAX_LEN = 2000;
|
|
109
|
+
/** How far forward to look for a retry of the same tool after an error. */
|
|
110
|
+
export declare const ERROR_RETRY_WINDOW = 6;
|
|
111
|
+
/** How far forward to look for that retry's resolving (non-error) result. */
|
|
112
|
+
export declare const ERROR_RESOLVE_WINDOW = 10;
|
|
57
113
|
export declare const METRICS_BUFFER_MAX = 200;
|
|
58
114
|
export declare const DAMAGE_LOOKBACK_MSGS = 15;
|
|
59
115
|
export declare const VERIFICATION_GAP_SNIPPET_LEN = 80;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,OAAO,WAAW,CAAC;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AAK,CAAC;AAOvC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAGtC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAGvC,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAG/C,eAAO,MAAM,UAAU,iBAAiB,CAAC;AACzC,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,eAAO,MAAM,sBAAsB,QAU6T,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Salient-keyword extraction for fuzzy "is this concept covered?" checks.
|
|
3
|
+
*
|
|
4
|
+
* Pure (no I/O) — lives in the domain layer so both the verify phase and the
|
|
5
|
+
* damage detector share one implementation instead of each re-deriving a
|
|
6
|
+
* "first N long words" heuristic (which picked positional noise and missed the
|
|
7
|
+
* real term further into the text).
|
|
8
|
+
*
|
|
9
|
+
* ponytail ceiling: this is still keyword/substring matching. A paraphrase
|
|
10
|
+
* ("TS" vs "TypeScript") can't be recognized — an inherent limit of the cheap
|
|
11
|
+
* proxy, not fixable without an LLM judge (which would defeat deterministic-first).
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Extract salient keyword tokens from a source string. Strips punctuation and
|
|
15
|
+
* prefers proper nouns / identifiers (capitalized or digit-bearing) over
|
|
16
|
+
* positional fillers. Returns at most `max` tokens, original case preserved
|
|
17
|
+
* (callers lower-case as needed for comparison).
|
|
18
|
+
*/
|
|
19
|
+
export declare function extractCheckKeywords(text: string, max: number): string[];
|
|
20
|
+
//# sourceMappingURL=keywords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keywords.d.ts","sourceRoot":"","sources":["../../src/domain/keywords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAQxE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name-agnostic tool classification by argument shape.
|
|
3
|
+
*
|
|
4
|
+
* Extraction used to classify tools by NAME — `hasToolHint(name, ["write",
|
|
5
|
+
* "edit", ...])` and `tc.name === "bash"`. That is a proxy: a tool is a write
|
|
6
|
+
* tool because its ARGUMENTS carry a content payload, not because its name
|
|
7
|
+
* happens to contain "write". Name matching is also churn-fragile —
|
|
8
|
+
* `read` → `hypa_read` → whatever-next silently drops off the list, and every
|
|
9
|
+
* new tool demands a code change.
|
|
10
|
+
*
|
|
11
|
+
* We classify by what the tool CARRIES, which is invariant under renaming:
|
|
12
|
+
*
|
|
13
|
+
* mutates — a path-like arg AND a content payload (write/edit/append/...)
|
|
14
|
+
* executes — a command/shell arg (bash/hypa_shell/...)
|
|
15
|
+
* accesses — a path-like arg with no payload (read/grep/find/ls)
|
|
16
|
+
* other — none of the above (ask_user, process, ...)
|
|
17
|
+
*
|
|
18
|
+
* The argument-name conventions (path/content/command) are far more stable
|
|
19
|
+
* across tools and providers than tool names, so this auto-adapts to tools
|
|
20
|
+
* this code has never seen (hypa_*, MCP tools, custom extensions) without a
|
|
21
|
+
* single name in a list.
|
|
22
|
+
*
|
|
23
|
+
* Ceiling (documented, not hidden): a DELETE cannot be told from a READ by
|
|
24
|
+
* arguments alone — both carry only a path. Callers that need deletion must
|
|
25
|
+
* resolve it from the result text. Bash-style tools that take a free-text
|
|
26
|
+
* `command` are opaque to file-path tracking by construction.
|
|
27
|
+
*
|
|
28
|
+
* Pure: no I/O, no async, no globals — lives in the domain layer alongside
|
|
29
|
+
* `summary-schema.ts`.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Extract a non-empty file-path argument from a tool call, covering common key
|
|
33
|
+
* names. Returns undefined when no usable path is present.
|
|
34
|
+
*/
|
|
35
|
+
export declare function extractToolPath(args: unknown): string | undefined;
|
|
36
|
+
export type ToolClass = "mutates" | "accesses" | "executes" | "other";
|
|
37
|
+
/**
|
|
38
|
+
* Classify a tool by its argument shape, independent of its name.
|
|
39
|
+
*
|
|
40
|
+
* Order matters: a path + payload wins as `mutates` even if a command key is
|
|
41
|
+
* also present (a write tool that logs a command is still a write). A bare
|
|
42
|
+
* command with no path is `executes`. A bare path is `accesses`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function classifyTool(args: unknown): ToolClass;
|
|
45
|
+
//# sourceMappingURL=tool-semantics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-semantics.d.ts","sourceRoot":"","sources":["../../src/domain/tool-semantics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AA4BH;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQjE;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAUrD"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,iCAAiC,CAAC;AA0EtF,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,EAAE,YAAY,QAsQ7D"}
|