@danypops/pi-packed 0.19.6 → 0.19.9
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/extension/src/index.ts +1 -1
- package/extension/src/packed.ts +18 -8
- package/extension/src/{discover.ts → tabs/discover.ts} +4 -4
- package/extension/src/{resource-config.ts → tabs/resource-config.ts} +4 -4
- package/extension/src/{security-tui.ts → tabs/security-tui.ts} +2 -2
- package/extension/src/tools.ts +2 -2
- package/extension/src/tui.ts +4 -4
- package/package.json +2 -2
- /package/extension/src/{permission.ts → approval/permission.ts} +0 -0
- /package/extension/src/{reload.ts → approval/reload.ts} +0 -0
- /package/extension/src/{discover-model.ts → tabs/discover-model.ts} +0 -0
package/extension/src/index.ts
CHANGED
|
@@ -12,8 +12,8 @@ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
|
12
12
|
import { formatUpdateNotice } from "./model.js";
|
|
13
13
|
import { createNatives } from "./packed.js";
|
|
14
14
|
import { registerProfiles } from "./profile.js";
|
|
15
|
-
import { handleResourceConfigCommand } from "./resource-config.js";
|
|
16
15
|
import { handleSetupCommand } from "./setup-command.js";
|
|
16
|
+
import { handleResourceConfigCommand } from "./tabs/resource-config.js";
|
|
17
17
|
import { registerTools } from "./tools.js";
|
|
18
18
|
import { showPackedPanel } from "./tui.js";
|
|
19
19
|
|
package/extension/src/packed.ts
CHANGED
|
@@ -8,6 +8,13 @@
|
|
|
8
8
|
* the rest of the Pi session -- vehicle-client's createRetryingClient detects
|
|
9
9
|
* that on the failing call itself and reconnects, so the happy path reuses
|
|
10
10
|
* one connected client instead of reconnecting on every single operation.
|
|
11
|
+
*
|
|
12
|
+
* Reads/idempotent lookups use call() (transparent retry once on a stale
|
|
13
|
+
* connection); install/installService/remove/update/setMutationApproval/
|
|
14
|
+
* setupApply/toggleResource use callOnce() instead -- a stale connection
|
|
15
|
+
* during any of those must surface its one real failure rather than risk a
|
|
16
|
+
* silently duplicated mutation (installing/removing/updating a package
|
|
17
|
+
* twice) if the retried call actually reached the daemon the first time.
|
|
11
18
|
*/
|
|
12
19
|
|
|
13
20
|
import { ensurePackedClient, InstallServiceError, type PackedExtensionClient } from "@danypops/packed/client";
|
|
@@ -77,22 +84,25 @@ export async function createNatives(connect: PackageDaemonConnector = connectDef
|
|
|
77
84
|
const client = createRetryingClient(connect, { label: "pi-packed" });
|
|
78
85
|
|
|
79
86
|
return {
|
|
87
|
+
// Reads/idempotent lookups: transparently retried once on a stale connection.
|
|
80
88
|
search: (query, limit) => client.call((daemon) => daemon.search(query, limit)),
|
|
81
89
|
searchOffline: (query, limit) => client.call((daemon) => daemon.search(query, limit, true)),
|
|
82
90
|
info: (name) => client.call((daemon) => daemon.info(name)),
|
|
83
91
|
installed: () => client.call((daemon) => daemon.installed()),
|
|
84
92
|
updates: () => client.call((daemon) => daemon.updates()),
|
|
85
93
|
security: () => client.call((daemon) => daemon.security()),
|
|
86
|
-
setMutationApproval: (value, approved) => client.call((daemon) => daemon.setMutationApproval(value, approved)),
|
|
87
|
-
install: (source, approved) => client.call((daemon) => daemon.install(source, approved)),
|
|
88
|
-
installService: (source, approved) => client.call((daemon) => daemon.installService(source, approved)),
|
|
89
|
-
remove: (name, approved) => client.call((daemon) => daemon.remove(name, approved)),
|
|
90
|
-
update: (source, approved) => client.call((daemon) => daemon.update(source, approved)),
|
|
91
94
|
setupPlan: (manifestPath, prune) => client.call((daemon) => daemon.setupPlan(manifestPath, prune)),
|
|
92
|
-
setupApply: (manifestPath, approved, prune) => client.call((daemon) => daemon.setupApply(manifestPath, approved, prune)),
|
|
93
95
|
listResources: (projectRoot) => client.call((daemon) => daemon.listResources(projectRoot)),
|
|
94
|
-
toggleResource: (source, field, path, enabled, projectRoot, approved) =>
|
|
95
|
-
client.call((daemon) => daemon.toggleResource(source, field, path, enabled, projectRoot, approved)),
|
|
96
96
|
piStatus: () => client.call((daemon) => daemon.piStatus()),
|
|
97
|
+
// Mutations: never transparently retried -- a stale connection surfaces its one
|
|
98
|
+
// real failure instead of risking a silently duplicated install/remove/update.
|
|
99
|
+
setMutationApproval: (value, approved) => client.callOnce((daemon) => daemon.setMutationApproval(value, approved)),
|
|
100
|
+
install: (source, approved) => client.callOnce((daemon) => daemon.install(source, approved)),
|
|
101
|
+
installService: (source, approved) => client.callOnce((daemon) => daemon.installService(source, approved)),
|
|
102
|
+
remove: (name, approved) => client.callOnce((daemon) => daemon.remove(name, approved)),
|
|
103
|
+
update: (source, approved) => client.callOnce((daemon) => daemon.update(source, approved)),
|
|
104
|
+
setupApply: (manifestPath, approved, prune) => client.callOnce((daemon) => daemon.setupApply(manifestPath, approved, prune)),
|
|
105
|
+
toggleResource: (source, field, path, enabled, projectRoot, approved) =>
|
|
106
|
+
client.callOnce((daemon) => daemon.toggleResource(source, field, path, enabled, projectRoot, approved)),
|
|
97
107
|
};
|
|
98
108
|
}
|
|
@@ -13,11 +13,11 @@ import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
|
13
13
|
import { rawKeyHint } from "@earendil-works/pi-coding-agent";
|
|
14
14
|
import { Input, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
15
15
|
import type { Component } from "malevich-tui-components";
|
|
16
|
+
import type { Natives, PackageSummary } from "../packed.js";
|
|
17
|
+
import { InstallServiceError } from "../packed.js";
|
|
18
|
+
import type { TabHost } from "../tab-host.js";
|
|
19
|
+
import { approvePackageOperation } from "../tools.js";
|
|
16
20
|
import { shouldSearch } from "./discover-model.js";
|
|
17
|
-
import type { Natives, PackageSummary } from "./packed.js";
|
|
18
|
-
import { InstallServiceError } from "./packed.js";
|
|
19
|
-
import type { TabHost } from "./tab-host.js";
|
|
20
|
-
import { approvePackageOperation } from "./tools.js";
|
|
21
21
|
|
|
22
22
|
const SEARCH_LIMIT = 20;
|
|
23
23
|
|
|
@@ -17,10 +17,10 @@ import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
|
17
17
|
import { rawKeyHint } from "@earendil-works/pi-coding-agent";
|
|
18
18
|
import { Input, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
19
19
|
import type { Component } from "malevich-tui-components";
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import type { TabHost } from "
|
|
20
|
+
import { packagePermissionDecision } from "../approval/permission.js";
|
|
21
|
+
import { confirmReload } from "../approval/reload.js";
|
|
22
|
+
import type { Natives, PackageResources, ResourceField } from "../packed.js";
|
|
23
|
+
import type { TabHost } from "../tab-host.js";
|
|
24
24
|
|
|
25
25
|
type Scope = "global" | "project";
|
|
26
26
|
const RESOURCE_FIELDS = ["extensions", "skills", "prompts", "themes"] as const satisfies readonly ResourceField[];
|
|
@@ -15,8 +15,8 @@ import type { Component } from "malevich-tui-components";
|
|
|
15
15
|
|
|
16
16
|
type MutationApproval = SecuritySettings["mutationApproval"];
|
|
17
17
|
|
|
18
|
-
import type { Natives } from "
|
|
19
|
-
import type { TabHost } from "
|
|
18
|
+
import type { Natives } from "../packed.ts";
|
|
19
|
+
import type { TabHost } from "../tab-host.ts";
|
|
20
20
|
|
|
21
21
|
const OPTIONS: Array<{ value: MutationApproval; label: string }> = [
|
|
22
22
|
{ value: "always", label: "Always require mutation approval (recommended)" },
|
package/extension/src/tools.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** Agent-facing package tools over the authenticated daemon. */
|
|
2
2
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { Type } from "typebox";
|
|
4
|
+
import { type PackageOperation, packagePermissionDecision } from "./approval/permission.js";
|
|
5
|
+
import { reloadWarning } from "./approval/reload.js";
|
|
4
6
|
import { InstallServiceError, type Natives, PI_COMMAND_NAME } from "./packed.js";
|
|
5
|
-
import { type PackageOperation, packagePermissionDecision } from "./permission.js";
|
|
6
|
-
import { reloadWarning } from "./reload.js";
|
|
7
7
|
import {
|
|
8
8
|
createInfoDetails,
|
|
9
9
|
createModelContent,
|
package/extension/src/tui.ts
CHANGED
|
@@ -58,15 +58,15 @@ import {
|
|
|
58
58
|
Table,
|
|
59
59
|
type TextMeasure,
|
|
60
60
|
} from "malevich-tui-components";
|
|
61
|
-
import {
|
|
61
|
+
import { confirmReload } from "./approval/reload.js";
|
|
62
62
|
import { dialogTheme, menuTheme, tabBarTheme } from "./menu-theme.js";
|
|
63
63
|
import type { Row, ViewMode } from "./model.js";
|
|
64
64
|
import { filterRows, mergeRows, nextMode, visibleRows } from "./model.js";
|
|
65
65
|
import type { Natives, PackageResources } from "./packed.js";
|
|
66
|
-
import { confirmReload } from "./reload.js";
|
|
67
|
-
import { applyResourceToggle, ConfigTab } from "./resource-config.js";
|
|
68
|
-
import { SettingsTab } from "./security-tui.js";
|
|
69
66
|
import type { TabHost } from "./tab-host.js";
|
|
67
|
+
import { createFindTab } from "./tabs/discover.js";
|
|
68
|
+
import { applyResourceToggle, ConfigTab } from "./tabs/resource-config.js";
|
|
69
|
+
import { SettingsTab } from "./tabs/security-tui.js";
|
|
70
70
|
import { approvePackageOperation } from "./tools.js";
|
|
71
71
|
|
|
72
72
|
export type PackedTabKey = "packages" | "find" | "config" | "settings";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danypops/pi-packed",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.9",
|
|
4
4
|
"description": "Pi package tools, commands, profiles, and TUI for the Packed daemon",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": ["pi-package"],
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@danypops/packed": "^0.5.0",
|
|
16
|
-
"@danypops/vehicle-client": "^0.
|
|
16
|
+
"@danypops/vehicle-client": "^0.2.0",
|
|
17
17
|
"@danypops/vehicle-client-pi": "^0.1.5",
|
|
18
18
|
"malevich-tui-components": "^0.16.1"
|
|
19
19
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|