@chainingintention/pi-web-cn 2.0.0 → 2.202610.1
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/README.md +61 -106
- package/dist/.plugins-ready +1 -0
- package/dist/cli.js +331 -174
- package/dist/cli.js.map +1 -1
- package/dist/client/apple-touch-icon-dev.png +0 -0
- package/dist/client/assets/PiWebApp-vueV4eKR.js +4938 -0
- package/dist/client/assets/classic-CyM97Akm.css +54 -0
- package/dist/client/assets/external-B9K8duyP.js +2 -0
- package/dist/client/assets/graphite-DquaqFXU.css +54 -0
- package/dist/client/assets/index-C8f0d0CR.js +2 -0
- package/dist/client/assets/paper-CB1oLuRr.css +54 -0
- package/dist/client/assets/pi-web-dark-D_KtbM95.css +54 -0
- package/dist/client/assets/pi-web-light-DSNLMIBI.css +54 -0
- package/dist/client/assets/vendor-editor-core-BfnHL1Dg.js +10 -0
- package/dist/client/assets/vendor-editor-languages-bNquDJP0.js +28 -0
- package/dist/client/favicon-dev.svg +8 -0
- package/dist/client/index.html +7 -51
- package/dist/client/manifest.webmanifest +2 -1
- package/dist/client/pwa-icon-dev-192.png +0 -0
- package/dist/client/pwa-icon-dev-512.png +0 -0
- package/dist/config.js +55 -8
- package/dist/config.js.map +1 -1
- package/dist/docker/piWebDockerCommandPlan.js +13 -4
- package/dist/docker/piWebDockerCommandPlan.js.map +1 -1
- package/dist/environment.js +4 -0
- package/dist/environment.js.map +1 -0
- package/dist/localization.js +24 -0
- package/dist/localization.js.map +1 -0
- package/dist/nativeServices/installedServiceDefinitions.js +617 -0
- package/dist/nativeServices/installedServiceDefinitions.js.map +1 -0
- package/dist/nativeServices/serviceAction.js +78 -20
- package/dist/nativeServices/serviceAction.js.map +1 -1
- package/dist/nativeServices/serviceDoctor.js +418 -114
- package/dist/nativeServices/serviceDoctor.js.map +1 -1
- package/dist/nativeServices/servicePlan.js +2 -2
- package/dist/nativeServices/servicePlan.js.map +1 -1
- package/dist/pi-packages/captains-log/README.md +11 -0
- package/dist/pi-packages/captains-log/dist/browser/channelProtocol.js +29 -0
- package/dist/pi-packages/captains-log/dist/browser/index.js +143 -0
- package/dist/pi-packages/captains-log/dist/browser/markdown.js +68 -0
- package/dist/pi-packages/captains-log/dist/browser/panel.js +148 -0
- package/dist/pi-packages/captains-log/dist/browser/protocol.js +26 -0
- package/dist/pi-packages/captains-log/dist/companion.js +126 -0
- package/dist/pi-packages/captains-log/dist/roundtrip.js +62 -0
- package/dist/pi-packages/captains-log/dist/server.js +210 -0
- package/dist/pi-packages/captains-log/dist/store.js +75 -0
- package/dist/pi-packages/captains-log/docs/usage.md +29 -0
- package/dist/pi-packages/captains-log/i18n.js +7 -0
- package/dist/pi-packages/captains-log/package.json +35 -0
- package/dist/pi-packages/captains-log/tsconfig.json +21 -0
- package/dist/pi-packages/captains-log/vite.config.mjs +28 -0
- package/dist/pi-packages/relays/extensions/index.js +61 -0
- package/dist/pi-packages/relays/i18n.js +7 -0
- package/dist/{pi-web-plugins → pi-packages}/relays/markdownDocument.js +3 -2
- package/dist/pi-packages/relays/package.json +20 -0
- package/dist/pi-packages/relays/pi-web-plugin.js +96 -0
- package/dist/pi-packages/relays/prompts/relay-worktree.md +18 -0
- package/dist/pi-packages/relays/prompts/relay.md +18 -0
- package/dist/{pi-web-plugins → pi-packages}/relays/relayDiscovery.js +2 -2
- package/dist/pi-packages/relays/relayDispatch.js +67 -0
- package/dist/pi-packages/relays/relayIdentity.js +37 -0
- package/dist/{pi-web-plugins → pi-packages}/relays/relaysPanelElement.js +98 -59
- package/dist/pi-packages/relays/skills/relay/SKILL.md +50 -0
- package/dist/pi-packages/relays/skills/relay-runner/SKILL.md +74 -0
- package/dist/pi-packages/workflows/browser/pi-web-plugin.js +42 -0
- package/dist/pi-packages/workflows/browser/worktreeDialog.js +170 -0
- package/dist/pi-packages/workflows/package.json +23 -0
- package/dist/pi-packages/workflows/prompts/worktree.md +21 -0
- package/dist/pi-packages/workflows/server-plugin.js +586 -0
- package/dist/pi-packages/workflows/vite.config.mjs +17 -0
- package/dist/pi-web-plugins/code-highlight/browser/pi-web-plugin.js +22 -0
- package/dist/pi-web-plugins/code-highlight/package.json +13 -0
- package/dist/pi-web-plugins/files/browser/assets/files-icon-DZObYhxb.svg +3 -0
- package/dist/pi-web-plugins/files/browser/pi-web-plugin.js +466 -0
- package/dist/pi-web-plugins/files/package.json +15 -0
- package/dist/pi-web-plugins/git/browser/git-contract.js +22 -11
- package/dist/pi-web-plugins/git/browser/git-panel.js +228 -100
- package/dist/pi-web-plugins/git/browser/i18n.js +7 -0
- package/dist/pi-web-plugins/git/browser/pi-web-plugin.js +28 -4
- package/dist/pi-web-plugins/git/git-backend.js +61 -21
- package/dist/pi-web-plugins/git/gitStatusCache.js +48 -0
- package/dist/pi-web-plugins/git/i18n.js +7 -0
- package/dist/pi-web-plugins/git/package.json +1 -0
- package/dist/pi-web-plugins/git/server-plugin.js +45 -24
- package/dist/pi-web-plugins/git/workspace-discovery-notify.cjs +14 -0
- package/dist/pi-web-plugins/git/workspaceDiscoveryHooks.js +186 -0
- package/dist/pi-web-plugins/info/i18n.js +7 -0
- package/dist/pi-web-plugins/info/infoInternals.js +76 -65
- package/dist/pi-web-plugins/info/package.json +1 -1
- package/dist/pi-web-plugins/info/pi-web-plugin.js +40 -42
- package/dist/pi-web-plugins/mermaid/browser/mermaid-engine.js +4255 -0
- package/dist/pi-web-plugins/mermaid/browser/pi-web-plugin.js +11 -0
- package/dist/pi-web-plugins/mermaid/package.json +13 -0
- package/dist/pi-web-plugins/terminal/browser/pi-web-plugin.js +219 -0
- package/dist/pi-web-plugins/terminal/i18n.js +7 -0
- package/dist/pi-web-plugins/terminal/package.json +16 -0
- package/dist/pi-web-plugins/terminal/server-plugin.js +367 -0
- package/dist/pi-web-plugins/terminal/terminalService.js +436 -0
- package/dist/pi-web-plugins/updates/i18n.js +7 -0
- package/dist/pi-web-plugins/updates/package.json +1 -1
- package/dist/pi-web-plugins/updates/pi-web-plugin.js +143 -140
- package/dist/pi-web-plugins/updates/updatesLogic.js +24 -24
- package/dist/pi-web-plugins/workspace-tasks/config.js +12 -11
- package/dist/pi-web-plugins/workspace-tasks/i18n.js +7 -0
- package/dist/pi-web-plugins/workspace-tasks/package.json +1 -1
- package/dist/pi-web-plugins/workspace-tasks/pi-web-plugin.js +31 -9
- package/dist/pi-web-plugins/workspace-tasks/tasksPanelElement.js +54 -36
- package/dist/pi-web-plugins/workspace-tasks/workspaceTasksClient.js +12 -11
- package/dist/pi-web-plugins/zh-cn/auth.json +9 -0
- package/dist/pi-web-plugins/zh-cn/bundled.json +219 -0
- package/dist/pi-web-plugins/zh-cn/cli.json +230 -0
- package/dist/pi-web-plugins/zh-cn/client.json +225 -0
- package/dist/pi-web-plugins/zh-cn/components.json +1252 -0
- package/dist/pi-web-plugins/zh-cn/config-errors.json +188 -0
- package/dist/pi-web-plugins/zh-cn/files.json +50 -0
- package/dist/pi-web-plugins/zh-cn/machines.json +28 -0
- package/dist/pi-web-plugins/zh-cn/main.json +459 -0
- package/dist/pi-web-plugins/zh-cn/management-errors.json +23 -0
- package/dist/pi-web-plugins/zh-cn/manifest.webmanifest +25 -0
- package/dist/pi-web-plugins/zh-cn/metadata.json +3 -0
- package/dist/pi-web-plugins/zh-cn/package.json +10 -0
- package/dist/pi-web-plugins/zh-cn/pi-web-plugin.js +16 -0
- package/dist/pi-web-plugins/zh-cn/projects.json +6 -0
- package/dist/pi-web-plugins/zh-cn/provider-auth.json +18 -0
- package/dist/pi-web-plugins/zh-cn/routing.json +68 -0
- package/dist/pi-web-plugins/zh-cn/server-main.json +99 -0
- package/dist/pi-web-plugins/zh-cn/server.json +256 -0
- package/dist/piAi.js +4 -0
- package/dist/piAi.js.map +1 -0
- package/dist/piRuntime.js +150 -0
- package/dist/piRuntime.js.map +1 -0
- package/dist/piSdk.js +5 -0
- package/dist/piSdk.js.map +1 -0
- package/dist/piWebUpdate.js +508 -0
- package/dist/piWebUpdate.js.map +1 -0
- package/dist/piWebVersionReport.js +109 -41
- package/dist/piWebVersionReport.js.map +1 -1
- package/dist/plugin-api.d.ts +609 -29
- package/dist/plugin-api.js +1 -0
- package/dist/pluginRecoveryCli.js +27 -25
- package/dist/pluginRecoveryCli.js.map +1 -1
- package/dist/server/activity/workspaceActivityService.js +13 -6
- package/dist/server/activity/workspaceActivityService.js.map +1 -1
- package/dist/server/app.js +158 -89
- package/dist/server/app.js.map +1 -1
- package/dist/server/audit/managementAuditStore.js +6 -1
- package/dist/server/audit/managementAuditStore.js.map +1 -1
- package/dist/server/audit/normalToolAuditCli.js +45 -43
- package/dist/server/audit/normalToolAuditCli.js.map +1 -1
- package/dist/server/browserMessageProjection.js +39 -22
- package/dist/server/browserMessageProjection.js.map +1 -1
- package/dist/server/configRoutes.js +54 -33
- package/dist/server/configRoutes.js.map +1 -1
- package/dist/server/deploymentIdentity.js +67 -0
- package/dist/server/deploymentIdentity.js.map +1 -0
- package/dist/server/deploymentIdentityRoutes.js +22 -0
- package/dist/server/deploymentIdentityRoutes.js.map +1 -0
- package/dist/server/diagnostics/nodePtyNativeModule.js +7 -6
- package/dist/server/diagnostics/nodePtyNativeModule.js.map +1 -1
- package/dist/server/diagnostics/nodePtySpawnHelper.js +21 -20
- package/dist/server/diagnostics/nodePtySpawnHelper.js.map +1 -1
- package/dist/server/index.js +10 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/knownAutoInstallPiPackages.js +36 -0
- package/dist/server/knownAutoInstallPiPackages.js.map +1 -0
- package/dist/server/knownPiPackages.js +12 -0
- package/dist/server/knownPiPackages.js.map +1 -0
- package/dist/server/machines/machineClient.js +23 -19
- package/dist/server/machines/machineClient.js.map +1 -1
- package/dist/server/machines/machinePluginProxyRoutes.js +131 -31
- package/dist/server/machines/machinePluginProxyRoutes.js.map +1 -1
- package/dist/server/machines/machineProxyRoutes.js +138 -47
- package/dist/server/machines/machineProxyRoutes.js.map +1 -1
- package/dist/server/machines/machineRoutes.js +18 -13
- package/dist/server/machines/machineRoutes.js.map +1 -1
- package/dist/server/machines/machineService.js +40 -18
- package/dist/server/machines/machineService.js.map +1 -1
- package/dist/server/managementEmbed.js +149 -30
- package/dist/server/managementEmbed.js.map +1 -1
- package/dist/server/managementPrivileges.js +21 -0
- package/dist/server/managementPrivileges.js.map +1 -0
- package/dist/server/managementTerminalProxyRoutes.js +124 -0
- package/dist/server/managementTerminalProxyRoutes.js.map +1 -0
- package/dist/server/navigationPreferenceRoutes.js +59 -0
- package/dist/server/navigationPreferenceRoutes.js.map +1 -0
- package/dist/server/normalAuth.js +77 -53
- package/dist/server/normalAuth.js.map +1 -1
- package/dist/server/notices/serverNoticeRoutes.js +43 -0
- package/dist/server/notices/serverNoticeRoutes.js.map +1 -0
- package/dist/server/notices/serverNoticeService.js +26 -0
- package/dist/server/notices/serverNoticeService.js.map +1 -0
- package/dist/server/notices/serverNoticeStore.js +122 -0
- package/dist/server/notices/serverNoticeStore.js.map +1 -0
- package/dist/server/passwordVerifier.js +91 -0
- package/dist/server/passwordVerifier.js.map +1 -0
- package/dist/server/piPackageIdentity.js +25 -0
- package/dist/server/piPackageIdentity.js.map +1 -0
- package/dist/server/piPackageService.js +72 -9
- package/dist/server/piPackageService.js.map +1 -1
- package/dist/server/piWebPluginCatalog.js +212 -35
- package/dist/server/piWebPluginCatalog.js.map +1 -1
- package/dist/server/piWebPluginLifecycle.js +29 -3
- package/dist/server/piWebPluginLifecycle.js.map +1 -1
- package/dist/server/piWebPluginService.js +199 -292
- package/dist/server/piWebPluginService.js.map +1 -1
- package/dist/server/piWebStatus.js +57 -100
- package/dist/server/piWebStatus.js.map +1 -1
- package/dist/server/pluginCallbackDrain.js +35 -0
- package/dist/server/pluginCallbackDrain.js.map +1 -0
- package/dist/server/plugins/pluginBackendChannelProxyAdmission.js +84 -0
- package/dist/server/plugins/pluginBackendChannelProxyAdmission.js.map +1 -0
- package/dist/server/plugins/pluginBackendChannelProxyCoordinator.js +234 -0
- package/dist/server/plugins/pluginBackendChannelProxyCoordinator.js.map +1 -0
- package/dist/server/plugins/pluginBackendChannelProxyRoutes.js +61 -0
- package/dist/server/plugins/pluginBackendChannelProxyRoutes.js.map +1 -0
- package/dist/server/plugins/pluginBackendProxyRoutes.js +47 -57
- package/dist/server/plugins/pluginBackendProxyRoutes.js.map +1 -1
- package/dist/server/plugins/pluginBackendRegistry.js +804 -0
- package/dist/server/plugins/pluginBackendRegistry.js.map +1 -0
- package/dist/server/plugins/projectPluginSettings.js +95 -0
- package/dist/server/plugins/projectPluginSettings.js.map +1 -0
- package/dist/server/plugins/serverPluginCatalogCapability.js +106 -0
- package/dist/server/plugins/serverPluginCatalogCapability.js.map +1 -0
- package/dist/server/plugins/serverPluginPiSessionEventsCapability.js +34 -0
- package/dist/server/plugins/serverPluginPiSessionEventsCapability.js.map +1 -0
- package/dist/server/plugins/serverPluginPiSessionsCapability.js +185 -0
- package/dist/server/plugins/serverPluginPiSessionsCapability.js.map +1 -0
- package/dist/server/plugins/serverPluginRuntime.js +1088 -108
- package/dist/server/plugins/serverPluginRuntime.js.map +1 -1
- package/dist/server/plugins/serverPluginWorkspacesCapability.js +114 -0
- package/dist/server/plugins/serverPluginWorkspacesCapability.js.map +1 -0
- package/dist/server/projectTrustRoutes.js +86 -0
- package/dist/server/projectTrustRoutes.js.map +1 -0
- package/dist/server/projects/projectLifecycleService.js +94 -0
- package/dist/server/projects/projectLifecycleService.js.map +1 -0
- package/dist/server/projects/projectService.js +7 -4
- package/dist/server/projects/projectService.js.map +1 -1
- package/dist/server/realtime/sessionEventHub.js +58 -39
- package/dist/server/realtime/sessionEventHub.js.map +1 -1
- package/dist/server/realtime/sessionEventScope.js +4 -0
- package/dist/server/realtime/sessionEventScope.js.map +1 -1
- package/dist/server/requestCancellation.js +15 -1
- package/dist/server/requestCancellation.js.map +1 -1
- package/dist/server/sessiond/agentHttpDispatcher.js +108 -0
- package/dist/server/sessiond/agentHttpDispatcher.js.map +1 -0
- package/dist/server/sessiond/autoInstallPiPackages.js +63 -0
- package/dist/server/sessiond/autoInstallPiPackages.js.map +1 -0
- package/dist/server/sessiond/pluginBackendChannelRoutes.js +410 -0
- package/dist/server/sessiond/pluginBackendChannelRoutes.js.map +1 -0
- package/dist/server/sessiond/pluginBackendRoutes.js +64 -47
- package/dist/server/sessiond/pluginBackendRoutes.js.map +1 -1
- package/dist/server/sessiond/pluginCatalogRoutes.js +41 -0
- package/dist/server/sessiond/pluginCatalogRoutes.js.map +1 -0
- package/dist/server/sessiond/projectMutationRoutes.js +39 -0
- package/dist/server/sessiond/projectMutationRoutes.js.map +1 -0
- package/dist/server/sessiond/sessionDaemonShutdown.js +36 -0
- package/dist/server/sessiond/sessionDaemonShutdown.js.map +1 -0
- package/dist/server/sessiond/sessionDaemonStartup.js +30 -4
- package/dist/server/sessiond/sessionDaemonStartup.js.map +1 -1
- package/dist/server/sessiond/sessionProxyRoutes.js +263 -91
- package/dist/server/sessiond/sessionProxyRoutes.js.map +1 -1
- package/dist/server/sessiond/sessionServiceDependencies.js +5 -0
- package/dist/server/sessiond/sessionServiceDependencies.js.map +1 -1
- package/dist/server/sessiond/sessiondStateOwnership.js +174 -39
- package/dist/server/sessiond/sessiondStateOwnership.js.map +1 -1
- package/dist/server/sessiond/workspaceCatalogRoutes.js +11 -5
- package/dist/server/sessiond/workspaceCatalogRoutes.js.map +1 -1
- package/dist/server/sessiond/workspaceNotificationRoutes.js +55 -0
- package/dist/server/sessiond/workspaceNotificationRoutes.js.map +1 -0
- package/dist/server/sessiond/workspaceRemovalRoutes.js +1 -1
- package/dist/server/sessiond/workspaceRemovalRoutes.js.map +1 -1
- package/dist/server/sessiond.js +313 -69
- package/dist/server/sessiond.js.map +1 -1
- package/dist/server/sessions/askUserDomain.js +232 -0
- package/dist/server/sessions/askUserDomain.js.map +1 -0
- package/dist/server/sessions/askUserTool.js +18 -21
- package/dist/server/sessions/askUserTool.js.map +1 -1
- package/dist/server/sessions/attachmentService.js +2 -6
- package/dist/server/sessions/attachmentService.js.map +1 -1
- package/dist/server/sessions/authRoutes.js +32 -19
- package/dist/server/sessions/authRoutes.js.map +1 -1
- package/dist/server/sessions/authService.js +31 -11
- package/dist/server/sessions/authService.js.map +1 -1
- package/dist/server/sessions/builtinCommands.js +28 -21
- package/dist/server/sessions/builtinCommands.js.map +1 -1
- package/dist/server/sessions/builtinExtensionFactories.js +36 -0
- package/dist/server/sessions/builtinExtensionFactories.js.map +1 -0
- package/dist/server/sessions/clientSessionPreview.js +14 -0
- package/dist/server/sessions/clientSessionPreview.js.map +1 -0
- package/dist/server/sessions/companionBackend.js +286 -0
- package/dist/server/sessions/companionBackend.js.map +1 -0
- package/dist/server/sessions/dockerEnvironmentFacts.js +98 -10
- package/dist/server/sessions/dockerEnvironmentFacts.js.map +1 -1
- package/dist/server/sessions/extensionSessionDispatch.js +76 -0
- package/dist/server/sessions/extensionSessionDispatch.js.map +1 -0
- package/dist/server/sessions/globalProviderPolicy.js +88 -19
- package/dist/server/sessions/globalProviderPolicy.js.map +1 -1
- package/dist/server/sessions/managementAgentTools.js +116 -6
- package/dist/server/sessions/managementAgentTools.js.map +1 -1
- package/dist/server/sessions/managementPermissionSystem.js +36 -14
- package/dist/server/sessions/managementPermissionSystem.js.map +1 -1
- package/dist/server/sessions/managementSandbox.js +7 -18
- package/dist/server/sessions/managementSandbox.js.map +1 -1
- package/dist/server/sessions/mcpAuthFlowService.js +289 -0
- package/dist/server/sessions/mcpAuthFlowService.js.map +1 -0
- package/dist/server/sessions/mcpAuthRoutes.js +104 -0
- package/dist/server/sessions/mcpAuthRoutes.js.map +1 -0
- package/dist/server/sessions/mcpOAuthCredentialAdapter.js +92 -0
- package/dist/server/sessions/mcpOAuthCredentialAdapter.js.map +1 -0
- package/dist/server/sessions/messageHistoryTarget.js +79 -0
- package/dist/server/sessions/messageHistoryTarget.js.map +1 -0
- package/dist/server/sessions/messagePaging.js +2 -2
- package/dist/server/sessions/messagePaging.js.map +1 -1
- package/dist/server/sessions/modelCatalogRefresher.js +4 -3
- package/dist/server/sessions/modelCatalogRefresher.js.map +1 -1
- package/dist/server/sessions/oauthLoginFlowService.js +19 -20
- package/dist/server/sessions/oauthLoginFlowService.js.map +1 -1
- package/dist/server/sessions/piSessionEventConnections.js +68 -0
- package/dist/server/sessions/piSessionEventConnections.js.map +1 -0
- package/dist/server/sessions/piSessionManagerGateway.js +206 -27
- package/dist/server/sessions/piSessionManagerGateway.js.map +1 -1
- package/dist/server/sessions/piSessionService.js +2508 -991
- package/dist/server/sessions/piSessionService.js.map +1 -1
- package/dist/server/sessions/plainTextTheme.js +1 -1
- package/dist/server/sessions/plainTextTheme.js.map +1 -1
- package/dist/server/sessions/projectAuthService.js +35 -6
- package/dist/server/sessions/projectAuthService.js.map +1 -1
- package/dist/server/sessions/projectSettingsScope.js +88 -33
- package/dist/server/sessions/projectSettingsScope.js.map +1 -1
- package/dist/server/sessions/projectTrust.js +119 -0
- package/dist/server/sessions/projectTrust.js.map +1 -0
- package/dist/server/sessions/queuedMessageMutation.js +170 -0
- package/dist/server/sessions/queuedMessageMutation.js.map +1 -0
- package/dist/server/sessions/relaySkill.js +169 -0
- package/dist/server/sessions/relaySkill.js.map +1 -0
- package/dist/server/sessions/sessionActivityMarker.js +105 -0
- package/dist/server/sessions/sessionActivityMarker.js.map +1 -0
- package/dist/server/sessions/sessionArchiveMapping.js +16 -15
- package/dist/server/sessions/sessionArchiveMapping.js.map +1 -1
- package/dist/server/sessions/sessionArchiveStore.js +5 -1
- package/dist/server/sessions/sessionArchiveStore.js.map +1 -1
- package/dist/server/sessions/sessionArchiveTree.js +2 -2
- package/dist/server/sessions/sessionArchiveTree.js.map +1 -1
- package/dist/server/sessions/sessionCleanup.js +4 -3
- package/dist/server/sessions/sessionCleanup.js.map +1 -1
- package/dist/server/sessions/sessionCommandService.js +79 -87
- package/dist/server/sessions/sessionCommandService.js.map +1 -1
- package/dist/server/sessions/sessionEnvironmentFacts.js +5 -4
- package/dist/server/sessions/sessionEnvironmentFacts.js.map +1 -1
- package/dist/server/sessions/sessionFileHeader.js +41 -0
- package/dist/server/sessions/sessionFileHeader.js.map +1 -1
- package/dist/server/sessions/sessionImageDimensions.js +31 -0
- package/dist/server/sessions/sessionImageDimensions.js.map +1 -0
- package/dist/server/sessions/sessionMediaIndex.js +191 -0
- package/dist/server/sessions/sessionMediaIndex.js.map +1 -0
- package/dist/server/sessions/sessionMetadata.js +51 -0
- package/dist/server/sessions/sessionMetadata.js.map +1 -0
- package/dist/server/sessions/sessionModelScope.js +160 -0
- package/dist/server/sessions/sessionModelScope.js.map +1 -0
- package/dist/server/sessions/sessionNameGenerator.js +16 -35
- package/dist/server/sessions/sessionNameGenerator.js.map +1 -1
- package/dist/server/sessions/sessionNotificationStore.js +14 -11
- package/dist/server/sessions/sessionNotificationStore.js.map +1 -1
- package/dist/server/sessions/sessionReadAccess.js +41 -0
- package/dist/server/sessions/sessionReadAccess.js.map +1 -0
- package/dist/server/sessions/sessionRoutes.js +221 -78
- package/dist/server/sessions/sessionRoutes.js.map +1 -1
- package/dist/server/sessions/sessionSummaryScanner.js +62 -5
- package/dist/server/sessions/sessionSummaryScanner.js.map +1 -1
- package/dist/server/sessions/sessionTreeProjection.js +50 -49
- package/dist/server/sessions/sessionTreeProjection.js.map +1 -1
- package/dist/server/sessions/sessionUiEvents.js +22 -10
- package/dist/server/sessions/sessionUiEvents.js.map +1 -1
- package/dist/server/sessions/sessionUnreadStore.js +53 -3
- package/dist/server/sessions/sessionUnreadStore.js.map +1 -1
- package/dist/server/sessions/spawnSessionTool.js +14 -6
- package/dist/server/sessions/spawnSessionTool.js.map +1 -1
- package/dist/server/sessions/spawnSubsessionTool.js +40 -24
- package/dist/server/sessions/spawnSubsessionTool.js.map +1 -1
- package/dist/server/sessions/spawnTargetResolver.js +1 -1
- package/dist/server/sessions/subsessionCompletionDelivery.js +15 -0
- package/dist/server/sessions/subsessionCompletionDelivery.js.map +1 -0
- package/dist/server/sessions/subsessionCompletionInbox.js +134 -0
- package/dist/server/sessions/subsessionCompletionInbox.js.map +1 -0
- package/dist/server/sessions/subsessionProvenance.js +27 -0
- package/dist/server/sessions/subsessionProvenance.js.map +1 -0
- package/dist/server/sessions/transcriptBranchCache.js +81 -0
- package/dist/server/sessions/transcriptBranchCache.js.map +1 -0
- package/dist/server/sessions/transcriptMarkdown.js +48 -0
- package/dist/server/sessions/transcriptMarkdown.js.map +1 -0
- package/dist/server/sessions/transcriptMessages.js +57 -0
- package/dist/server/sessions/transcriptMessages.js.map +1 -0
- package/dist/server/startupLogger.js +13 -0
- package/dist/server/startupLogger.js.map +1 -0
- package/dist/server/startupUrls.js +27 -0
- package/dist/server/startupUrls.js.map +1 -0
- package/dist/server/status/machineStatusService.js +15 -7
- package/dist/server/status/machineStatusService.js.map +1 -1
- package/dist/server/storage/navigationPreferenceStore.js +138 -0
- package/dist/server/storage/navigationPreferenceStore.js.map +1 -0
- package/dist/server/storage/piPackageDismissalStore.js +78 -0
- package/dist/server/storage/piPackageDismissalStore.js.map +1 -0
- package/dist/server/terminals/{terminalService.js → managementCommandRunService.js} +98 -102
- package/dist/server/terminals/managementCommandRunService.js.map +1 -0
- package/dist/server/terminals/managementTerminalRoutes.js +91 -0
- package/dist/server/terminals/managementTerminalRoutes.js.map +1 -0
- package/dist/server/terminals/requiredTerminalService.js +103 -0
- package/dist/server/terminals/requiredTerminalService.js.map +1 -0
- package/dist/server/webSocketBridge.js +348 -0
- package/dist/server/webSocketBridge.js.map +1 -1
- package/dist/server/workbench/accessStateStore.js +33 -5
- package/dist/server/workbench/accessStateStore.js.map +1 -1
- package/dist/server/workbench/capabilitySearch.js +3 -2
- package/dist/server/workbench/capabilitySearch.js.map +1 -1
- package/dist/server/workbench/gatewayIntegration.js +40 -13
- package/dist/server/workbench/gatewayIntegration.js.map +1 -1
- package/dist/server/workbench/knowledgeSearch.js +100 -0
- package/dist/server/workbench/knowledgeSearch.js.map +1 -0
- package/dist/server/workbench/mcpClient.js +41 -8
- package/dist/server/workbench/mcpClient.js.map +1 -1
- package/dist/server/workbench/skillSync.js +11 -3
- package/dist/server/workbench/skillSync.js.map +1 -1
- package/dist/server/workbench/workbenchClient.js +130 -7
- package/dist/server/workbench/workbenchClient.js.map +1 -1
- package/dist/server/workbench/workbenchTools.js +196 -14
- package/dist/server/workbench/workbenchTools.js.map +1 -1
- package/dist/server/workingDirectory.js +3 -2
- package/dist/server/workingDirectory.js.map +1 -1
- package/dist/server/workspaceExplorerRoutes.js +53 -21
- package/dist/server/workspaceExplorerRoutes.js.map +1 -1
- package/dist/server/workspaces/fileContentService.js +31 -16
- package/dist/server/workspaces/fileContentService.js.map +1 -1
- package/dist/server/workspaces/fileOperationService.js +11 -9
- package/dist/server/workspaces/fileOperationService.js.map +1 -1
- package/dist/server/workspaces/filePreviewService.js +10 -6
- package/dist/server/workspaces/filePreviewService.js.map +1 -1
- package/dist/server/workspaces/fileSuggestions.js +77 -10
- package/dist/server/workspaces/fileSuggestions.js.map +1 -1
- package/dist/server/workspaces/fileTreeService.js +103 -15
- package/dist/server/workspaces/fileTreeService.js.map +1 -1
- package/dist/server/workspaces/normalProjectCwdResolver.js +35 -0
- package/dist/server/workspaces/normalProjectCwdResolver.js.map +1 -0
- package/dist/server/workspaces/pathAccessPolicy.js +24 -18
- package/dist/server/workspaces/pathAccessPolicy.js.map +1 -1
- package/dist/server/workspaces/pathSafety.js +6 -5
- package/dist/server/workspaces/pathSafety.js.map +1 -1
- package/dist/server/workspaces/projectPiWebConfig.js +95 -8
- package/dist/server/workspaces/projectPiWebConfig.js.map +1 -1
- package/dist/server/workspaces/projectWorkspaceCwds.js +0 -5
- package/dist/server/workspaces/projectWorkspaceCwds.js.map +1 -1
- package/dist/server/workspaces/sessionDaemonWorkspaceCatalog.js +37 -22
- package/dist/server/workspaces/sessionDaemonWorkspaceCatalog.js.map +1 -1
- package/dist/server/workspaces/workspaceCatalog.js +6 -4
- package/dist/server/workspaces/workspaceCatalog.js.map +1 -1
- package/dist/server/workspaces/workspaceChangeNotifier.js +12 -0
- package/dist/server/workspaces/workspaceChangeNotifier.js.map +1 -0
- package/dist/server/workspaces/workspaceDeletionRoutes.js +9 -70
- package/dist/server/workspaces/workspaceDeletionRoutes.js.map +1 -1
- package/dist/server/workspaces/workspaceNotificationCommand.js +64 -0
- package/dist/server/workspaces/workspaceNotificationCommand.js.map +1 -0
- package/dist/server/workspaces/workspaceProviderRegistry.js +128 -24
- package/dist/server/workspaces/workspaceProviderRegistry.js.map +1 -1
- package/dist/server/workspaces/workspaceRemovalService.js +41 -7
- package/dist/server/workspaces/workspaceRemovalService.js.map +1 -1
- package/dist/server/workspaces/workspaceRouteContext.js +1 -1
- package/dist/server/workspaces/workspaceRouteContext.js.map +1 -1
- package/dist/server/workspaces/workspaceRouteErrors.js +4 -2
- package/dist/server/workspaces/workspaceRouteErrors.js.map +1 -1
- package/dist/server/workspaces/workspaceUserError.js +18 -0
- package/dist/server/workspaces/workspaceUserError.js.map +1 -0
- package/dist/server-plugin-api.d.ts +349 -49
- package/dist/server-plugin-api.js +344 -2
- package/dist/server-plugin-api.js.map +1 -1
- package/dist/serverPluginRecovery.js +6 -1
- package/dist/serverPluginRecovery.js.map +1 -1
- package/dist/sessiond/activeAgentProfile.js +27 -2
- package/dist/sessiond/activeAgentProfile.js.map +1 -1
- package/dist/sessiond/config.js +4 -3
- package/dist/sessiond/config.js.map +1 -1
- package/dist/sessiond/sessionDaemonClient.js +75 -19
- package/dist/sessiond/sessionDaemonClient.js.map +1 -1
- package/dist/sessiond/sessionDaemonErrors.js +49 -0
- package/dist/sessiond/sessionDaemonErrors.js.map +1 -0
- package/dist/shared/activeAgentProfile.js +2 -34
- package/dist/shared/activeAgentProfile.js.map +1 -1
- package/dist/shared/activity.js +0 -3
- package/dist/shared/activity.js.map +1 -1
- package/dist/shared/apiTypes.js +10 -3
- package/dist/shared/apiTypes.js.map +1 -1
- package/dist/shared/capabilities.js +8 -0
- package/dist/shared/capabilities.js.map +1 -1
- package/dist/shared/federatedRoutes.js +77 -11
- package/dist/shared/federatedRoutes.js.map +1 -1
- package/dist/shared/i18n.js +41 -0
- package/dist/shared/i18n.js.map +1 -0
- package/dist/shared/machinePluginIds.js +30 -7
- package/dist/shared/machinePluginIds.js.map +1 -1
- package/dist/shared/machineStatus.js +46 -3
- package/dist/shared/machineStatus.js.map +1 -1
- package/dist/shared/navigationPreferences.js +6 -0
- package/dist/shared/navigationPreferences.js.map +1 -0
- package/dist/shared/piWebConfigParsing.js +118 -49
- package/dist/shared/piWebConfigParsing.js.map +1 -1
- package/dist/shared/piWebStatusParsing.js +33 -0
- package/dist/shared/piWebStatusParsing.js.map +1 -1
- package/dist/shared/pluginApiTypes.d.ts +87 -8
- package/dist/shared/pluginApiTypes.js +2 -0
- package/dist/shared/pluginApiTypes.js.map +1 -0
- package/dist/shared/pluginBackendProtocol.js +218 -2
- package/dist/shared/pluginBackendProtocol.js.map +1 -1
- package/dist/shared/pluginCatalogTypes.d.ts +49 -0
- package/dist/shared/pluginCatalogTypes.js +156 -0
- package/dist/shared/pluginCatalogTypes.js.map +1 -0
- package/dist/shared/pluginIds.js +10 -1
- package/dist/shared/pluginIds.js.map +1 -1
- package/dist/shared/requiredTerminalPlugin.js +6 -0
- package/dist/shared/requiredTerminalPlugin.js.map +1 -0
- package/dist/shared/serverNoticeContract.js +88 -0
- package/dist/shared/serverNoticeContract.js.map +1 -0
- package/dist/shared/sessionDefaults.js +42 -0
- package/dist/shared/sessionDefaults.js.map +1 -0
- package/dist/shared/sessionMedia.js +12 -0
- package/dist/shared/sessionMedia.js.map +1 -0
- package/dist/shared/streamingBehavior.js +8 -0
- package/dist/shared/streamingBehavior.js.map +1 -0
- package/dist/shared/themePreference.js +24 -0
- package/dist/shared/themePreference.js.map +1 -0
- package/dist/shared/thinkingLevels.js +17 -16
- package/dist/shared/thinkingLevels.js.map +1 -1
- package/dist/shared/workspaceFiles.js.map +1 -1
- package/dist/workspaceNotificationCli.js +95 -0
- package/dist/workspaceNotificationCli.js.map +1 -0
- package/docs/README.md +31 -0
- package/docs/config.md +344 -277
- package/docs/plugins.md +204 -930
- package/examples/session-bridge-plugin/README.md +20 -0
- package/examples/session-bridge-plugin/docs/usage.md +54 -0
- package/examples/session-bridge-plugin/package.json +26 -0
- package/examples/session-bridge-plugin/src/browser/index.ts +87 -0
- package/examples/session-bridge-plugin/src/browser/protocol.ts +24 -0
- package/examples/session-bridge-plugin/src/companion.ts +65 -0
- package/examples/session-bridge-plugin/src/reviewRun.ts +39 -0
- package/examples/session-bridge-plugin/src/server.ts +85 -0
- package/examples/session-bridge-plugin/src/store.ts +80 -0
- package/examples/session-bridge-plugin/tsconfig.json +21 -0
- package/examples/workspace-provider-plugin/README.md +39 -0
- package/examples/workspace-provider-plugin/package.json +25 -0
- package/examples/workspace-provider-plugin/src/browser/index.ts +69 -0
- package/examples/workspace-provider-plugin/src/server.ts +68 -0
- package/examples/workspace-provider-plugin/tsconfig.json +21 -0
- package/extensions/pi-web.ts +3 -1
- package/package.json +59 -36
- package/skills/README.md +28 -2
- package/skills/relay/SKILL.md +24 -89
- package/skills/relay-runner/SKILL.md +74 -0
- package/dist/client/assets/CodeViewer-DCl56K0Z.js +0 -4
- package/dist/client/assets/TerminalPanel-DCvoEjUF.js +0 -187
- package/dist/client/assets/index-CMvms5cF.js +0 -4325
- package/dist/client/assets/vendor-editor-core-vUi74DnD.js +0 -12
- package/dist/client/assets/vendor-editor-languages-DoaXUodB.js +0 -46
- package/dist/client/assets/vendor-editor-legacy-CYBnW6ZU.js +0 -1
- package/dist/client/assets/vendor-terminal-BrP-ENHg.css +0 -1
- package/dist/client/assets/vendor-terminal-D8k4UKM2.js +0 -35
- package/dist/pi-web-plugins/relays/package.json +0 -9
- package/dist/pi-web-plugins/relays/pi-web-plugin.js +0 -44
- package/dist/server/git/gitService.js +0 -290
- package/dist/server/git/gitService.js.map +0 -1
- package/dist/server/gitRoutes.js +0 -23
- package/dist/server/gitRoutes.js.map +0 -1
- package/dist/server/sessions/pendingAskStore.js +0 -278
- package/dist/server/sessions/pendingAskStore.js.map +0 -1
- package/dist/server/terminalProxyRoutes.js +0 -178
- package/dist/server/terminalProxyRoutes.js.map +0 -1
- package/dist/server/terminals/terminalRoutes.js +0 -164
- package/dist/server/terminals/terminalRoutes.js.map +0 -1
- package/dist/server/terminals/terminalService.js.map +0 -1
- package/dist/server/terminals/terminalSize.js +0 -17
- package/dist/server/terminals/terminalSize.js.map +0 -1
- package/dist/server/workspaces/gitWorktreeDiscovery.js +0 -43
- package/dist/server/workspaces/gitWorktreeDiscovery.js.map +0 -1
- package/dist/server/workspaces/workspaceService.js +0 -52
- package/dist/server/workspaces/workspaceService.js.map +0 -1
- /package/dist/{pi-web-plugins → pi-packages}/relays/vendor/README.md +0 -0
- /package/dist/{pi-web-plugins → pi-packages}/relays/vendor/marked.esm.js +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { JsonObject, PiWebPlugin, WorkspacePanelContext } from "@chainingintention/pi-web-cn/plugin-api";
|
|
2
|
+
|
|
3
|
+
const summaries = new Map<string, string>();
|
|
4
|
+
|
|
5
|
+
const plugin = {
|
|
6
|
+
apiVersion: 4,
|
|
7
|
+
name: "工作区提供器示例",
|
|
8
|
+
activate: ({ pluginId, runtimePluginId, html }) => ({
|
|
9
|
+
contributions: {
|
|
10
|
+
actions: [
|
|
11
|
+
{
|
|
12
|
+
id: "workspace.open",
|
|
13
|
+
title: "打开工作区提供器示例",
|
|
14
|
+
enabled: ({ state }) => state.selectedWorkspace?.provider?.pluginId === pluginId,
|
|
15
|
+
run: ({ selectWorkspaceTool }) => {
|
|
16
|
+
selectWorkspaceTool(`${runtimePluginId}:workspace.example-provider`);
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
workspacePanels: [
|
|
21
|
+
{
|
|
22
|
+
id: "workspace.example-provider",
|
|
23
|
+
title: "提供器示例",
|
|
24
|
+
visible: ({ workspace }) => workspace.provider?.pluginId === pluginId,
|
|
25
|
+
render: (context) => {
|
|
26
|
+
const marker = stringMetadata(context.workspace.provider?.metadata, "marker") ?? "未知";
|
|
27
|
+
const summary = summaries.get(workspaceKey(context)) ?? "请从此包的服务端插件获取摘要。";
|
|
28
|
+
return html`
|
|
29
|
+
<section class="toolbar"><strong>工作区提供器示例</strong></section>
|
|
30
|
+
<section class="viewer">
|
|
31
|
+
<p>此工作区由 <code>${pluginId}</code> 提供。</p>
|
|
32
|
+
<p class="muted">接管标记:<code>${marker}</code></p>
|
|
33
|
+
<button
|
|
34
|
+
?disabled=${context.peer?.request === undefined}
|
|
35
|
+
@click=${() => { void refreshSummary(context); }}
|
|
36
|
+
>获取包摘要</button>
|
|
37
|
+
<p aria-live="polite">${summary}</p>
|
|
38
|
+
</section>
|
|
39
|
+
`;
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
} satisfies PiWebPlugin;
|
|
46
|
+
|
|
47
|
+
export default plugin;
|
|
48
|
+
|
|
49
|
+
async function refreshSummary(context: WorkspacePanelContext): Promise<void> {
|
|
50
|
+
const key = workspaceKey(context);
|
|
51
|
+
try {
|
|
52
|
+
if (context.peer?.request === undefined) throw new Error("插件后端不可用");
|
|
53
|
+
const result = await context.peer.request("summary", null);
|
|
54
|
+
if (typeof result !== "string") throw new Error("插件后端返回的摘要无效");
|
|
55
|
+
summaries.set(key, result);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
summaries.set(key, error instanceof Error ? error.message : String(error));
|
|
58
|
+
}
|
|
59
|
+
context.host.requestRender();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function workspaceKey(context: WorkspacePanelContext): string {
|
|
63
|
+
return `${context.machine.id}:${context.workspace.id}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function stringMetadata(metadata: JsonObject | undefined, key: string): string | undefined {
|
|
67
|
+
const value = metadata?.[key];
|
|
68
|
+
return typeof value === "string" ? value : undefined;
|
|
69
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { access } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import type {
|
|
4
|
+
PiWebServerPlugin,
|
|
5
|
+
ProjectInput,
|
|
6
|
+
ProviderClaim,
|
|
7
|
+
ProviderWorkspace,
|
|
8
|
+
ServerPluginPeerRequestContext,
|
|
9
|
+
WorkspaceProvider,
|
|
10
|
+
} from "@chainingintention/pi-web-cn/server-plugin-api";
|
|
11
|
+
|
|
12
|
+
const markerPath = ".pi-web/example-workspace-provider";
|
|
13
|
+
|
|
14
|
+
const plugin: PiWebServerPlugin = {
|
|
15
|
+
apiVersion: 3,
|
|
16
|
+
name: "工作区提供器示例",
|
|
17
|
+
activate({ pluginId, logger }) {
|
|
18
|
+
logger.info("激活工作区提供器示例", { pluginId });
|
|
19
|
+
return {
|
|
20
|
+
workspaceProvider: createWorkspaceProvider(),
|
|
21
|
+
peer: { request: (context) => requestSummary(pluginId, context) },
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default plugin;
|
|
27
|
+
|
|
28
|
+
function createWorkspaceProvider(): WorkspaceProvider {
|
|
29
|
+
return {
|
|
30
|
+
async probe(project: ProjectInput, signal: AbortSignal): Promise<ProviderClaim> {
|
|
31
|
+
signal.throwIfAborted();
|
|
32
|
+
try {
|
|
33
|
+
await access(join(project.path, markerPath));
|
|
34
|
+
signal.throwIfAborted();
|
|
35
|
+
return "claim";
|
|
36
|
+
} catch (error) {
|
|
37
|
+
if (isMissingFile(error)) return "pass";
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
async list(project: ProjectInput, signal: AbortSignal): Promise<ProviderWorkspace[]> {
|
|
42
|
+
signal.throwIfAborted();
|
|
43
|
+
return [{
|
|
44
|
+
key: "main",
|
|
45
|
+
path: project.path,
|
|
46
|
+
label: project.name,
|
|
47
|
+
isMain: true,
|
|
48
|
+
// This object is visible to every browser script and API consumer.
|
|
49
|
+
publicMetadata: { kind: "example", marker: markerPath },
|
|
50
|
+
}];
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function requestSummary(pluginId: string, context: ServerPluginPeerRequestContext): string {
|
|
56
|
+
context.signal.throwIfAborted();
|
|
57
|
+
if (context.operation !== "summary") {
|
|
58
|
+
throw new Error(`不支持的示例工作区操作:${context.operation}`);
|
|
59
|
+
}
|
|
60
|
+
return `${pluginId} 提供工作区 ${context.workspace.label},路径:${context.workspace.path}`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function isMissingFile(error: unknown): boolean {
|
|
64
|
+
return typeof error === "object"
|
|
65
|
+
&& error !== null
|
|
66
|
+
&& "code" in error
|
|
67
|
+
&& Reflect.get(error, "code") === "ENOENT";
|
|
68
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"lib": ["ES2022", "DOM"],
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"rootDir": "src",
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"strict": true,
|
|
11
|
+
"exactOptionalPropertyTypes": true,
|
|
12
|
+
"noUncheckedIndexedAccess": true,
|
|
13
|
+
"noImplicitReturns": true,
|
|
14
|
+
"noFallthroughCasesInSwitch": true,
|
|
15
|
+
"forceConsistentCasingInFileNames": true,
|
|
16
|
+
"verbatimModuleSyntax": true,
|
|
17
|
+
"skipLibCheck": false,
|
|
18
|
+
"noEmitOnError": true
|
|
19
|
+
},
|
|
20
|
+
"include": ["src/**/*.ts"]
|
|
21
|
+
}
|
package/extensions/pi-web.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync } from "node:fs";
|
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import type
|
|
6
|
+
import { getPackageDir, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
7
7
|
|
|
8
8
|
const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
9
9
|
const cliPath = join(packageRoot, "dist", "cli.js");
|
|
@@ -63,6 +63,8 @@ function run(command: string, args: string[], env: NodeJS.ProcessEnv = {}): Prom
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
async function runPiWeb(args: string[], env: NodeJS.ProcessEnv = {}): Promise<{ code: number; output: string }> {
|
|
66
|
+
// Pi resolves this import against its own installation, outside PI WEB's dependency tree.
|
|
67
|
+
env = { ...env, PI_WEB_PI_PACKAGE_DIR: getPackageDir() };
|
|
66
68
|
if (existsSync(cliPath)) {
|
|
67
69
|
return run(process.execPath, [cliPath, ...args], env);
|
|
68
70
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainingintention/pi-web-cn",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.202610.1",
|
|
4
|
+
"description": "Web UI for persistent Pi Coding Agent sessions in real workspaces.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Federico Jaramillo Martinez",
|
|
7
7
|
"type": "module",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"types": "./dist/plugin-api.d.ts"
|
|
11
11
|
},
|
|
12
12
|
"./server-plugin-api": {
|
|
13
|
-
"types": "./dist/server-plugin-api.d.ts"
|
|
13
|
+
"types": "./dist/server-plugin-api.d.ts",
|
|
14
|
+
"import": "./dist/server-plugin-api.js"
|
|
14
15
|
}
|
|
15
16
|
},
|
|
16
17
|
"typesVersions": {
|
|
@@ -35,7 +36,12 @@
|
|
|
35
36
|
"README.md",
|
|
36
37
|
"LICENSE",
|
|
37
38
|
"skills/relay/SKILL.md",
|
|
39
|
+
"skills/relay-runner/SKILL.md",
|
|
38
40
|
"extensions",
|
|
41
|
+
"examples/workspace-provider-plugin",
|
|
42
|
+
"examples/session-bridge-plugin",
|
|
43
|
+
"!examples/**/node_modules",
|
|
44
|
+
"!examples/**/dist",
|
|
39
45
|
"docs/plugins.md",
|
|
40
46
|
"docs/config.md",
|
|
41
47
|
"docs/assets",
|
|
@@ -44,8 +50,8 @@
|
|
|
44
50
|
],
|
|
45
51
|
"scripts": {
|
|
46
52
|
"dev": "bash -c 'trap \"kill 0\" EXIT; npm run dev:sessiond & npm run dev:web & npm run dev:client & wait'",
|
|
47
|
-
"dev:sessiond": "
|
|
48
|
-
"dev:web": "
|
|
53
|
+
"dev:sessiond": "node scripts/dev-sessiond.mjs --watch",
|
|
54
|
+
"dev:web": "tsc -p tsconfig.plugins.json && node scripts/dev-web.mjs",
|
|
49
55
|
"dev:server": "npm run dev:web",
|
|
50
56
|
"dev:client": "vite --host 0.0.0.0",
|
|
51
57
|
"dev:plugins": "node scripts/build-plugins.mjs --watch",
|
|
@@ -53,15 +59,18 @@
|
|
|
53
59
|
"build:plugin-api": "tsc -p tsconfig.plugin-api.json",
|
|
54
60
|
"build:plugins": "tsc -p tsconfig.plugins.json && node scripts/build-plugins.mjs",
|
|
55
61
|
"capture:screenshots": "node scripts/capture-screenshots.mjs",
|
|
62
|
+
"perf:load": "node scripts/perf-load.mjs",
|
|
56
63
|
"typecheck": "tsc --noEmit",
|
|
57
64
|
"typecheck:cached": "tsc --noEmit --incremental --tsBuildInfoFile node_modules/.cache/pi-web/typecheck.tsbuildinfo",
|
|
58
65
|
"knip": "knip",
|
|
59
|
-
"lint": "eslint \"src/**/*.ts\" \"extensions/**/*.ts\" \"pi-web-plugins/**/*.ts\" vite.config.ts vitest.config.ts",
|
|
66
|
+
"lint": "eslint \"src/**/*.ts\" \"extensions/**/*.ts\" \"pi-web-plugins/**/*.ts\" \"pi-packages/**/*.ts\" \"test-fixtures/browser/**/*.ts\" vite.config.ts vitest.config.ts vitest.artifacts.config.ts playwright.config.ts",
|
|
60
67
|
"test": "vitest run --config vitest.config.ts",
|
|
68
|
+
"test:browser": "playwright test",
|
|
69
|
+
"check:artifacts": "vitest run --config vitest.artifacts.config.ts",
|
|
61
70
|
"verify": "npm run typecheck && npm run lint && npm run knip && npm test",
|
|
62
71
|
"verify:staged": "node scripts/verify-staged.mjs",
|
|
63
72
|
"start": "tsx src/server/index.ts",
|
|
64
|
-
"start:sessiond": "
|
|
73
|
+
"start:sessiond": "node scripts/dev-sessiond.mjs",
|
|
65
74
|
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
66
75
|
"prepack": "npm run build",
|
|
67
76
|
"pack:dry": "npm pack --dry-run",
|
|
@@ -74,52 +83,61 @@
|
|
|
74
83
|
"changelog:status": "changeset status"
|
|
75
84
|
},
|
|
76
85
|
"dependencies": {
|
|
77
|
-
"@codemirror/commands": "^6.
|
|
86
|
+
"@codemirror/commands": "^6.11.1",
|
|
78
87
|
"@codemirror/lang-css": "^6.3.1",
|
|
79
88
|
"@codemirror/lang-go": "^6.0.1",
|
|
80
89
|
"@codemirror/lang-html": "^6.4.11",
|
|
81
90
|
"@codemirror/lang-javascript": "^6.2.5",
|
|
82
91
|
"@codemirror/lang-json": "^6.0.2",
|
|
83
|
-
"@codemirror/lang-markdown": "^6.5.
|
|
92
|
+
"@codemirror/lang-markdown": "^6.5.2",
|
|
84
93
|
"@codemirror/lang-python": "^6.2.1",
|
|
85
94
|
"@codemirror/lang-rust": "^6.0.2",
|
|
86
|
-
"@codemirror/language": "^6.
|
|
95
|
+
"@codemirror/language": "^6.13.1",
|
|
87
96
|
"@codemirror/legacy-modes": "^6.5.3",
|
|
88
|
-
"@codemirror/state": "^6.7.
|
|
89
|
-
"@codemirror/view": "
|
|
90
|
-
"@fastify/compress": "^9.
|
|
91
|
-
"@fastify/static": "^
|
|
92
|
-
"@fastify/websocket": "^11.3.
|
|
97
|
+
"@codemirror/state": "^6.7.6",
|
|
98
|
+
"@codemirror/view": "6.43.13",
|
|
99
|
+
"@fastify/compress": "^9.2.2",
|
|
100
|
+
"@fastify/static": "^10.1.6",
|
|
101
|
+
"@fastify/websocket": "^11.3.4",
|
|
93
102
|
"@xterm/addon-fit": "^0.11.0",
|
|
94
103
|
"@xterm/xterm": "^6.0.0",
|
|
104
|
+
"css-tree": "^3.2.1",
|
|
95
105
|
"diff": "^9.0.0",
|
|
96
|
-
"fastify": "^5.
|
|
106
|
+
"fastify": "^5.12.7",
|
|
107
|
+
"highlight.js": "^11.12.0",
|
|
108
|
+
"image-size": "^2.0.4",
|
|
109
|
+
"import-meta-resolve": "^4.2.0",
|
|
97
110
|
"lit": "^3.3.3",
|
|
98
|
-
"marked": "^18.
|
|
111
|
+
"marked": "^18.1.1",
|
|
99
112
|
"node-pty": "^1.1.0",
|
|
100
|
-
"typebox": "1.3.
|
|
101
|
-
"
|
|
113
|
+
"pi-web-typebox": "npm:typebox@1.3.37",
|
|
114
|
+
"undici": "^8.11.2",
|
|
115
|
+
"ws": "^8.22.0",
|
|
102
116
|
"yauzl": "^3.4.0"
|
|
103
117
|
},
|
|
104
118
|
"devDependencies": {
|
|
105
|
-
"@changesets/cli": "^
|
|
106
|
-
"@earendil-works/pi-agent-core": "
|
|
107
|
-
"@earendil-works/pi-ai": "
|
|
108
|
-
"@earendil-works/pi-coding-agent": "
|
|
119
|
+
"@changesets/cli": "^3.0.3",
|
|
120
|
+
"@earendil-works/pi-agent-core": "1.3.0",
|
|
121
|
+
"@earendil-works/pi-ai": "1.3.0",
|
|
122
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
109
123
|
"@eslint/js": "^10.0.1",
|
|
110
|
-
"@
|
|
111
|
-
"@types/
|
|
124
|
+
"@playwright/test": "^1.64.1",
|
|
125
|
+
"@types/css-tree": "^3.2.0",
|
|
126
|
+
"@types/node": "^26.6.5",
|
|
127
|
+
"@types/ws": "^8.18.2",
|
|
112
128
|
"@types/yauzl": "^2.10.3",
|
|
113
129
|
"@types/yazl": "^2.4.6",
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
130
|
+
"dompurify": "^3.4.17",
|
|
131
|
+
"eslint": "^10.12.0",
|
|
132
|
+
"globals": "^17.13.0",
|
|
133
|
+
"happy-dom": "^20.14.6",
|
|
134
|
+
"knip": "^6.41.0",
|
|
135
|
+
"mermaid": "^12.2.0",
|
|
136
|
+
"tsx": "^4.23.15",
|
|
119
137
|
"typescript": "^6.0.3",
|
|
120
|
-
"typescript-eslint": "^8.
|
|
121
|
-
"vite": "^8.
|
|
122
|
-
"vitest": "^
|
|
138
|
+
"typescript-eslint": "^8.71.2",
|
|
139
|
+
"vite": "^8.3.4",
|
|
140
|
+
"vitest": "^5.0.4",
|
|
123
141
|
"yazl": "^3.3.1"
|
|
124
142
|
},
|
|
125
143
|
"publishConfig": {
|
|
@@ -138,9 +156,14 @@
|
|
|
138
156
|
"homepage": "https://github.com/nayuto-wakusei/pi-web-ChineseTranslation#readme",
|
|
139
157
|
"packageManager": "npm@11.11.0",
|
|
140
158
|
"peerDependencies": {
|
|
141
|
-
"@earendil-works/pi-agent-core": "
|
|
142
|
-
"@earendil-works/pi-ai": "
|
|
143
|
-
"@earendil-works/pi-coding-agent": "
|
|
159
|
+
"@earendil-works/pi-agent-core": "0.86.1 || 0.87.0 || 1.3.0",
|
|
160
|
+
"@earendil-works/pi-ai": "0.86.1 || 0.87.0 || 1.3.0",
|
|
161
|
+
"@earendil-works/pi-coding-agent": "0.86.1 || 0.87.0 || 1.3.0"
|
|
162
|
+
},
|
|
163
|
+
"peerDependenciesMeta": {
|
|
164
|
+
"@earendil-works/pi-agent-core": { "optional": true },
|
|
165
|
+
"@earendil-works/pi-ai": { "optional": true },
|
|
166
|
+
"@earendil-works/pi-coding-agent": { "optional": true }
|
|
144
167
|
},
|
|
145
168
|
"keywords": [
|
|
146
169
|
"pi-package",
|
package/skills/README.md
CHANGED
|
@@ -4,9 +4,35 @@ Distributable agent skills developed alongside pi-web.
|
|
|
4
4
|
|
|
5
5
|
## relay
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
A tool-agnostic foundation for the [Relay Principle](https://relayprinciple.ai/):
|
|
8
|
+
carry long work through a chain of fresh agent contexts, one bounded leg and one
|
|
9
|
+
durable handoff at a time, without a standing coordinator or role hierarchy.
|
|
10
|
+
It centers the agreed finish line, relay-specific scope, compact baton, durable
|
|
11
|
+
history, and visible completion or need for help.
|
|
9
12
|
|
|
10
13
|
```bash
|
|
11
14
|
npx skills add jmfederico/pi-web --skill relay -a pi -g
|
|
12
15
|
```
|
|
16
|
+
|
|
17
|
+
## relay-runner
|
|
18
|
+
|
|
19
|
+
The Pi session and record mechanics used by `/relay` and `/relay-worktree`.
|
|
20
|
+
Preparation clarifies the goal and boundaries with the human and requires explicit
|
|
21
|
+
approval before dispatch. Each fresh runner chooses its next useful slice, keeps
|
|
22
|
+
`charter.md`, `status.md`, and `log.md` durable, and hands off once or stops.
|
|
23
|
+
An optional `decisions.md` keeps consequential reasoning out of the baton.
|
|
24
|
+
The runner requires a fresh-context final review, with at most three attempts,
|
|
25
|
+
without scripting the development route. Project instructions and applicable
|
|
26
|
+
skills govern the work. Dispatch and handoff prompts select both Relay skills.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx skills add jmfederico/pi-web --skill relay-runner -a pi -g
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`relay-runner` is not standalone; install the base `relay` skill as well when
|
|
33
|
+
using these commands directly. The `relays` Pi package ships and installs both
|
|
34
|
+
skills atomically. Its files under
|
|
35
|
+
`pi-packages/relays/skills/` are symlinks to the canonical `SKILL.md` files in
|
|
36
|
+
this directory; the package build (`npm run build:plugins`, or the dev watch)
|
|
37
|
+
materializes them as real packaged files. Edit the canonical copies here, not
|
|
38
|
+
the package links.
|
package/skills/relay/SKILL.md
CHANGED
|
@@ -1,115 +1,50 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: relay
|
|
3
|
-
description: "
|
|
3
|
+
description: "Carry work across a chain of fresh agent contexts using a shared goal, compact baton, and durable record. Use when a user invokes Relay, discusses the Relay method, prepares a Relay, or continues an active Relay. Do not load for generic multi-step work or ordinary delegation."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Relay
|
|
7
7
|
|
|
8
|
-
Relay
|
|
8
|
+
A Relay carries work across fresh agent contexts until the agreed goal is reached or an agent needs human help. Each context owns one useful slice, called a **leg**. There is no standing coordinator or fixed set of agent roles.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Follow the [Relay Principle](https://relayprinciple.ai/): give agents a destination and enough continuity to act, rather than recreating a management structure around them.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Finish line over plan
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Help the human express what they want built and how they will recognize it is done. Resolve material ambiguity before dispatch. An existing requirements document can supply the goal; reference it rather than rewriting it into a larger specification.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Keep the goal stable and the route adaptable. Each runner checks the finish line against the current work and chooses the next useful slice. Changing the goal requires human agreement; changing implementation or sequencing within scope does not.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
## Scope over script
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
- **Hand off exactly once, at the end.** Do not spawn early, do not spawn several runners "to parallelize," and never spawn while you still have work in flight. One leg, one handoff.
|
|
20
|
+
Record the relay-specific boundaries, limitations, conditions, and clarifications needed to understand the request. Preserve technical requirements and any other details the human explicitly asks to include.
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
Do not invent an implementation roadmap, speculative requirements, or a new software process. Project instructions, skills, and harness conventions remain where they belong; each runner discovers and follows what applies to its work. A Relay does not replace or weaken those rules.
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
## Handoff over handhold
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
A baton says **where we are**, not **how you must work**. Avoid suggesting or assigning the next slice: even a provisional suggestion can anchor the successor. Record remaining gaps and concrete dependencies instead, and trust the successor to inspect reality and choose its slice.
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
Choose a meaningful increment that fits one context, not the tiniest possible task. Investigation and related work can stay together. Leg boundaries protect context quality, not organizational ownership.
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
- **Goal / finish line.** A concrete, achievable end state. Without this the relay runs forever — this is non-negotiable.
|
|
33
|
-
- **Sizing.** How much is *one leg*? This is project- and plan-specific; the charter defines it (a task, a slice, a time/scope budget — whatever fits). The skill does not decide this for you.
|
|
34
|
-
- **Task selection policy.** How a runner chooses the next task when `status.md` does not name one explicitly.
|
|
35
|
-
- **Handover.** How a runner hands off: what the spawn prompt should say and what the next runner must read. A normal handoff starts with a natural header containing the relay name and next leg number, then points at `charter.md` and `status.md`, not the full log.
|
|
36
|
-
- **Intervention signal.** When and how a runner must stop and get the human, and how that is made visible. The charter must define this; the skill does not define it for you.
|
|
37
|
-
- **Reading discipline.** The files a runner should read to orient, and any files that should not be read defensively.
|
|
30
|
+
Finish ongoing work and preserve the state before starting at most one fresh successor. Handoff is the final operational action; only a user-facing summary follows. Do not watch or steer the successor.
|
|
38
31
|
|
|
39
|
-
|
|
32
|
+
## Record over memory
|
|
40
33
|
|
|
41
|
-
|
|
34
|
+
Keep three kinds of durable information:
|
|
42
35
|
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
46
|
-
- **Relevant context.** Only the files, sections, commands, artifacts, or specific log entries needed for the next leg.
|
|
47
|
-
- **Progress documentation.** Where this runner must write progress: update `status.md`, append `log.md`, update artifacts, commit, etc.
|
|
48
|
-
- **Blockers / intervention state.** Current risks, open decisions, or active reasons to stop.
|
|
36
|
+
- **Goal:** the agreed finish line and relay-specific scope. Current status cannot override it.
|
|
37
|
+
- **Baton:** current position, completed work, what remains, relevant evidence and decisions, useful pointers, and any blocker.
|
|
38
|
+
- **History:** concise entries recording each leg's result, decisions, artifacts, checks, and handoff or stop.
|
|
49
39
|
|
|
50
|
-
|
|
40
|
+
Keep the baton compact. Use history for targeted lookup, not mandatory reconstruction. Inspect the actual work as needed; the record saves rediscovering prior decisions, not reading the project.
|
|
51
41
|
|
|
52
|
-
|
|
42
|
+
## Signal over spin
|
|
53
43
|
|
|
54
|
-
|
|
44
|
+
Stop when the finish line is met, with evidence. Completion does not require finding another improvement.
|
|
55
45
|
|
|
56
|
-
|
|
46
|
+
Stop visibly when progress needs human input: record the blocker, what was tried, and the specific decision or help needed. If successive legs keep revisiting the same issue without new evidence or meaningful progress, surface that stall instead of spawning another attempt.
|
|
57
47
|
|
|
58
|
-
|
|
48
|
+
Optional cleanup, hypothetical risks, and a desire for perfection are not reasons to prolong the chain. Revisit a settled decision when facts change or concrete evidence shows it was wrong, not merely because a fresh agent has arrived.
|
|
59
49
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
1. `charter.md`
|
|
63
|
-
2. `status.md`
|
|
64
|
-
3. Only the specific files or log entries referenced for the current leg
|
|
65
|
-
|
|
66
|
-
Do not defensively rebuild the relay's full history. Do not read the full log, the full backlog, or a large artifact tree just because they exist. The relay stays scalable because each runner pays only for the context needed now.
|
|
67
|
-
|
|
68
|
-
If `status.md` is insufficient, fix the baton rather than compensating by reading everything. Use targeted inspection to clarify the current state, update `status.md` so the next runner has a clean start, and continue only if the task is still clear. If reconstructing the state would require broad archaeology or judgment about past intent, stop and raise the intervention signal.
|
|
69
|
-
|
|
70
|
-
## Running one leg
|
|
71
|
-
|
|
72
|
-
This is the loop you run when you are dispatched into a relay.
|
|
73
|
-
|
|
74
|
-
1. **Orient from the packet.** Read `charter.md` and `status.md`. Confirm the relay name/root, goal, sizing, handoff protocol, last completed leg, next leg to run, intervention signal, and current/next task. If you are not sure you are in a relay, the prompt or `.pi-web/relays/` is your clue — and reading this skill means you are.
|
|
75
|
-
2. **Choose the leg.** Prefer the explicit current/next task in `status.md`. If none is named, apply the charter's task selection policy. If that still requires context, inspect only the referenced plan/backlog/artifact sections. If the next task is still ambiguous or would materially change direction, stop and involve the human.
|
|
76
|
-
3. **Re-anchor to the goal.** Does the goal still make sense given the status and what you now see? If reality has diverged from the charter, that is often an intervention moment — don't quietly redefine the task.
|
|
77
|
-
4. **Run one leg.** Do exactly one well-sized slice, per the charter's sizing. Resist doing "just a bit more" — extra scope bloats context and breaks the containment that makes Relay work.
|
|
78
|
-
5. **Document progress.** Make all work durable. Update `status.md` with the new current state, last completed leg, next leg to run (if any), next task or task-selection pointer, relevant context for the next runner, and blockers. Append a concise `log.md` entry with what you did, why, decisions made, artifacts changed, and whether you are handing off or stopping.
|
|
79
|
-
6. **Decide: hand off, or stop.**
|
|
80
|
-
- **Hand off** if there is a clear next leg and you are on track. Use `spawn_session` once, with a prompt whose first line is a natural task header containing the relay name and next leg number (for example, `Relay "<name>" leg <N> begins now.`), followed by the Relay method and pointers to `charter.md` and `status.md` (so this skill loads and they can orient cheaply). Then you are done. Handoff is deliberately fire-and-forget: `spawn_session` starts an independent session you will not see and cannot steer — do not reach for a tracked subsession to keep an eye on it. Letting go is the point. The next runner is trusted to run their own leg, and the relay packet is the only thread between you; if you feel the need to watch downstream work, that usually means the leg wasn't sized or handed off cleanly, or an intervention signal should have fired.
|
|
81
|
-
- **Stop — do not spawn —** if the goal is reached, or you are blocked, or the charter's intervention signal fires. Update `status.md`, append a clear note in `log.md`, and raise the intervention signal so the watching human sees exactly what happened and what they need to decide. A stalled relay that stopped cleanly with a clear blocker is a success; a relay that spawned a confused next runner is a failure.
|
|
82
|
-
|
|
83
|
-
A good handoff prompt is short and explicit. Put the relay identity and leg number at the very beginning so PI-WEB's session title generator sees useful distinguishing context without any naming instruction:
|
|
84
|
-
|
|
85
|
-
```text
|
|
86
|
-
Relay "<name>" leg <N> begins now.
|
|
87
|
-
|
|
88
|
-
You are the next runner in this Relay method chain.
|
|
89
|
-
|
|
90
|
-
Read:
|
|
91
|
-
- .pi-web/relays/<name>/charter.md
|
|
92
|
-
- .pi-web/relays/<name>/status.md
|
|
93
|
-
|
|
94
|
-
Do not read log.md end-to-end. Use it only for targeted lookup if status.md or charter.md points you there.
|
|
95
|
-
|
|
96
|
-
Run one leg according to the charter. Before handing off, update status.md, append log.md, make work durable, then either spawn the next leg once or stop with a clear intervention note.
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Planning a relay
|
|
100
|
-
|
|
101
|
-
When the user asks to set up a relay, your job is to produce the relay packet: `charter.md`, `status.md`, and `log.md`. The charter must have the required slots filled: relay identity, goal, sizing, task selection policy, handover, intervention signal, and reading discipline. The initial status must give the first runner a compact baton: current position, leg tracking (usually last completed leg 0 and next leg to run 1 for a new relay), first task or task selection pointer, relevant context, documentation expectations, and known blockers. The log may start empty or with a short seed entry explaining that the relay was created.
|
|
102
|
-
|
|
103
|
-
Draw the required choices out from the user rather than inventing them: ask what the finish line is, how much should be one leg, how runners pick tasks, how runners hand off, what they should read, and when they must stop and get the human. Sizing, task selection, and the intervention signal especially are the user's to decide — propose options if it helps them think, but do not quietly settle them yourself.
|
|
104
|
-
|
|
105
|
-
Do **not** impose what a "good" plan, leg size, or cadence looks like — those are deeply project-, plan-, and human-specific, and getting them wrong by being prescriptive is worse than leaving them to the user. Your value in planning is making sure the relay is *runnable*: the finish line exists, sizing is stated, task selection is stated, handover is stated, reading discipline is stated, and the intervention signal is stated. Once the packet is agreed, you can dispatch the first leg with `spawn_session`.
|
|
106
|
-
|
|
107
|
-
## Smells to watch for
|
|
108
|
-
|
|
109
|
-
- **No finish line** → infinite relay. Refuse to run a relay without a defined goal.
|
|
110
|
-
- **Goal drift** → each leg quietly restates the task. Re-anchor every leg.
|
|
111
|
-
- **Charter churn** → the charter changes every leg. The design isn't settled; involve the human.
|
|
112
|
-
- **Status bloat** → `status.md` turns into a history dump. Compress it to current state plus targeted pointers.
|
|
113
|
-
- **Defensive reading** → reading the full log/backlog/artifact tree to feel safe. Use the packet and targeted lookups; stop if the baton is not enough.
|
|
114
|
-
- **Eager spawning** → spawning early, spawning several runners, or spawning before work is durable. One leg, one handoff, at the end.
|
|
115
|
-
- **Silent stall** → getting stuck and stopping with no note, or spawning anyway. Always update status, log the blocker, and surface it.
|
|
50
|
+
Tools, storage, and session creation belong to the environment-specific runner skill, not the definition of Relay.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: relay-runner
|
|
3
|
+
description: "Prepare and run Relay legs in Pi: keep the goal, baton, and log durable, then hand off to one fresh session or stop visibly. Use with relay for /relay, /relay-worktree, or a handoff naming relay-runner. Supplies continuity and a bounded fresh-context final review without prescribing the development route."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Relay runner
|
|
7
|
+
|
|
8
|
+
This skill binds the `relay` method to Pi sessions and a small file packet. It supplies continuity and one completion gate: a fresh-context final review. The development route remains adaptive. Each agent discovers applicable project instructions and skills through the repository and harness; do not copy them into the packet or preselect them for future legs.
|
|
9
|
+
|
|
10
|
+
## Packet
|
|
11
|
+
|
|
12
|
+
Use `.pi-web/relays/<name>/` in the working checkout unless the user selects another location inside the target workspace. Start with three files:
|
|
13
|
+
|
|
14
|
+
- **`charter.md` — goal.** The agreed outcome and recognizable finish line, relay-specific scope boundaries and clarifications, and any explicit human requirements. Reference an existing specification when useful. Do not add project rules, implementation plans, or generic quality or delivery procedures; include such details only when the human explicitly asks.
|
|
15
|
+
- **`status.md` — baton.** State (`Draft — awaiting approval; not dispatched`, `Active`, `Complete`, or `Needs help`), last completed leg and next leg number, working location, current progress, remaining gaps to the goal, relevant checks, current review state, targeted pointers, and blockers. Include only what is useful now. Avoid suggesting the next slice; record remaining gaps and concrete dependencies instead.
|
|
16
|
+
- **`log.md` — history.** Append a short entry per leg: what changed or was learned, important decisions and why, artifact or commit references, checks and actual results, and the next leg or stop. Record human approval and scope changes here too.
|
|
17
|
+
|
|
18
|
+
Charter = agreement; status = position; decisions = durable reasoning; log = history. Keep revisions in the log, not a separate revisions document; no decision template is required. Status, decisions, and the log cannot silently change the agreement. Keep relay-specific decisions durable without adding documents merely to satisfy a template. The packet is not a second home for project policy or this skill's instructions.
|
|
19
|
+
|
|
20
|
+
Add **`decisions.md` only when useful**: a compact, living record of consequential decisions and their reasons, including rejected approaches or review concerns worth remembering. Keep current conclusions there and record revisions in the log. Link it from status and consult relevant entries rather than duplicating the reasoning in the baton. It is not a plan, task list, or another home for project rules. Human changes to the goal or scope still belong in the charter. Do not create an empty register or impose a decision template.
|
|
21
|
+
|
|
22
|
+
## Preparation and dispatch
|
|
23
|
+
|
|
24
|
+
The preparation prompt owns discussion and approval. Drafting is allowed before approval; `dispatch_relay` is not. After the human reviews the goal and boundaries, require an explicit **Approve and dispatch** response. If the approved goal, scope, or working target changes materially, obtain fresh approval.
|
|
25
|
+
|
|
26
|
+
Use the current checkout for `/relay` unless the user chooses another. For `/relay-worktree`, create a fresh branch and worktree after approval, following project conventions; use current HEAD as the starting point unless another base is agreed. Ask about a material target ambiguity rather than guessing. Move the draft packet into the target checkout before dispatch, update its location, and remove the stale drafting copy.
|
|
27
|
+
|
|
28
|
+
Record the actual checkout and, in Git, branch and starting commit in status. Keep packet files out of delivery commits using an existing ignore rule or a local Git exclusion. Leave unrelated existing work untouched. Bootstrap the target as needed under project conventions; setup does not automatically require a separate leg.
|
|
29
|
+
|
|
30
|
+
Record approval in status/log, mark status `Active`, and seed leg 1. The first runner chooses its own slice; preparation need not prescribe one. Dispatch with the same handoff mechanics used by later legs.
|
|
31
|
+
|
|
32
|
+
## Run a leg
|
|
33
|
+
|
|
34
|
+
1. Read the charter and status, then inspect relevant project guidance and work. Consult only the history or supporting material needed to understand the current state. Repair small record gaps with targeted inspection; ask for help if the goal or ownership is unclear.
|
|
35
|
+
2. Compare reality with the finish line and completion requirements, including the final review below. If all are satisfied, record completion and stop. Otherwise choose one useful, context-sized slice that closes a remaining gap. Briefly state in the session which slice you chose and how it advances the goal.
|
|
36
|
+
3. Do the work and the checks appropriate to it under project conventions. Record failed, skipped, or incomplete checks honestly.
|
|
37
|
+
4. Make the result durable before handoff. In Git, commit the leg's changes when project policy and human instructions permit, without including unrelated changes or the packet. Otherwise record the exact saved work and why it is uncommitted. Finish any helpers before handing off.
|
|
38
|
+
5. Refresh the compact status and append the log entry. Record progress against the goal, important evidence and decisions, remaining gaps, and any limitations the successor needs to know. Then complete, ask for help, or hand off once.
|
|
39
|
+
|
|
40
|
+
Other reviews, delivery steps, and gates apply only when the human or project requires them. Keep this skill's review procedure here, not copied into the packet.
|
|
41
|
+
|
|
42
|
+
## Final review
|
|
43
|
+
|
|
44
|
+
When a leg finishes substantive work and believes implementation is done, record that final review is pending and hand off to a fresh leg. A fresh runner finding implementation complete with review pending performs the review instead of passing it on again. Leave substantive corrections to another leg so the review stays independent.
|
|
45
|
+
|
|
46
|
+
Review the whole relay result, not just the last slice, against the charter and applicable project guidance. Approve when no concrete, evidence-backed in-scope blocker remains. Optional improvements, speculative concerns, and unrelated pre-existing shortcomings do not block completion. Record consequential finding dispositions in `decisions.md` when useful.
|
|
47
|
+
|
|
48
|
+
Allow **at most three review attempts total**: the initial review and up to two post-correction reviews, not three mandatory passes. Keep the attempt count, latest result, and reviewed work reference in status; put evidence and findings in the log or link to decisions. Subsequent attempts happen only after concrete corrections and focus on those corrections and changed evidence, carrying supported prior decisions forward rather than restarting an expanding audit.
|
|
49
|
+
|
|
50
|
+
If the third attempt still has blockers, or a required further review would exceed the budget, mark `Needs help`, record what remains, and stop without dispatching another review or correction leg. A valid approval satisfies the gate; a new context or packet-only update does not reopen it. Material changes to the reviewed result require re-review within the same budget.
|
|
51
|
+
|
|
52
|
+
## Stop or hand off
|
|
53
|
+
|
|
54
|
+
Mark `Complete` and report the result and evidence when no required work remains and final review has passed for the current result. Do not spawn a successor to search for extra work.
|
|
55
|
+
|
|
56
|
+
Mark `Needs help` when a decision, permission, environment problem, or lack of progress prevents responsible continuation. Record the concrete blocker, attempts and evidence, and the smallest question or action needed from the human. Surface it clearly in the user-facing response; use `ask_user` when an answer is needed. Do not hand a human-dependent blocker to another context hoping it will disappear.
|
|
57
|
+
|
|
58
|
+
Before continuing, check that concrete required work remains, including any pending final review; leave slice selection to the successor.
|
|
59
|
+
|
|
60
|
+
For handoff, finish work and all packet writes first. The charter supplies the goal and saved `status.md` is the actual baton: save progress, remaining gaps, decisions, checks and blockers there, with targeted pointers to supporting records as needed. Do not put missing continuity into a separate handover prompt.
|
|
61
|
+
|
|
62
|
+
Call the dedicated `dispatch_relay` tool at most once with the saved directory as `packet`, the next leg identity as `leg`, and the target checkout as `cwd`. A relative `packet` resolves inside that `cwd`; custom packet locations must also stay inside the target workspace. Pass `leg` as a string: the next leg number written as `"2"`, or an explicitly chosen identifier of 1–32 letters, digits, dots, underscores or hyphens, starting with a letter or digit. Non-string values are rejected rather than converted. For example, substitute the actual paths and next leg:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"packet": ".pi-web/relays/<name>",
|
|
67
|
+
"leg": "2",
|
|
68
|
+
"cwd": "/absolute/path/to/checkout"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The tool validates the saved packet, generates the handover instructions, and records explicit Relay identity and a predictable session name. It accepts no free-form prompt and starts an independent session; do not substitute a generic session tool or tracked subsession. Omit `model` and `thinkingLevel` to inherit them unless the human instructed otherwise; keep any relay-wide instruction in the packet.
|
|
73
|
+
|
|
74
|
+
`dispatch_relay` is the final operational action. After it returns, give only a brief handoff summary: no further tool use, packet writes, work, or downstream supervision. If the tool is unavailable or dispatch fails, report the failure rather than claiming the next leg started.
|