@piagent/platform 1.37.1 → 1.38.2
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 +60 -0
- package/README.md +5 -3
- package/README.vi.md +2 -2
- package/catalog/capabilities.json +2 -2
- package/docs/command-reference-vietnamese.md +4 -3
- package/docs/distribution-standard.md +6 -6
- package/docs/en/maintainer-guide.md +8 -0
- package/docs/en/workspace-editor.md +222 -0
- package/docs/languages.json +13 -4
- package/docs/operator-manual-vietnamese.md +7 -7
- package/docs/publishing-for-teams.md +3 -0
- package/docs/release-install-policy.md +2 -2
- package/docs/research/ide-m0-spike.md +101 -0
- package/docs/team-onboarding.md +2 -2
- package/docs/vi/maintainer-guide.md +8 -0
- package/docs/vi/workspace-editor.md +217 -0
- package/docs-site/architecture.html +1 -1
- package/docs-site/benchmark.html +1 -1
- package/docs-site/commands.html +1 -1
- package/docs-site/content/en/index.html +4 -4
- package/docs-site/content/en/whats-new.html +23 -0
- package/docs-site/content/index.html +4 -4
- package/docs-site/content/whats-new.html +23 -0
- package/docs-site/context-engine.html +1 -1
- package/docs-site/ecosystem.html +1 -1
- package/docs-site/en/architecture.html +1 -1
- package/docs-site/en/benchmark.html +1 -1
- package/docs-site/en/commands.html +1 -1
- package/docs-site/en/context-engine.html +1 -1
- package/docs-site/en/ecosystem.html +1 -1
- package/docs-site/en/index.html +5 -5
- package/docs-site/en/mcp-approval.html +1 -1
- package/docs-site/en/mcp-auth.html +1 -1
- package/docs-site/en/mcp-servers.html +1 -1
- package/docs-site/en/mcp.html +1 -1
- package/docs-site/en/permissions.html +1 -1
- package/docs-site/en/profiles.html +1 -1
- package/docs-site/en/quickstart.html +1 -1
- package/docs-site/en/runtime.html +1 -1
- package/docs-site/en/scope.html +1 -1
- package/docs-site/en/security.html +1 -1
- package/docs-site/en/team.html +1 -1
- package/docs-site/en/whats-new.html +24 -1
- package/docs-site/en/windows.html +1 -1
- package/docs-site/en/workflows.html +1 -1
- package/docs-site/index.html +5 -5
- package/docs-site/mcp-approval.html +1 -1
- package/docs-site/mcp-auth.html +1 -1
- package/docs-site/mcp-servers.html +1 -1
- package/docs-site/mcp.html +1 -1
- package/docs-site/permissions.html +1 -1
- package/docs-site/profiles.html +1 -1
- package/docs-site/quickstart.html +1 -1
- package/docs-site/runtime.html +1 -1
- package/docs-site/scope.html +1 -1
- package/docs-site/security.html +1 -1
- package/docs-site/team.html +1 -1
- package/docs-site/whats-new.html +24 -1
- package/docs-site/windows.html +1 -1
- package/docs-site/workflows.html +1 -1
- package/evals/fixtures/piagent-webui/checkpoint-v1.invalid.json +21 -0
- package/evals/fixtures/piagent-webui/checkpoint-v1.valid.json +20 -0
- package/evals/fixtures/piagent-webui/terminal-v1.invalid.json +17 -0
- package/evals/fixtures/piagent-webui/terminal-v1.valid.json +16 -0
- package/evals/fixtures/piagent-webui/workspace-file-v1.invalid.json +24 -0
- package/evals/fixtures/piagent-webui/workspace-file-v1.valid.json +23 -0
- package/evals/fixtures/piagent-webui/workspace-paths-v1.invalid.json +24 -0
- package/evals/fixtures/piagent-webui/workspace-paths-v1.valid.json +24 -0
- package/evals/fixtures/piagent-webui/workspace-search-v1.invalid.json +26 -0
- package/evals/fixtures/piagent-webui/workspace-search-v1.valid.json +26 -0
- package/evals/fixtures/piagent-webui/workspace-tree-v1.invalid.json +28 -0
- package/evals/fixtures/piagent-webui/workspace-tree-v1.valid.json +27 -0
- package/evals/fixtures/piagent-webui/workspace-write-v1.invalid.json +19 -0
- package/evals/fixtures/piagent-webui/workspace-write-v1.valid.json +19 -0
- package/evals/long-task-soak-v1/README.md +17 -0
- package/evals/long-task-soak-v1/lib/session-loop.mjs +19 -3
- package/evals/long-task-soak-v1/scenarios/ide-editor-terminal.json +19 -0
- package/evals/long-task-soak-v1/surfaces/webui-gateway.mjs +17 -2
- package/evals/long-task-soak-v1/surfaces/workspace-actions.mjs +95 -0
- package/evals/private-holdout-v1/public-exposure.v2.json +2 -2
- package/package.json +7 -3
- package/packages/piagent-core/extensions/fallback-base-policy.ts +1 -1
- package/packages/piagent-core/extensions/guard-types.ts +3 -1
- package/packages/piagent-core/extensions/path-suggestions.ts +137 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +85 -7
- package/packages/piagent-core/extensions/workspace-inspection.ts +145 -0
- package/packages/piagent-core/extensions/workspace-policy.d.ts +7 -0
- package/packages/piagent-core/extensions/workspace-policy.js +3 -0
- package/packages/piagent-core/extensions/workspace-search-index.mjs +8 -0
- package/packages/piagent-core/extensions/workspace-search.ts +74 -0
- package/packages/piagent-core/extensions/workspace-write.ts +116 -0
- package/packages/piagent-core/managed/background-process.mjs +9 -4
- package/packages/piagent-core/managed/boundary-package-proxy.mjs +21 -0
- package/packages/piagent-core/managed/boundary-queue.mjs +24 -0
- package/packages/piagent-core/managed/checkpoint-git.mjs +16 -0
- package/packages/piagent-core/managed/checkpoints.mjs +17 -64
- package/packages/piagent-core/managed/command-tools.mjs +6 -6
- package/packages/piagent-core/managed/continuation.mjs +3 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/backend-api/profile.json +88 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/be-readonly-fe/profile.json +130 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/data/profile.json +88 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/devops/profile.json +90 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/docs/profile.json +74 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/fullstack/profile.json +92 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/generic/profile.json +95 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/mobile/profile.json +86 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/node-typescript/profile.json +74 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/python/profile.json +75 -0
- package/packages/piagent-core/managed/dist/workspace/assets/adapters/web-frontend/profile.json +99 -0
- package/packages/piagent-core/managed/dist/workspace/assets/local-state-path-BrmghxEZ.js +284 -0
- package/packages/piagent-core/managed/dist/workspace/assets/packages/piagent-core/policies/base-policy.json +351 -0
- package/packages/piagent-core/managed/dist/workspace/manifest.json +65 -0
- package/packages/piagent-core/managed/dist/workspace/worker.mjs +7374 -0
- package/packages/piagent-core/managed/dist/workspace/workspace-search-index.mjs +1007 -0
- package/packages/piagent-core/managed/patch-snapshot.mjs +6 -8
- package/packages/piagent-core/managed/permission.mjs +29 -6
- package/packages/piagent-core/managed/repository-operation.mjs +2 -1
- package/packages/piagent-core/managed/review-snapshot-request.mjs +21 -0
- package/packages/piagent-core/managed/sandbox-diagnostic.mjs +2 -0
- package/packages/piagent-core/managed/session-mutation-observations.mjs +37 -0
- package/packages/piagent-core/managed/session.mjs +2 -2
- package/packages/piagent-core/managed/source-revert-requests.mjs +21 -0
- package/packages/piagent-core/managed/terminal-boundary.mjs +88 -0
- package/packages/piagent-core/managed/terminal-channel.mjs +66 -0
- package/packages/piagent-core/managed/terminal-runtime.mjs +64 -0
- package/packages/piagent-core/managed/terminal-seatbelt.mjs +48 -0
- package/packages/piagent-core/managed/terminal-worker.mjs +70 -0
- package/packages/piagent-core/managed/tool-boundary.mjs +45 -35
- package/packages/piagent-core/managed/tool-freshness.mjs +47 -0
- package/packages/piagent-core/managed/tool-worker.mjs +18 -3
- package/packages/piagent-core/managed/workspace-worker-pins.mjs +26 -0
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-core/policies/base-policy.json +2 -1
- package/packages/piagent-core/runtime/checkpoints/checkpoint-authority.ts +43 -0
- package/packages/piagent-core/runtime/checkpoints/checkpoint-refs.mjs +51 -0
- package/packages/piagent-core/runtime/checkpoints/checkpoint-store.mjs +179 -0
- package/packages/piagent-core/runtime/checkpoints/checkpoint-worker.ts +28 -0
- package/packages/piagent-core/runtime/checkpoints/git-adapter.mjs +36 -0
- package/packages/piagent-core/runtime/checkpoints/persistent-history.mjs +96 -0
- package/packages/piagent-core/runtime/checkpoints/personal-git.ts +272 -0
- package/packages/piagent-core/runtime/checkpoints/personal-runtime.ts +158 -0
- package/packages/piagent-core/runtime/checkpoints/prune.mjs +29 -0
- package/packages/piagent-core/runtime/checkpoints/restore-preview.mjs +46 -0
- package/packages/piagent-core/runtime/checkpoints/turn-checkpoints.mjs +167 -0
- package/packages/piagent-core/runtime/hooks/session-hooks.ts +19 -16
- package/packages/piagent-core/runtime/hooks/session-start-hook.ts +3 -0
- package/packages/piagent-core/runtime/hooks/tool-call-hook.ts +2 -2
- package/packages/piagent-core/runtime/inspection/diff-projection.ts +2 -1
- package/packages/piagent-core/runtime/inspection/managed-source-revert.ts +90 -0
- package/packages/piagent-core/runtime/inspection/review-state-projection.ts +19 -8
- package/packages/piagent-core/runtime/inspection/session-diff-projection.ts +47 -0
- package/packages/piagent-core/runtime/inspection/session-hunk-provenance.ts +56 -0
- package/packages/piagent-core/runtime/inspection/session-mutation-observer.ts +125 -0
- package/packages/piagent-core/runtime/inspection/source-action-contract.ts +123 -0
- package/packages/piagent-core/runtime/inspection/source-change-projection.ts +3 -9
- package/packages/piagent-core/runtime/inspection/source-mutation-projection.ts +3 -41
- package/packages/piagent-core/runtime/inspection/source-mutation-store.ts +6 -36
- package/packages/piagent-core/runtime/inspection/source-revert-projection.ts +36 -30
- package/packages/piagent-core/runtime/inspection/text-diff.ts +5 -4
- package/packages/piagent-core/runtime/inspection/workspace-worker.ts +79 -0
- package/packages/piagent-core/runtime/policy/source-index-transaction.ts +3 -10
- package/packages/piagent-core/runtime/policy/source-mutation-guard-binding.ts +27 -2
- package/packages/piagent-core/runtime/policy/source-mutation-guard.ts +42 -12
- package/packages/piagent-core/runtime/policy/source-worktree-transaction.ts +10 -5
- package/packages/piagent-core/runtime/policy/workspace-write-authority.ts +51 -0
- package/packages/piagent-core/runtime/process-owner.mjs +20 -0
- package/packages/piagent-core/runtime/process-tree-watch.mjs +46 -0
- package/packages/piagent-core/runtime/quality/model-mutation-proof.ts +8 -5
- package/packages/piagent-core/runtime/registration/permission-commands.ts +10 -2
- package/packages/piagent-core/runtime/registration/task-evidence-tools.ts +1 -1
- package/packages/piagent-core/runtime/session/workspace-member-edits.d.mts +7 -0
- package/packages/piagent-core/runtime/session/workspace-member-edits.mjs +41 -0
- package/packages/piagent-core/security/workspace-file-reader.ts +2 -1
- package/packages/piagent-webui/dist/client/assets/Alert-DGWhP2MM.js +1 -0
- package/packages/piagent-webui/dist/client/assets/Button-QItfZUNj.js +1 -0
- package/packages/piagent-webui/dist/client/assets/DialogTitle-CyaFPaiW.js +3 -0
- package/packages/piagent-webui/dist/client/assets/MarkdownMessage-DtEwqme0.js +29 -0
- package/packages/piagent-webui/dist/client/assets/TerminalPanel-C3vkzjQ6.js +2 -0
- package/packages/piagent-webui/dist/client/assets/TerminalView-TNjhBGfa.js +9 -0
- package/packages/piagent-webui/dist/client/assets/TerminalView-kHJ-D0s7.css +1 -0
- package/packages/piagent-webui/dist/client/assets/Typography-B9om7Evq.js +1 -0
- package/packages/piagent-webui/dist/client/assets/WorkspaceCodeEditor-BAhYwQNM.js +2 -0
- package/packages/piagent-webui/dist/client/assets/WorkspaceExplorer-Coh_GWCO.js +5 -0
- package/packages/piagent-webui/dist/client/assets/WorkspaceQuickOpen-Bn4miZq4.js +1 -0
- package/packages/piagent-webui/dist/client/assets/bootstrap-CedkNtRG.js +1 -0
- package/packages/piagent-webui/dist/client/assets/dist-B5MCHZv5.js +9 -0
- package/packages/piagent-webui/dist/client/assets/dist-BM_LL1o9.js +1 -0
- package/packages/piagent-webui/dist/client/assets/dist-C2TMLUTo.js +23 -0
- package/packages/piagent-webui/dist/client/assets/dist-CqL3udNu.js +1 -0
- package/packages/piagent-webui/dist/client/assets/dist-D4df0jLQ.js +1 -0
- package/packages/piagent-webui/dist/client/assets/dist-D6i5SpQu.js +10 -0
- package/packages/piagent-webui/dist/client/assets/dist-DfjUS8LS.js +6 -0
- package/packages/piagent-webui/dist/client/assets/dist-IRUjhd1P.js +1 -0
- package/packages/piagent-webui/dist/client/assets/dist-sNhoSseW.js +1 -0
- package/packages/piagent-webui/dist/client/assets/index-Brs_HjIo.css +1 -0
- package/packages/piagent-webui/dist/client/assets/index-a-perpOX.js +102 -0
- package/packages/piagent-webui/dist/client/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/packages/piagent-webui/dist/client/assets/tab-close-nAxrK7Lq.js +1 -0
- package/packages/piagent-webui/dist/client/assets/ui-preferences-BO3AV7QE.js +10 -0
- package/packages/piagent-webui/dist/client/assets/useId-DEefKUAT.js +124 -0
- package/packages/piagent-webui/dist/client/assets/workspace-api-O7auv_td.js +1 -0
- package/packages/piagent-webui/dist/client/index.html +10 -2
- package/packages/piagent-webui/extension/same-session-bridge.ts +2 -3
- package/packages/piagent-webui/extension/source-revert-controller.ts +14 -208
- package/packages/piagent-webui/gateway/checkpoint-sessions.ts +99 -0
- package/packages/piagent-webui/gateway/checkpoint-store.ts +6 -0
- package/packages/piagent-webui/gateway/company-relay.ts +5 -0
- package/packages/piagent-webui/gateway/company-terminal-cache.ts +54 -0
- package/packages/piagent-webui/gateway/company-terminal-channel.ts +117 -0
- package/packages/piagent-webui/gateway/company-terminal-relay.ts +75 -0
- package/packages/piagent-webui/gateway/gateway-protocol-service.ts +12 -0
- package/packages/piagent-webui/gateway/gateway-service.ts +48 -4
- package/packages/piagent-webui/gateway/managed-gateway.mjs +30 -3
- package/packages/piagent-webui/gateway/managed-projection.ts +5 -3
- package/packages/piagent-webui/gateway/managed-source-revert-controller.ts +45 -0
- package/packages/piagent-webui/gateway/managed-source-revert-sessions.ts +74 -0
- package/packages/piagent-webui/gateway/managed-terminal-binding.ts +30 -0
- package/packages/piagent-webui/gateway/managed-terminal-processes.ts +74 -0
- package/packages/piagent-webui/gateway/managed-terminal-sessions.ts +9 -0
- package/packages/piagent-webui/gateway/path-suggestions.ts +1 -124
- package/packages/piagent-webui/gateway/personal-terminal-binding.ts +36 -0
- package/packages/piagent-webui/gateway/personal-terminal-diagnostic.mjs +16 -0
- package/packages/piagent-webui/gateway/personal-terminal-processes.ts +119 -0
- package/packages/piagent-webui/gateway/personal-terminal-sessions.ts +22 -0
- package/packages/piagent-webui/gateway/runtime-session-controls.ts +2 -1
- package/packages/piagent-webui/gateway/session-catalog.ts +3 -2
- package/packages/piagent-webui/gateway/session-command-controller.ts +4 -4
- package/packages/piagent-webui/gateway/session-inspection-registry.ts +29 -5
- package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +8 -8
- package/packages/piagent-webui/gateway/signed-session-journal.ts +77 -0
- package/packages/piagent-webui/gateway/source-revert-sessions.ts +74 -0
- package/packages/piagent-webui/gateway/source-revert-store.ts +47 -0
- package/packages/piagent-webui/gateway/terminal-command-ledger.ts +33 -0
- package/packages/piagent-webui/gateway/terminal-mentions.ts +29 -0
- package/packages/piagent-webui/gateway/terminal-output-buffer.ts +58 -0
- package/packages/piagent-webui/gateway/terminal-router.ts +12 -0
- package/packages/piagent-webui/gateway/terminal-sessions.ts +247 -0
- package/packages/piagent-webui/gateway/workspace-write-sessions.ts +69 -0
- package/packages/piagent-webui/gateway/workspace-write-store.ts +6 -0
- package/packages/piagent-webui/package.json +15 -2
- package/packages/piagent-webui/server/checkpoint-command.ts +30 -0
- package/packages/piagent-webui/server/checkpoint-controller.ts +87 -0
- package/packages/piagent-webui/server/checkpoint-routes.ts +38 -0
- package/packages/piagent-webui/server/control-command-digest.ts +5 -0
- package/packages/piagent-webui/server/core-inspection-provider.ts +16 -22
- package/packages/piagent-webui/server/gateway-websocket.ts +36 -8
- package/packages/piagent-webui/server/loopback-server.ts +9 -0
- package/packages/piagent-webui/server/read-model-provider.ts +3 -0
- package/packages/piagent-webui/server/read-only-router.ts +3 -0
- package/packages/piagent-webui/server/session-auth.ts +4 -1
- package/packages/piagent-webui/server/session-source-revert-routes.ts +54 -0
- package/packages/piagent-webui/server/source-projection-binding.ts +18 -0
- package/packages/piagent-webui/server/source-revert-controller.ts +225 -0
- package/packages/piagent-webui/server/terminal-command.ts +35 -0
- package/packages/piagent-webui/server/terminal-websocket-stream.ts +56 -0
- package/packages/piagent-webui/server/transcript-projection.ts +2 -1
- package/packages/piagent-webui/server/workspace-read-routes.ts +32 -0
- package/packages/piagent-webui/server/workspace-reader.ts +23 -0
- package/packages/piagent-webui/server/workspace-write-controller.ts +118 -0
- package/packages/piagent-webui/server/workspace-write-routes.ts +38 -0
- package/packages/piagent-webui/shared/terminal-message.ts +23 -0
- package/schemas/piagent-webui/catalog-v1.json +63 -0
- package/schemas/piagent-webui/checkpoint-v1.schema.json +466 -0
- package/schemas/piagent-webui/control-command-v1.schema.json +68 -3
- package/schemas/piagent-webui/diff-v1.schema.json +4 -0
- package/schemas/piagent-webui/gateway-protocol-v1.schema.json +123 -3
- package/schemas/piagent-webui/session-catalog-v1.schema.json +1 -1
- package/schemas/piagent-webui/session-command-v1.schema.json +1 -1
- package/schemas/piagent-webui/snapshot-v1.schema.json +2 -1
- package/schemas/piagent-webui/source-revert-v1.schema.json +22 -3
- package/schemas/piagent-webui/terminal-v1.schema.json +495 -0
- package/schemas/piagent-webui/workspace-file-v1.schema.json +79 -0
- package/schemas/piagent-webui/workspace-paths-v1.schema.json +71 -0
- package/schemas/piagent-webui/workspace-search-v1.schema.json +80 -0
- package/schemas/piagent-webui/workspace-tree-v1.schema.json +87 -0
- package/schemas/piagent-webui/workspace-write-v1.schema.json +276 -0
- package/schemas/project-profile.schema.json +8 -3
- package/scripts/company-terminal.mjs +16 -11
- package/scripts/pi-auto.sh +5 -1
- package/scripts/team-doctor.sh +8 -0
- package/packages/piagent-webui/dist/client/assets/MarkdownMessage-CfgyQQbW.js +0 -29
- package/packages/piagent-webui/dist/client/assets/index-HyzWKvDu.js +0 -234
- package/packages/piagent-webui/dist/client/assets/index-_0nGP2n3.css +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://piagent.io.vn/schemas/piagent-webui/workspace-search-v1.schema.json",
|
|
4
|
+
"title": "Piagent WebUI workspace search v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schemaVersion",
|
|
9
|
+
"version",
|
|
10
|
+
"generatedAt",
|
|
11
|
+
"identity",
|
|
12
|
+
"query",
|
|
13
|
+
"truncated",
|
|
14
|
+
"available",
|
|
15
|
+
"backend",
|
|
16
|
+
"matches"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"schemaVersion": {
|
|
20
|
+
"const": 1
|
|
21
|
+
},
|
|
22
|
+
"version": {
|
|
23
|
+
"const": "piagent-webui-workspace-search-v1"
|
|
24
|
+
},
|
|
25
|
+
"generatedAt": {
|
|
26
|
+
"$ref": "common-v1.schema.json#/$defs/timestamp"
|
|
27
|
+
},
|
|
28
|
+
"identity": {
|
|
29
|
+
"$ref": "common-v1.schema.json#/$defs/identity"
|
|
30
|
+
},
|
|
31
|
+
"query": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"maxLength": 512
|
|
34
|
+
},
|
|
35
|
+
"truncated": {
|
|
36
|
+
"type": "boolean"
|
|
37
|
+
},
|
|
38
|
+
"available": {
|
|
39
|
+
"type": "boolean"
|
|
40
|
+
},
|
|
41
|
+
"backend": {
|
|
42
|
+
"enum": [
|
|
43
|
+
"ripgrep",
|
|
44
|
+
"fts"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"matches": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"maxItems": 100,
|
|
50
|
+
"items": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"required": [
|
|
54
|
+
"path",
|
|
55
|
+
"line",
|
|
56
|
+
"column",
|
|
57
|
+
"preview"
|
|
58
|
+
],
|
|
59
|
+
"properties": {
|
|
60
|
+
"path": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"maxLength": 4096
|
|
63
|
+
},
|
|
64
|
+
"line": {
|
|
65
|
+
"type": "integer",
|
|
66
|
+
"minimum": 1
|
|
67
|
+
},
|
|
68
|
+
"column": {
|
|
69
|
+
"type": "integer",
|
|
70
|
+
"minimum": 1
|
|
71
|
+
},
|
|
72
|
+
"preview": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"maxLength": 400
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://piagent.io.vn/schemas/piagent-webui/workspace-tree-v1.schema.json",
|
|
4
|
+
"title": "Piagent WebUI workspace tree v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schemaVersion",
|
|
9
|
+
"version",
|
|
10
|
+
"generatedAt",
|
|
11
|
+
"identity",
|
|
12
|
+
"path",
|
|
13
|
+
"entries",
|
|
14
|
+
"truncated",
|
|
15
|
+
"source"
|
|
16
|
+
],
|
|
17
|
+
"properties": {
|
|
18
|
+
"schemaVersion": {
|
|
19
|
+
"const": 1
|
|
20
|
+
},
|
|
21
|
+
"version": {
|
|
22
|
+
"const": "piagent-webui-workspace-tree-v1"
|
|
23
|
+
},
|
|
24
|
+
"generatedAt": {
|
|
25
|
+
"$ref": "common-v1.schema.json#/$defs/timestamp"
|
|
26
|
+
},
|
|
27
|
+
"identity": {
|
|
28
|
+
"$ref": "common-v1.schema.json#/$defs/identity"
|
|
29
|
+
},
|
|
30
|
+
"path": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"maxLength": 4096
|
|
33
|
+
},
|
|
34
|
+
"entries": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"maxItems": 1000,
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"required": [
|
|
41
|
+
"name",
|
|
42
|
+
"path",
|
|
43
|
+
"kind",
|
|
44
|
+
"protected",
|
|
45
|
+
"readOnly",
|
|
46
|
+
"ignored"
|
|
47
|
+
],
|
|
48
|
+
"properties": {
|
|
49
|
+
"name": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"maxLength": 255
|
|
52
|
+
},
|
|
53
|
+
"path": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"maxLength": 4096
|
|
56
|
+
},
|
|
57
|
+
"kind": {
|
|
58
|
+
"enum": [
|
|
59
|
+
"file",
|
|
60
|
+
"directory",
|
|
61
|
+
"symlink",
|
|
62
|
+
"other"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"protected": {
|
|
66
|
+
"type": "boolean"
|
|
67
|
+
},
|
|
68
|
+
"readOnly": {
|
|
69
|
+
"type": "boolean"
|
|
70
|
+
},
|
|
71
|
+
"ignored": {
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"truncated": {
|
|
78
|
+
"type": "boolean"
|
|
79
|
+
},
|
|
80
|
+
"source": {
|
|
81
|
+
"enum": [
|
|
82
|
+
"git",
|
|
83
|
+
"directory"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://piagent.io.vn/schemas/piagent-webui/workspace-write-v1.schema.json",
|
|
4
|
+
"title": "Piagent WebUI workspace write v1",
|
|
5
|
+
"oneOf": [
|
|
6
|
+
{
|
|
7
|
+
"$ref": "#/$defs/state"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"$ref": "#/$defs/command"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"$ref": "#/$defs/receipt"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"$defs": {
|
|
17
|
+
"state": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"additionalProperties": false,
|
|
20
|
+
"required": [
|
|
21
|
+
"schemaVersion",
|
|
22
|
+
"version",
|
|
23
|
+
"messageType",
|
|
24
|
+
"identity",
|
|
25
|
+
"revisions",
|
|
26
|
+
"writable",
|
|
27
|
+
"agentRunning"
|
|
28
|
+
],
|
|
29
|
+
"properties": {
|
|
30
|
+
"schemaVersion": {
|
|
31
|
+
"const": 1
|
|
32
|
+
},
|
|
33
|
+
"version": {
|
|
34
|
+
"const": "piagent-webui-workspace-write-v1"
|
|
35
|
+
},
|
|
36
|
+
"messageType": {
|
|
37
|
+
"const": "state"
|
|
38
|
+
},
|
|
39
|
+
"identity": {
|
|
40
|
+
"$ref": "common-v1.schema.json#/$defs/identity"
|
|
41
|
+
},
|
|
42
|
+
"revisions": {
|
|
43
|
+
"$ref": "#/$defs/revisions"
|
|
44
|
+
},
|
|
45
|
+
"writable": {
|
|
46
|
+
"type": "boolean"
|
|
47
|
+
},
|
|
48
|
+
"agentRunning": {
|
|
49
|
+
"type": "boolean"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"title": "Workspace write state"
|
|
53
|
+
},
|
|
54
|
+
"command": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"required": [
|
|
58
|
+
"schemaVersion",
|
|
59
|
+
"version",
|
|
60
|
+
"messageType",
|
|
61
|
+
"commandId",
|
|
62
|
+
"idempotencyKey",
|
|
63
|
+
"requestedAt",
|
|
64
|
+
"expiresAt",
|
|
65
|
+
"action",
|
|
66
|
+
"actionDigest",
|
|
67
|
+
"identity",
|
|
68
|
+
"expectedRevisions",
|
|
69
|
+
"payload"
|
|
70
|
+
],
|
|
71
|
+
"properties": {
|
|
72
|
+
"schemaVersion": {
|
|
73
|
+
"const": 1
|
|
74
|
+
},
|
|
75
|
+
"version": {
|
|
76
|
+
"const": "piagent-webui-workspace-write-v1"
|
|
77
|
+
},
|
|
78
|
+
"messageType": {
|
|
79
|
+
"const": "command"
|
|
80
|
+
},
|
|
81
|
+
"commandId": {
|
|
82
|
+
"$ref": "common-v1.schema.json#/$defs/opaqueRef"
|
|
83
|
+
},
|
|
84
|
+
"idempotencyKey": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"pattern": "^[A-Za-z0-9._~-]{32,128}$"
|
|
87
|
+
},
|
|
88
|
+
"requestedAt": {
|
|
89
|
+
"$ref": "common-v1.schema.json#/$defs/timestamp"
|
|
90
|
+
},
|
|
91
|
+
"expiresAt": {
|
|
92
|
+
"$ref": "common-v1.schema.json#/$defs/timestamp"
|
|
93
|
+
},
|
|
94
|
+
"action": {
|
|
95
|
+
"const": "workspace.write"
|
|
96
|
+
},
|
|
97
|
+
"actionDigest": {
|
|
98
|
+
"$ref": "common-v1.schema.json#/$defs/digest"
|
|
99
|
+
},
|
|
100
|
+
"identity": {
|
|
101
|
+
"$ref": "common-v1.schema.json#/$defs/identity"
|
|
102
|
+
},
|
|
103
|
+
"expectedRevisions": {
|
|
104
|
+
"$ref": "#/$defs/revisions"
|
|
105
|
+
},
|
|
106
|
+
"payload": {
|
|
107
|
+
"$ref": "#/$defs/payload"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"title": "Workspace write command"
|
|
111
|
+
},
|
|
112
|
+
"receipt": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"additionalProperties": false,
|
|
115
|
+
"required": [
|
|
116
|
+
"schemaVersion",
|
|
117
|
+
"version",
|
|
118
|
+
"messageType",
|
|
119
|
+
"commandId",
|
|
120
|
+
"idempotencyKeyDigest",
|
|
121
|
+
"action",
|
|
122
|
+
"actionDigest",
|
|
123
|
+
"identity",
|
|
124
|
+
"phase",
|
|
125
|
+
"resultCode",
|
|
126
|
+
"requestedAt",
|
|
127
|
+
"settledAt",
|
|
128
|
+
"observedRevisionsBefore",
|
|
129
|
+
"observedRevisionsAfter",
|
|
130
|
+
"path",
|
|
131
|
+
"digest",
|
|
132
|
+
"currentDigest",
|
|
133
|
+
"deduplicated"
|
|
134
|
+
],
|
|
135
|
+
"properties": {
|
|
136
|
+
"schemaVersion": {
|
|
137
|
+
"const": 1
|
|
138
|
+
},
|
|
139
|
+
"version": {
|
|
140
|
+
"const": "piagent-webui-workspace-write-v1"
|
|
141
|
+
},
|
|
142
|
+
"messageType": {
|
|
143
|
+
"const": "receipt"
|
|
144
|
+
},
|
|
145
|
+
"commandId": {
|
|
146
|
+
"$ref": "common-v1.schema.json#/$defs/opaqueRef"
|
|
147
|
+
},
|
|
148
|
+
"idempotencyKeyDigest": {
|
|
149
|
+
"$ref": "common-v1.schema.json#/$defs/digest"
|
|
150
|
+
},
|
|
151
|
+
"action": {
|
|
152
|
+
"const": "workspace.write"
|
|
153
|
+
},
|
|
154
|
+
"actionDigest": {
|
|
155
|
+
"$ref": "common-v1.schema.json#/$defs/digest"
|
|
156
|
+
},
|
|
157
|
+
"identity": {
|
|
158
|
+
"$ref": "common-v1.schema.json#/$defs/identity"
|
|
159
|
+
},
|
|
160
|
+
"phase": {
|
|
161
|
+
"enum": [
|
|
162
|
+
"settled",
|
|
163
|
+
"rejected",
|
|
164
|
+
"uncertain"
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
"resultCode": {
|
|
168
|
+
"enum": [
|
|
169
|
+
"saved",
|
|
170
|
+
"stale-content",
|
|
171
|
+
"stale-revision",
|
|
172
|
+
"identity-mismatch",
|
|
173
|
+
"read-only",
|
|
174
|
+
"path-protected",
|
|
175
|
+
"unsafe-path",
|
|
176
|
+
"invalid-write",
|
|
177
|
+
"expired",
|
|
178
|
+
"idempotency-payload-mismatch",
|
|
179
|
+
"effect-unknown",
|
|
180
|
+
"write-failed"
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
"requestedAt": {
|
|
184
|
+
"$ref": "common-v1.schema.json#/$defs/timestamp"
|
|
185
|
+
},
|
|
186
|
+
"settledAt": {
|
|
187
|
+
"$ref": "common-v1.schema.json#/$defs/timestamp"
|
|
188
|
+
},
|
|
189
|
+
"observedRevisionsBefore": {
|
|
190
|
+
"$ref": "#/$defs/revisions"
|
|
191
|
+
},
|
|
192
|
+
"observedRevisionsAfter": {
|
|
193
|
+
"$ref": "#/$defs/revisions"
|
|
194
|
+
},
|
|
195
|
+
"path": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"maxLength": 4096
|
|
198
|
+
},
|
|
199
|
+
"digest": {
|
|
200
|
+
"anyOf": [
|
|
201
|
+
{
|
|
202
|
+
"$ref": "common-v1.schema.json#/$defs/hash"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"type": "null"
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
"currentDigest": {
|
|
210
|
+
"type": [
|
|
211
|
+
"string",
|
|
212
|
+
"null"
|
|
213
|
+
],
|
|
214
|
+
"pattern": "^(absent|[a-f0-9]{64})$"
|
|
215
|
+
},
|
|
216
|
+
"deduplicated": {
|
|
217
|
+
"type": "boolean"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"title": "Workspace write receipt"
|
|
221
|
+
},
|
|
222
|
+
"payload": {
|
|
223
|
+
"type": "object",
|
|
224
|
+
"additionalProperties": false,
|
|
225
|
+
"required": [
|
|
226
|
+
"path",
|
|
227
|
+
"content",
|
|
228
|
+
"expectedDigest"
|
|
229
|
+
],
|
|
230
|
+
"properties": {
|
|
231
|
+
"path": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"minLength": 1,
|
|
234
|
+
"maxLength": 4096
|
|
235
|
+
},
|
|
236
|
+
"content": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"maxLength": 1048576
|
|
239
|
+
},
|
|
240
|
+
"expectedDigest": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"pattern": "^(absent|[a-f0-9]{64})$"
|
|
243
|
+
},
|
|
244
|
+
"operation": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"enum": [
|
|
247
|
+
"write",
|
|
248
|
+
"rename",
|
|
249
|
+
"delete"
|
|
250
|
+
],
|
|
251
|
+
"description": "Absent means write. Rename and delete send empty content and the digest of the file the member saw."
|
|
252
|
+
},
|
|
253
|
+
"destination": {
|
|
254
|
+
"type": "string",
|
|
255
|
+
"minLength": 1,
|
|
256
|
+
"maxLength": 4096,
|
|
257
|
+
"description": "The new path of a rename."
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"title": "Workspace write payload"
|
|
261
|
+
},
|
|
262
|
+
"revisions": {
|
|
263
|
+
"type": "object",
|
|
264
|
+
"additionalProperties": false,
|
|
265
|
+
"required": [
|
|
266
|
+
"workspaceRevision"
|
|
267
|
+
],
|
|
268
|
+
"properties": {
|
|
269
|
+
"workspaceRevision": {
|
|
270
|
+
"$ref": "common-v1.schema.json#/$defs/revisionToken"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"title": "Workspace write revisions"
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
@@ -51,14 +51,19 @@
|
|
|
51
51
|
"minLength": 1
|
|
52
52
|
},
|
|
53
53
|
"authorityProfile": {
|
|
54
|
-
"enum": [
|
|
54
|
+
"enum": [
|
|
55
|
+
"broad-default",
|
|
56
|
+
"mechanical-only",
|
|
57
|
+
"strict-high-risk"
|
|
58
|
+
]
|
|
55
59
|
},
|
|
56
60
|
"permissionProfile": {
|
|
57
|
-
"description": "Runtime permission profile. workspace-write is the default; trusted-full-access still keeps Piagent protected-path and destructive/external confirmation gates.",
|
|
61
|
+
"description": "Runtime permission profile. workspace-write is the default; trusted-full-access still keeps Piagent protected-path and destructive/external confirmation gates; bypass (personal sessions only) turns every Piagent gate off, keeping only output redaction and turn checkpoints.",
|
|
58
62
|
"enum": [
|
|
59
63
|
"read-only",
|
|
60
64
|
"workspace-write",
|
|
61
|
-
"trusted-full-access"
|
|
65
|
+
"trusted-full-access",
|
|
66
|
+
"bypass"
|
|
62
67
|
]
|
|
63
68
|
},
|
|
64
69
|
"rootMarkers": {
|
|
@@ -11,6 +11,7 @@ import { pathToFileURL } from 'node:url';
|
|
|
11
11
|
import { registerTerminalUpdateOffer } from '../packages/piagent-core/runtime/update/terminal-update-offer.mjs';
|
|
12
12
|
import { parseFailure } from '../packages/piagent-core/runtime/managed-failure.mjs';
|
|
13
13
|
import { checkpointsOf } from '../packages/piagent-core/managed/checkpoints.mjs';
|
|
14
|
+
import { bypassAllowed, effectivePermission } from '../packages/piagent-core/managed/permission.mjs';
|
|
14
15
|
import { memoryOn } from '../packages/piagent-core/managed/memory.mjs';
|
|
15
16
|
import { companyFailureText } from '../packages/piagent-webui/shared/company-copy.ts';
|
|
16
17
|
import { headlineText, outcomeText, processItems } from '../packages/piagent-webui/shared/process-copy.ts';
|
|
@@ -57,17 +58,19 @@ export function memoryResultLines(text, expanded = false) {
|
|
|
57
58
|
const branchOf = (cwd) => new Promise((resolve) => execFile('git', ['-C', cwd, 'rev-parse', '--abbrev-ref', 'HEAD'], { timeout: 3000 },
|
|
58
59
|
(error, out) => resolve(error ? null : String(out).trim() || null)));
|
|
59
60
|
export const HELP_TEXT = [
|
|
60
|
-
'Cuộc trò chuyện công ty: /undo hoàn tác file lượt trước đã sửa · /bypass on|off|status quyền
|
|
61
|
+
'Cuộc trò chuyện công ty: /undo hoàn tác file lượt trước đã sửa · /bypass on|full|off|status quyền của cuộc trò chuyện · /fast on|off|status (khi Harness cho phép) · /skill:<tên> hoặc /<lệnh> của bạn và của project.',
|
|
61
62
|
'Pi: /session thông tin cuộc trò chuyện · /resume mở cuộc trò chuyện công ty khác · /new cuộc mới · /compact nén ngữ cảnh · /tree, /fork nhánh · /name đặt tên · /copy, /export · /hotkeys toàn bộ phím tắt · /quit thoát.',
|
|
62
63
|
'Phím: ! <lệnh> chạy shell · Esc dừng lượt đang chạy · Ctrl+C xoá ô nhập, hai lần để thoát · Ctrl+O xem thêm.',
|
|
63
64
|
'Mở lại sau: piagent studio --project <thư mục>, rồi /resume. Đừng mở cuộc trò chuyện công ty bằng pi cá nhân.',
|
|
64
65
|
].join('\n');
|
|
65
66
|
const PERMISSION_STATUS = 'agent-watch-permission';
|
|
66
|
-
const ASK = 'Hỏi trước (mặc định)',
|
|
67
|
+
const ASK = 'Hỏi trước (mặc định)', FULL = 'Toàn quyền: chỉ hỏi việc bắt buộc', BYPASS = 'Bypass: không hỏi gì';
|
|
67
68
|
const PERMISSION_TEXT = {
|
|
68
69
|
'workspace-write': 'Hỏi trước: mọi lệnh cần internet đều hỏi bạn.',
|
|
69
|
-
'trusted-full-access': '
|
|
70
|
+
'trusted-full-access': 'Toàn quyền: lệnh cần internet chạy luôn; vẫn hỏi trước khi đẩy hoặc gửi dữ liệu ra ngoài, chạy migration, xoá không rõ đích hoặc dùng sudo.',
|
|
71
|
+
bypass: 'Bypass: không hỏi gì nữa (internet, Docker, lệnh trên máy, push, deploy, migration đều chạy luôn); lệnh thường vẫn trong sandbox, /undo vẫn dùng được.',
|
|
70
72
|
};
|
|
73
|
+
const PERMISSION_NAME = { 'workspace-write': 'Hỏi trước', 'trusted-full-access': 'Toàn quyền', bypass: 'Bypass' };
|
|
71
74
|
|
|
72
75
|
const EFFORT = { off: 'Tắt', minimal: 'Tối thiểu', low: 'Thấp', medium: 'Trung bình', high: 'Cao', xhigh: 'Rất cao', max: 'Tối đa' };
|
|
73
76
|
export const effortText = (level) => EFFORT[level] ?? level ?? '';
|
|
@@ -83,7 +86,7 @@ export function harnessSummary(managed, { last = null, version = null } = {}) {
|
|
|
83
86
|
return {
|
|
84
87
|
team: manifest?.user?.team_name || null,
|
|
85
88
|
effort: last?.effort || config.main?.effort || managed?.session?.state?.thinkingLevel || null,
|
|
86
|
-
review, permission: managed
|
|
89
|
+
review, permission: PERMISSION_NAME[effectivePermission(managed ?? {})] ?? 'Hỏi trước',
|
|
87
90
|
fast: fast === null ? null : fast === 'on', memory: managed ? memoryOn(managed) : false, version,
|
|
88
91
|
};
|
|
89
92
|
}
|
|
@@ -285,23 +288,25 @@ export function companyTerminalExtension({ managed, packageRoot, sdkRoot, bindin
|
|
|
285
288
|
afterUpdate: () => bindingChanged() ? 'Bản mới đổi trình khởi chạy công ty: Agent Watch tự cập nhật cấu hình (cần Agent Watch đang chạy); piagent studio chờ việc này khi mở lại.' : null });
|
|
286
289
|
|
|
287
290
|
// Ask first or Bypass, kept with the conversation like the dashboard's switch.
|
|
288
|
-
const showPermission = (ctx) => ctx.ui?.setStatus?.(PERMISSION_STATUS,
|
|
291
|
+
const showPermission = (ctx) => { const mode = managed() ? effectivePermission(managed()) : null; ctx.ui?.setStatus?.(PERMISSION_STATUS, mode && mode !== 'workspace-write' ? PERMISSION_NAME[mode] : undefined); };
|
|
289
292
|
pi.on('session_start', async (_event, ctx) => showPermission(ctx));
|
|
290
293
|
pi.registerCommand('bypass', {
|
|
291
|
-
description: '
|
|
292
|
-
getArgumentCompletions: argumentCompletions(['on', 'off', 'status']),
|
|
294
|
+
description: 'Quyền của cuộc trò chuyện công ty này: on (Bypass, khi Harness cho phép), full (Toàn quyền), off (Hỏi trước), hoặc để trống để chọn',
|
|
295
|
+
getArgumentCompletions: argumentCompletions(['on', 'full', 'off', 'status']),
|
|
293
296
|
handler: async (args, ctx) => {
|
|
294
297
|
const session = managed();
|
|
295
298
|
if (typeof session?.session?.managedSetPermission !== 'function') { ctx.ui.notify('Cuộc trò chuyện này chưa sẵn sàng.', 'error'); return; }
|
|
296
299
|
const arg = args.trim().toLowerCase();
|
|
297
|
-
|
|
300
|
+
const allowed = bypassAllowed(session.manifest);
|
|
301
|
+
let mode = arg === 'on' ? (allowed ? 'bypass' : null) : arg === 'full' ? 'trusted-full-access' : arg === 'off' ? 'workspace-write' : null;
|
|
302
|
+
if (arg === 'on' && !allowed) { ctx.ui.notify('Harness của team đã tắt Bypass (admin Studio). Dùng /bypass full cho Toàn quyền.', 'warning'); return; }
|
|
298
303
|
if (!mode && arg !== 'status') {
|
|
299
|
-
const choice = await ctx.ui.select(`Quyền của cuộc trò chuyện này (đang: ${session
|
|
300
|
-
mode = choice === BYPASS ? 'trusted-full-access' : choice === ASK ? 'workspace-write' : null;
|
|
304
|
+
const choice = await ctx.ui.select(`Quyền của cuộc trò chuyện này (đang: ${PERMISSION_NAME[effectivePermission(session)]})`, allowed ? [ASK, FULL, BYPASS] : [ASK, FULL]);
|
|
305
|
+
mode = choice === BYPASS ? 'bypass' : choice === FULL ? 'trusted-full-access' : choice === ASK ? 'workspace-write' : null;
|
|
301
306
|
}
|
|
302
307
|
if (mode && mode !== session.permission) session.session.managedSetPermission(mode);
|
|
303
308
|
showPermission(ctx);
|
|
304
|
-
ctx.ui.notify(PERMISSION_TEXT[session
|
|
309
|
+
ctx.ui.notify(PERMISSION_TEXT[effectivePermission(session)] ?? PERMISSION_TEXT['workspace-write'], 'info');
|
|
305
310
|
} });
|
|
306
311
|
|
|
307
312
|
// /undo: the files the last turn changed go back to how they were before
|
package/scripts/pi-auto.sh
CHANGED
|
@@ -4,7 +4,7 @@ set -euo pipefail
|
|
|
4
4
|
usage() {
|
|
5
5
|
cat <<'USAGE'
|
|
6
6
|
Usage:
|
|
7
|
-
piagent-auto [--read-only|--workspace-write|--full-access] [--no-approve] [--] [pi args...]
|
|
7
|
+
piagent-auto [--read-only|--workspace-write|--full-access|--bypass] [--no-approve] [--] [pi args...]
|
|
8
8
|
|
|
9
9
|
Purpose:
|
|
10
10
|
Launch Pi with project-local trust approved for this run.
|
|
@@ -47,6 +47,10 @@ while [[ $# -gt 0 ]]; do
|
|
|
47
47
|
PERMISSION_PROFILE="trusted-full-access"
|
|
48
48
|
shift
|
|
49
49
|
;;
|
|
50
|
+
--bypass|--yolo|--dangerously-bypass)
|
|
51
|
+
PERMISSION_PROFILE="bypass"
|
|
52
|
+
shift
|
|
53
|
+
;;
|
|
50
54
|
--no-approve|-na)
|
|
51
55
|
APPROVE_FLAG="--no-approve"
|
|
52
56
|
shift
|
package/scripts/team-doctor.sh
CHANGED
|
@@ -512,8 +512,16 @@ const verifyGroups = projectProfile?.verifyCommands && typeof projectProfile.ver
|
|
|
512
512
|
: [];
|
|
513
513
|
const stateRoot = path.join(projectPath, ".pi", "piagent-state");
|
|
514
514
|
const expectedPiHostVersion = rootPackage.peerDependencies?.["@earendil-works/pi-coding-agent"] ?? null;
|
|
515
|
+
const { personalTerminalDiagnostic } = await import(pathToFileURL(path.join(platformRoot, "packages/piagent-webui/gateway/personal-terminal-diagnostic.mjs")).href);
|
|
516
|
+
const terminalReadiness = personalTerminalDiagnostic();
|
|
517
|
+
if (!terminalReadiness.available) warnings.push(`Personal terminal unavailable: ${terminalReadiness.reasonCode}; the dashboard remains available.`);
|
|
518
|
+
const { companyTerminalDiagnostic } = await import(pathToFileURL(path.join(platformRoot, "packages/piagent-core/managed/sandbox-diagnostic.mjs")).href);
|
|
519
|
+
const companyTerminalReadiness = companyTerminalDiagnostic();
|
|
520
|
+
if (!companyTerminalReadiness.supported) warnings.push(`Company terminal unavailable: ${companyTerminalReadiness.reasonCode}; no host shell fallback.`);
|
|
515
521
|
const productReadiness = {
|
|
516
522
|
schemaVersion: 1,
|
|
523
|
+
personalTerminal: terminalReadiness,
|
|
524
|
+
companyTerminal: companyTerminalReadiness,
|
|
517
525
|
versionAlignment: {
|
|
518
526
|
piHostExpected: expectedPiHostVersion,
|
|
519
527
|
piHostObserved: runtimeModel.piHostVersion,
|