@pruddiman/hem 0.0.1-beta-95d42fc → 0.0.1-beta-18c9997
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.
|
@@ -20,11 +20,20 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import type { Provider, ProviderConfig } from "./types.js";
|
|
22
22
|
/** Permission request kind from the Copilot SDK. */
|
|
23
|
-
type PermissionKind = "shell" | "write" | "mcp" | "read" | "url" | "custom-tool";
|
|
24
|
-
/**
|
|
23
|
+
type PermissionKind = "shell" | "write" | "mcp" | "read" | "url" | "custom-tool" | "memory" | "hook";
|
|
24
|
+
/**
|
|
25
|
+
* Minimal permission request shape.
|
|
26
|
+
*
|
|
27
|
+
* Mirrors the discriminated union from `@github/copilot-sdk` (defined in
|
|
28
|
+
* `generated/session-events.d.ts` as `PermissionRequest*`). The 0.3.0 SDK
|
|
29
|
+
* carries the shell command text in `fullCommandText` (not `command`); the
|
|
30
|
+
* old singular `command` field never existed in the published types, so
|
|
31
|
+
* agents were silently rejected for every `mkdir`/`touch` they tried.
|
|
32
|
+
*/
|
|
25
33
|
interface PermissionRequest {
|
|
26
34
|
kind: PermissionKind;
|
|
27
|
-
command
|
|
35
|
+
/** Present on `kind: "shell"` — the full shell command text. */
|
|
36
|
+
fullCommandText?: string;
|
|
28
37
|
[key: string]: unknown;
|
|
29
38
|
}
|
|
30
39
|
/**
|
|
@@ -326,11 +326,18 @@ export class CopilotProvider {
|
|
|
326
326
|
? { kind: "approve-once" }
|
|
327
327
|
: { kind: "reject" };
|
|
328
328
|
case "shell": {
|
|
329
|
-
const cmd = request.
|
|
329
|
+
const cmd = request.fullCommandText ?? "";
|
|
330
330
|
return agentAllowsShell(agent, cmd)
|
|
331
331
|
? { kind: "approve-once" }
|
|
332
332
|
: { kind: "reject" };
|
|
333
333
|
}
|
|
334
|
+
case "memory":
|
|
335
|
+
case "hook":
|
|
336
|
+
// Both are SDK-internal mechanisms (agent self-memory and
|
|
337
|
+
// pre/post-tool-use hook permissions). Approve so the agent can
|
|
338
|
+
// run its own lifecycle plumbing — the per-tool permissions
|
|
339
|
+
// above are what gate user-visible side effects.
|
|
340
|
+
return { kind: "approve-once" };
|
|
334
341
|
case "url":
|
|
335
342
|
return agentAllowsWebfetch(agent)
|
|
336
343
|
? { kind: "approve-once" }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pruddiman/hem",
|
|
3
|
-
"version": "0.0.1-beta-
|
|
3
|
+
"version": "0.0.1-beta-18c9997",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"hem": "./dist/index.js"
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"@github/copilot-sdk": "^0.3.0",
|
|
25
25
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
26
26
|
"@opencode-ai/sdk": "^1.14.48",
|
|
27
|
-
"@pruddiman/hem": "^0.0.1-beta-1aff12a",
|
|
28
27
|
"better-sqlite3": "^12.8.0",
|
|
29
28
|
"commander": "^14.0.3",
|
|
30
29
|
"fast-glob": "^3.3.3",
|