@chainingintention/pi-web-cn 1.202610.1 → 1.202610.3
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 +60 -106
- package/dist/.plugins-ready +1 -0
- package/dist/cli.js +161 -45
- package/dist/cli.js.map +1 -1
- package/dist/client/assets/index-CFhaGb5m.js +4357 -0
- package/dist/client/assets/vendor-editor-core-YWog6mAR.js +10 -0
- package/dist/client/assets/vendor-editor-languages-DOCw3vc9.js +28 -0
- package/dist/client/index.html +5 -5
- package/dist/config.js +30 -6
- package/dist/config.js.map +1 -1
- package/dist/docker/piWebDockerCommandPlan.js +13 -4
- package/dist/docker/piWebDockerCommandPlan.js.map +1 -1
- package/dist/nativeServices/installedServiceDefinitions.js +23 -10
- package/dist/nativeServices/installedServiceDefinitions.js.map +1 -1
- package/dist/nativeServices/serviceAction.js +78 -20
- package/dist/nativeServices/serviceAction.js.map +1 -1
- package/dist/nativeServices/serviceDoctor.js +339 -67
- 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 +146 -0
- package/dist/pi-packages/captains-log/dist/browser/markdown.js +67 -0
- package/dist/pi-packages/captains-log/dist/browser/panel.js +151 -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/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/pi-web-plugin.js +9 -9
- package/dist/pi-packages/relays/prompts/relay.md +1 -1
- package/dist/pi-packages/relays/relaysPanelElement.js +8 -8
- package/dist/pi-packages/relays/skills/relay-runner/SKILL.md +21 -13
- 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 +456 -0
- package/dist/pi-web-plugins/files/package.json +15 -0
- package/dist/pi-web-plugins/git/browser/git-panel.js +55 -32
- package/dist/pi-web-plugins/git/browser/pi-web-plugin.js +2 -2
- package/dist/pi-web-plugins/git/git-backend.js +19 -26
- package/dist/pi-web-plugins/git/gitStatusCache.js +48 -0
- package/dist/pi-web-plugins/git/package.json +1 -0
- package/dist/pi-web-plugins/git/server-plugin.js +11 -10
- package/dist/pi-web-plugins/info/infoInternals.js +4 -1
- package/dist/pi-web-plugins/info/package.json +1 -1
- package/dist/pi-web-plugins/info/pi-web-plugin.js +8 -8
- package/dist/pi-web-plugins/mermaid/browser/mermaid-engine.js +3590 -0
- package/dist/pi-web-plugins/mermaid/browser/pi-web-plugin.js +6 -0
- package/dist/pi-web-plugins/mermaid/package.json +13 -0
- package/dist/pi-web-plugins/terminal/browser/pi-web-plugin.js +210 -0
- package/dist/pi-web-plugins/terminal/package.json +16 -0
- package/dist/pi-web-plugins/terminal/server-plugin.js +365 -0
- package/dist/pi-web-plugins/terminal/terminalService.js +435 -0
- package/dist/pi-web-plugins/updates/package.json +1 -1
- package/dist/pi-web-plugins/updates/pi-web-plugin.js +69 -68
- package/dist/pi-web-plugins/workspace-tasks/package.json +1 -1
- package/dist/pi-web-plugins/workspace-tasks/pi-web-plugin.js +3 -3
- package/dist/piWebVersionReport.js +47 -24
- package/dist/piWebVersionReport.js.map +1 -1
- package/dist/plugin-api.d.ts +260 -25
- package/dist/plugin-api.js +1 -0
- package/dist/pluginRecoveryCli.js +3 -2
- package/dist/pluginRecoveryCli.js.map +1 -1
- package/dist/server/activity/workspaceActivityService.js +5 -5
- package/dist/server/activity/workspaceActivityService.js.map +1 -1
- package/dist/server/app.js +71 -44
- package/dist/server/app.js.map +1 -1
- package/dist/server/audit/managementAuditStore.js +1 -1
- package/dist/server/browserMessageProjection.js +0 -2
- package/dist/server/browserMessageProjection.js.map +1 -1
- package/dist/server/configRoutes.js +1 -2
- package/dist/server/configRoutes.js.map +1 -1
- package/dist/server/knownPiPackages.js +12 -0
- package/dist/server/knownPiPackages.js.map +1 -0
- package/dist/server/machines/machineClient.js +2 -2
- package/dist/server/machines/machineClient.js.map +1 -1
- package/dist/server/machines/machinePluginProxyRoutes.js +120 -21
- package/dist/server/machines/machinePluginProxyRoutes.js.map +1 -1
- package/dist/server/machines/machineProxyRoutes.js +80 -22
- package/dist/server/machines/machineProxyRoutes.js.map +1 -1
- package/dist/server/machines/machineService.js +22 -0
- package/dist/server/machines/machineService.js.map +1 -1
- package/dist/server/managementEmbed.js +1 -1
- package/dist/server/managementEmbed.js.map +1 -1
- package/dist/server/managementPrivileges.js +7 -1
- package/dist/server/managementPrivileges.js.map +1 -1
- package/dist/server/managementTerminalProxyRoutes.js +124 -0
- package/dist/server/managementTerminalProxyRoutes.js.map +1 -0
- package/dist/server/normalAuth.js +5 -1
- package/dist/server/normalAuth.js.map +1 -1
- package/dist/server/notices/serverNoticeStore.js +50 -6
- package/dist/server/notices/serverNoticeStore.js.map +1 -1
- package/dist/server/piPackageService.js +5 -5
- package/dist/server/piPackageService.js.map +1 -1
- package/dist/server/piWebPluginCatalog.js +211 -34
- 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 +176 -291
- package/dist/server/piWebPluginService.js.map +1 -1
- package/dist/server/piWebStatus.js +45 -55
- 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 +63 -0
- package/dist/server/plugins/pluginBackendChannelProxyRoutes.js.map +1 -0
- package/dist/server/plugins/pluginBackendProxyRoutes.js +7 -4
- package/dist/server/plugins/pluginBackendProxyRoutes.js.map +1 -1
- package/dist/server/plugins/pluginBackendRegistry.js +773 -0
- package/dist/server/plugins/pluginBackendRegistry.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 +1049 -107
- 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 +84 -0
- package/dist/server/projects/projectLifecycleService.js.map +1 -0
- package/dist/server/projects/projectService.js +2 -0
- package/dist/server/projects/projectService.js.map +1 -1
- package/dist/server/realtime/sessionEventHub.js +35 -41
- package/dist/server/realtime/sessionEventHub.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/pluginBackendChannelRoutes.js +397 -0
- package/dist/server/sessiond/pluginBackendChannelRoutes.js.map +1 -0
- package/dist/server/sessiond/pluginBackendRoutes.js +19 -9
- package/dist/server/sessiond/pluginBackendRoutes.js.map +1 -1
- package/dist/server/sessiond/projectMutationRoutes.js +38 -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 +47 -15
- package/dist/server/sessiond/sessionProxyRoutes.js.map +1 -1
- package/dist/server/sessiond/sessionServiceDependencies.js +4 -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/workspaceRemovalRoutes.js +1 -1
- package/dist/server/sessiond/workspaceRemovalRoutes.js.map +1 -1
- package/dist/server/sessiond.js +226 -56
- package/dist/server/sessiond.js.map +1 -1
- package/dist/server/sessions/askUserTool.js +0 -3
- package/dist/server/sessions/askUserTool.js.map +1 -1
- package/dist/server/sessions/attachmentService.js +0 -1
- package/dist/server/sessions/attachmentService.js.map +1 -1
- package/dist/server/sessions/authService.js +8 -1
- package/dist/server/sessions/authService.js.map +1 -1
- package/dist/server/sessions/builtinCommands.js +2 -2
- package/dist/server/sessions/builtinCommands.js.map +1 -1
- package/dist/server/sessions/clientSessionPreview.js +14 -0
- package/dist/server/sessions/clientSessionPreview.js.map +1 -0
- package/dist/server/sessions/dockerEnvironmentFacts.js +82 -9
- package/dist/server/sessions/dockerEnvironmentFacts.js.map +1 -1
- package/dist/server/sessions/managementAgentTools.js +11 -6
- package/dist/server/sessions/managementAgentTools.js.map +1 -1
- package/dist/server/sessions/managementPermissionSystem.js +16 -4
- package/dist/server/sessions/managementPermissionSystem.js.map +1 -1
- 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 +2 -5
- package/dist/server/sessions/oauthLoginFlowService.js.map +1 -1
- package/dist/server/sessions/pendingAskStore.js +0 -3
- package/dist/server/sessions/pendingAskStore.js.map +1 -1
- package/dist/server/sessions/piSessionEventConnections.js +65 -0
- package/dist/server/sessions/piSessionEventConnections.js.map +1 -0
- package/dist/server/sessions/piSessionManagerGateway.js +56 -3
- package/dist/server/sessions/piSessionManagerGateway.js.map +1 -1
- package/dist/server/sessions/piSessionService.js +774 -448
- package/dist/server/sessions/piSessionService.js.map +1 -1
- package/dist/server/sessions/projectAuthService.js +29 -2
- package/dist/server/sessions/projectAuthService.js.map +1 -1
- package/dist/server/sessions/projectSettingsScope.js +12 -4
- 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/sessionActivityMarker.js +105 -0
- package/dist/server/sessions/sessionActivityMarker.js.map +1 -0
- package/dist/server/sessions/sessionArchiveMapping.js +2 -8
- package/dist/server/sessions/sessionArchiveMapping.js.map +1 -1
- package/dist/server/sessions/sessionCommandService.js +12 -10
- 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/sessionModelScope.js +42 -5
- package/dist/server/sessions/sessionModelScope.js.map +1 -1
- package/dist/server/sessions/sessionNameGenerator.js +6 -6
- package/dist/server/sessions/sessionNameGenerator.js.map +1 -1
- package/dist/server/sessions/sessionRoutes.js +63 -15
- package/dist/server/sessions/sessionRoutes.js.map +1 -1
- package/dist/server/sessions/sessionTreeProjection.js +29 -29
- package/dist/server/sessions/sessionTreeProjection.js.map +1 -1
- package/dist/server/sessions/sessionUiEvents.js +6 -7
- package/dist/server/sessions/sessionUiEvents.js.map +1 -1
- package/dist/server/sessions/sessionUnreadStore.js +26 -1
- package/dist/server/sessions/sessionUnreadStore.js.map +1 -1
- package/dist/server/sessions/spawnSessionTool.js +3 -3
- package/dist/server/sessions/spawnSessionTool.js.map +1 -1
- package/dist/server/sessions/spawnSubsessionTool.js +5 -5
- package/dist/server/sessions/spawnSubsessionTool.js.map +1 -1
- package/dist/server/sessions/spawnTargetResolver.js +1 -1
- package/dist/server/sessions/transcriptMessages.js +54 -0
- package/dist/server/sessions/transcriptMessages.js.map +1 -0
- package/dist/server/status/machineStatusService.js +3 -1
- package/dist/server/status/machineStatusService.js.map +1 -1
- package/dist/server/terminals/{terminalService.js → managementCommandRunService.js} +79 -107
- 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 +339 -0
- package/dist/server/webSocketBridge.js.map +1 -1
- package/dist/server/workbench/gatewayIntegration.js +4 -1
- package/dist/server/workbench/gatewayIntegration.js.map +1 -1
- package/dist/server/workspaceExplorerRoutes.js +13 -12
- package/dist/server/workspaceExplorerRoutes.js.map +1 -1
- package/dist/server/workspaces/fileContentService.js +9 -7
- package/dist/server/workspaces/fileContentService.js.map +1 -1
- package/dist/server/workspaces/fileOperationService.js +4 -3
- package/dist/server/workspaces/fileOperationService.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 +36 -12
- 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/workspaceDeletionRoutes.js +5 -57
- package/dist/server/workspaces/workspaceDeletionRoutes.js.map +1 -1
- package/dist/server/workspaces/workspaceProviderRegistry.js +75 -24
- package/dist/server/workspaces/workspaceProviderRegistry.js.map +1 -1
- package/dist/server/workspaces/workspaceRemovalService.js +25 -3
- package/dist/server/workspaces/workspaceRemovalService.js.map +1 -1
- package/dist/server-plugin-api.d.ts +274 -44
- package/dist/server-plugin-api.js +319 -2
- package/dist/server-plugin-api.js.map +1 -1
- package/dist/serverPluginRecovery.js +4 -0
- 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 +29 -8
- package/dist/sessiond/sessionDaemonClient.js.map +1 -1
- 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 +7 -2
- package/dist/shared/apiTypes.js.map +1 -1
- package/dist/shared/capabilities.js +5 -0
- package/dist/shared/capabilities.js.map +1 -1
- package/dist/shared/federatedRoutes.js +49 -9
- package/dist/shared/federatedRoutes.js.map +1 -1
- package/dist/shared/machinePluginIds.js +30 -7
- package/dist/shared/machinePluginIds.js.map +1 -1
- package/dist/shared/machineStatus.js +35 -1
- package/dist/shared/machineStatus.js.map +1 -1
- package/dist/shared/piWebStatusParsing.js +29 -0
- package/dist/shared/piWebStatusParsing.js.map +1 -1
- package/dist/shared/pluginApiTypes.d.ts +24 -9
- package/dist/shared/pluginApiTypes.js +2 -0
- package/dist/shared/pluginApiTypes.js.map +1 -0
- package/dist/shared/pluginBackendProtocol.js +163 -2
- package/dist/shared/pluginBackendProtocol.js.map +1 -1
- 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 +41 -0
- package/dist/shared/sessionDefaults.js.map +1 -0
- package/dist/shared/workspaceFiles.js.map +1 -1
- package/docs/config.md +270 -323
- package/docs/plugins.md +171 -956
- 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/package.json +22 -13
- package/skills/README.md +27 -2
- package/skills/relay-runner/SKILL.md +21 -13
- package/dist/client/assets/CodeViewer-CZHnKRwQ.js +0 -4
- package/dist/client/assets/TerminalPanel-B_EaRPHY.js +0 -187
- package/dist/client/assets/index-Bv1v-Jz7.js +0 -4717
- 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/server/git/gitService.js +0 -316
- 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/terminalProxyRoutes.js +0 -181
- 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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Generated from pi-packages/captains-log/src/store.ts. Do not edit directly.
|
|
2
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
3
|
+
import { constants } from "node:fs";
|
|
4
|
+
import { lstat, mkdir, open, readdir, rename, rm } from "node:fs/promises";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { isLogEntry } from "./browser/protocol.js";
|
|
7
|
+
/** Only host-resolved ids enter the scope hash; peer input is never a filesystem path. */
|
|
8
|
+
export function logScope(projectId, workspaceId) {
|
|
9
|
+
return createHash("sha256").update(JSON.stringify([projectId, workspaceId])).digest("hex");
|
|
10
|
+
}
|
|
11
|
+
export class LogStore {
|
|
12
|
+
dataDirectory;
|
|
13
|
+
constructor(dataDirectory) {
|
|
14
|
+
this.dataDirectory = dataDirectory;
|
|
15
|
+
}
|
|
16
|
+
async directory(scope) {
|
|
17
|
+
if (!/^[a-f0-9]{64}$/.test(scope))
|
|
18
|
+
throw new Error("Invalid captain scope");
|
|
19
|
+
const directory = join(this.dataDirectory, scope);
|
|
20
|
+
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
21
|
+
if (!(await lstat(directory)).isDirectory())
|
|
22
|
+
throw new Error("LogEntry directory must not be a symlink");
|
|
23
|
+
return directory;
|
|
24
|
+
}
|
|
25
|
+
async save(scope, captain) {
|
|
26
|
+
if (!isLogEntry(captain))
|
|
27
|
+
throw new Error("Invalid captain record");
|
|
28
|
+
const directory = await this.directory(scope);
|
|
29
|
+
const temporary = join(directory, `.${randomUUID()}.tmp`);
|
|
30
|
+
try {
|
|
31
|
+
const file = await open(temporary, "wx", 0o600);
|
|
32
|
+
try {
|
|
33
|
+
await file.writeFile(JSON.stringify(captain));
|
|
34
|
+
await file.sync();
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
await file.close();
|
|
38
|
+
}
|
|
39
|
+
await rename(temporary, join(directory, `${captain.id}.json`));
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
await rm(temporary, { force: true });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async read(scope, id) {
|
|
46
|
+
if (typeof id !== "string" || !/^[a-f0-9-]{36}$/.test(id))
|
|
47
|
+
throw new Error("Invalid captain id");
|
|
48
|
+
const path = join(await this.directory(scope), `${id}.json`);
|
|
49
|
+
// O_NOFOLLOW is not enforced on Windows; reject existing links there too.
|
|
50
|
+
if (!(await lstat(path)).isFile())
|
|
51
|
+
throw new Error("Invalid captain file");
|
|
52
|
+
const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
53
|
+
try {
|
|
54
|
+
const stat = await file.stat();
|
|
55
|
+
if (!stat.isFile() || stat.size > 300_000)
|
|
56
|
+
throw new Error("Invalid captain file");
|
|
57
|
+
const value = JSON.parse(await file.readFile("utf8"));
|
|
58
|
+
if (!isLogEntry(value) || value.id !== id)
|
|
59
|
+
throw new Error("Invalid saved captain");
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
await file.close();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async list(scope) {
|
|
67
|
+
const names = await readdir(await this.directory(scope));
|
|
68
|
+
const captains = [];
|
|
69
|
+
for (const name of names) {
|
|
70
|
+
if (/^[a-f0-9-]{36}\.json$/.test(name))
|
|
71
|
+
captains.push(await this.read(scope, name.slice(0, -5)));
|
|
72
|
+
}
|
|
73
|
+
return captains.sort((a, b) => b.createdAt.localeCompare(a.createdAt) || b.id.localeCompare(a.id));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# 使用船长日志
|
|
2
|
+
|
|
3
|
+
在当前机器和工作区选择普通会话,打开“船长日志”,点击“让船长转述”。伴随扩展读取源会话当前分支最新已完成的助手文本回复,不发送提示、不修改源转录。独立的船长会话使用你配置的模型转述文本,以海盗船长的风格保留事实、警告、下一步以及原始代码和命令。
|
|
4
|
+
|
|
5
|
+
船长首次收到角色介绍;后续请求复用仍由 daemon 承载的船长会话。只有在发送请求前明确确认旧船长未被承载时才自动创建新会话,不因超时或任意连接失败重试、重发或替换会话。daemon 重启后,如需保留旧船长的上下文,先在会话列表打开最近的船长日志会话,等待加载完成,再选择需要转述的源会话。
|
|
6
|
+
|
|
7
|
+
## 结果与连接
|
|
8
|
+
|
|
9
|
+
- “打开源会话”按照记录的机器、项目、工作区和源会话 ID 返回聊天。目标不可用时显示常规错误,不自动创建替代会话。
|
|
10
|
+
- 结果支持 Markdown 标题、列表、强调、链接、表格和代码块。内嵌 HTML 按文本显示,危险链接不可点击,图片不会自动加载。“历史转述”和“诊断”默认折叠。
|
|
11
|
+
- 打开面板或选择“打开船长转述”不会消耗模型令牌。只有点击转述按钮才提交任务。
|
|
12
|
+
- 浏览器使用双向 peer 通道接收后端进度,无轮询。连接或重连会读取快照;进度不是逐令牌输出,船长完成后才收到最终转述。
|
|
13
|
+
- 关闭面板或浏览器不会取消已被后端接收的工作。重新连接可恢复结果;接收状态不确定时绝不自动重发。
|
|
14
|
+
|
|
15
|
+
## 无法运行时
|
|
16
|
+
|
|
17
|
+
源会话必须属于当前机器和工作区,未归档、非临时会话,且不是船长本身。等待源会话空闲,并确保当前分支存在已完成的助手文本回复;未完成、中止、失败及仅包含工具调用的回复不能转述。现有会话缺少伴随扩展时,执行 `/reload` 后重试。
|
|
18
|
+
|
|
19
|
+
每个工作区同时只运行一个面板转述任务。船长忙碌、转述时直接向其发送其他消息、提供方错误、中止或截断回复、运行时替换均报告失败,不当作成功。接收超时或完成超时仅移除监听,不停止 Pi;不确定请求须先检查船长会话再手动重试。过大的源回复或结果会被拒绝,不静默截断。
|
|
20
|
+
|
|
21
|
+
转述和元数据保存在宿主提供的插件数据目录,按项目和工作区隔离。会话转录仍由 Pi 管理。中断记录保留,但没有持久任务恢复或自动清理策略。源文本会发送给船长使用的模型提供方;此代码受信任,不提供工具沙箱。
|
|
22
|
+
|
|
23
|
+
## 安装与激活
|
|
24
|
+
|
|
25
|
+
在目标机器“设置 → Pi 包 → 可用包”中安装,再到“设置 → PI WEB 插件”显式启用。本包已编译;手动安装可用 `pi install /absolute/path/to/dist/pi-packages/captains-log`。
|
|
26
|
+
|
|
27
|
+
从承载会话之外手动重启目标 session daemon,再刷新浏览器。仅重启 Web/API 不能激活后端。现有会话执行 `/reload` 加载或更新伴随扩展;项目级包仍须经过正常的项目信任流程。
|
|
28
|
+
|
|
29
|
+
禁用 PI WEB 插件仅控制面板和后端,不移除原生扩展。移除 Pi 包会移除两种资源声明,但保留会话与插件数据。旧 Workspace Reviews 示例拥有独立插件 ID,须另外禁用或移除。
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chainingintention/pi-captains-log",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "可选船长日志:通过原生 Pi 伴随扩展和 PI WEB 面板转述选中会话的最后一条回复",
|
|
5
|
+
"private": true,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": ["pi-package"],
|
|
8
|
+
"files": ["dist", "src", "docs", "test", "tsconfig.json", "vite.config.mjs"],
|
|
9
|
+
"scripts": { "build": "tsc -p tsconfig.json && vite build", "test": "node --test test/*.test.mjs" },
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"marked": "^18.0.6"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@chainingintention/pi-web-cn": "^1.202609.1",
|
|
15
|
+
"@earendil-works/pi-coding-agent": "^0.87.0",
|
|
16
|
+
"@types/node": "^24.13.3",
|
|
17
|
+
"typescript": "^6.0.3",
|
|
18
|
+
"vite": "^8.1.4"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
22
|
+
"@chainingintention/pi-web-cn": "^1.202609.1"
|
|
23
|
+
},
|
|
24
|
+
"pi": { "extensions": ["./dist/companion.js"] },
|
|
25
|
+
"piWeb": {
|
|
26
|
+
"plugins": [{
|
|
27
|
+
"id": "captains-log",
|
|
28
|
+
"defaultEnabled": false,
|
|
29
|
+
"browserRoot": "dist/browser",
|
|
30
|
+
"module": "dist/browser/index.js",
|
|
31
|
+
"serverModule": "dist/server.js",
|
|
32
|
+
"machineSpecific": true
|
|
33
|
+
}]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -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": true,
|
|
18
|
+
"noEmitOnError": true
|
|
19
|
+
},
|
|
20
|
+
"include": ["src/**/*.ts"]
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
|
|
4
|
+
const packageDir = fileURLToPath(new URL(".", import.meta.url));
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
root: packageDir,
|
|
8
|
+
base: "./",
|
|
9
|
+
publicDir: false,
|
|
10
|
+
build: {
|
|
11
|
+
outDir: "dist/browser",
|
|
12
|
+
// Retain the transpiled filenames for existing package/install consumers.
|
|
13
|
+
emptyOutDir: false,
|
|
14
|
+
copyPublicDir: false,
|
|
15
|
+
target: "es2022",
|
|
16
|
+
sourcemap: false,
|
|
17
|
+
rollupOptions: {
|
|
18
|
+
input: fileURLToPath(new URL("src/browser/index.ts", import.meta.url)),
|
|
19
|
+
preserveEntrySignatures: "strict",
|
|
20
|
+
output: {
|
|
21
|
+
format: "es",
|
|
22
|
+
entryFileNames: "index.js",
|
|
23
|
+
chunkFileNames: "assets/[name]-[hash].js",
|
|
24
|
+
assetFileNames: "assets/[name]-[hash][extname]",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { RELAYS_ROOT } from "./relayDiscovery.js";
|
|
3
3
|
import { defineRelaysPanelElement } from "./relaysPanelElement.js";
|
|
4
4
|
const plugin = {
|
|
5
|
-
apiVersion:
|
|
5
|
+
apiVersion: 4,
|
|
6
6
|
name: "中继",
|
|
7
|
-
activate: ({
|
|
7
|
+
activate: ({ runtimePluginId, html, svg }) => {
|
|
8
8
|
defineRelaysPanelElement();
|
|
9
9
|
return {
|
|
10
10
|
contributions: {
|
|
@@ -18,7 +18,7 @@ const plugin = {
|
|
|
18
18
|
run: (context) => {
|
|
19
19
|
if (context.state.selectedWorkspace === undefined)
|
|
20
20
|
return;
|
|
21
|
-
context.selectWorkspaceTool(`${
|
|
21
|
+
context.selectWorkspaceTool(`${runtimePluginId}:workspace.relays`);
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
],
|
|
@@ -26,12 +26,12 @@ const plugin = {
|
|
|
26
26
|
{
|
|
27
27
|
id: "workspace.relays",
|
|
28
28
|
title: "中继",
|
|
29
|
-
icon: svg `
|
|
30
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
31
|
-
<path d="M9 17H7A5 5 0 0 1 7 7h2"></path>
|
|
32
|
-
<path d="M15 7h2a5 5 0 1 1 0 10h-2"></path>
|
|
33
|
-
<line x1="8" y1="12" x2="16" y2="12"></line>
|
|
34
|
-
</svg>
|
|
29
|
+
icon: svg `
|
|
30
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
31
|
+
<path d="M9 17H7A5 5 0 0 1 7 7h2"></path>
|
|
32
|
+
<path d="M15 7h2a5 5 0 1 1 0 10h-2"></path>
|
|
33
|
+
<line x1="8" y1="12" x2="16" y2="12"></line>
|
|
34
|
+
</svg>
|
|
35
35
|
`,
|
|
36
36
|
order: 50,
|
|
37
37
|
render: (context) => html `<pi-web-relays-panel .context=${context}></pi-web-relays-panel>`,
|
|
@@ -19,7 +19,7 @@ The quality of the Relay depends on a clear shared understanding of its destinat
|
|
|
19
19
|
1. **Start a reviewable draft packet.** Choose a clear Relay name and create `.pi-web/relays/<name>/` in the current drafting checkout. Seed draft `charter.md`, `operations.md`, `status.md`, and `log.md`; mark status **Draft — awaiting approval; not dispatched**. Update these documents as understanding improves so the human can review them through the Relays UI. Draft creation is not dispatch authorization.
|
|
20
20
|
2. **Understand the request and baseline.** Read the repository's canonical agent/contributor instructions and task-relevant project material. Inspect enough current behavior, repository state, and delivery context to distinguish the user's intended outcome from an assumed solution. Keep this bounded to facts that affect the goal, scope edges, feasibility, working location, or first leg; leave implementation archaeology to the Relay.
|
|
21
21
|
3. **Capture understanding without making a roadmap.** Keep `charter.md` to the plain-language goal and observable finish line, minimum outcome acceptance, in-scope edges, explicit non-goals, directly affected behavior to preserve, and material assumptions or human decisions. Put packet/profile identity, proposed operating mode/base, canonical project-guidance pointers, verification/delivery mechanics, and packet isolation in `operations.md`. Put only the proposed first bounded leg and current approval state in `status.md`.
|
|
22
|
-
4. **Do not pre-plan the chain.** Do not create a fixed leg count, work-package hierarchy, exhaustive stage list, expected file/layer map, `plan.md`, or technical design merely to make the Relay look prepared. The route is adaptive.
|
|
22
|
+
4. **Do not pre-plan the chain.** Do not create a fixed leg count, work-package hierarchy, exhaustive stage list, expected file/layer map, `plan.md`, or technical design merely to make the Relay look prepared. The route is adaptive. Select an implementation-first leg under the runner profile. Reserve research-only work for a concrete unanswered question blocking implementation; routine investigation belongs inside the implementation leg.
|
|
23
23
|
5. **Discuss and refine.** Point the user at the draft packet, summarize the current understanding, ask related material questions together with `ask_user`, and incorporate the answers into the drafts. Do not hide assumptions or settle product, destructive-data, target, base, or delivery choices by guesswork.
|
|
24
24
|
6. **Request approval against the final drafts.** After the user has had a chance to review the final document purposes and content, provide the packet path plus a concise goal/edges, operating-setup, and first-leg summary. Use `ask_user` to offer **Approve and dispatch**, **Revise**, or **Do not dispatch**. The initial request, a clear task, prior general enthusiasm, silence, or permission to create drafts is not dispatch approval. If goal, edges, operating target, or first leg changes materially after approval, update the drafts and obtain fresh approval.
|
|
25
25
|
|
|
@@ -351,8 +351,8 @@ class PiWebRelaysPanel extends HTMLElement {
|
|
|
351
351
|
if (documents.documentCount === 0) {
|
|
352
352
|
return `${partialNotice}
|
|
353
353
|
<div class="empty-state">
|
|
354
|
-
<strong>此中继还没有文档。</strong>
|
|
355
|
-
<p>Relay Runner 包通常包含 <code>status.md</code>、<code>charter.md</code>、<code>operations.md</code> 和 <code>log.md</code>。</p>
|
|
354
|
+
<strong>此中继还没有文档。</strong>
|
|
355
|
+
<p>Relay Runner 包通常包含 <code>status.md</code>、<code>charter.md</code>、<code>operations.md</code> 和 <code>log.md</code>。</p>
|
|
356
356
|
</div>
|
|
357
357
|
`;
|
|
358
358
|
}
|
|
@@ -466,12 +466,12 @@ function relaysStyles() {
|
|
|
466
466
|
select { min-width: 0; max-width: 240px; padding: 5px 6px; }
|
|
467
467
|
.document-tab { flex: 0 0 auto; white-space: nowrap; font-size: 12px; padding: 4px 10px; }
|
|
468
468
|
.document-tab.active { border-color: var(--pi-accent-border); background: var(--pi-accent); color: var(--pi-bg); }
|
|
469
|
-
.directory-group { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-width: 0; border: 1px solid var(--pi-border-muted); border-radius: 10px; background: var(--pi-bg-overlay-soft); padding: 0; margin: -1px 0; }
|
|
470
|
-
.directory-tab { display: inline-flex; align-items: center; gap: 5px; }
|
|
471
|
-
.directory-tab .chevron { flex: 0 0 auto; width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.12s ease; }
|
|
472
|
-
.directory-tab[aria-expanded="true"] .chevron { transform: rotate(90deg); }
|
|
473
|
-
.directory-tab.contains-active { border-color: var(--pi-accent-border); color: var(--pi-accent); }
|
|
474
|
-
.directory-tab.contains-active::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--pi-accent); }
|
|
469
|
+
.directory-group { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-width: 0; border: 1px solid var(--pi-border-muted); border-radius: 10px; background: var(--pi-bg-overlay-soft); padding: 0; margin: -1px 0; }
|
|
470
|
+
.directory-tab { display: inline-flex; align-items: center; gap: 5px; }
|
|
471
|
+
.directory-tab .chevron { flex: 0 0 auto; width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.12s ease; }
|
|
472
|
+
.directory-tab[aria-expanded="true"] .chevron { transform: rotate(90deg); }
|
|
473
|
+
.directory-tab.contains-active { border-color: var(--pi-accent-border); color: var(--pi-accent); }
|
|
474
|
+
.directory-tab.contains-active::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--pi-accent); }
|
|
475
475
|
code, pre { border: 1px solid var(--pi-border-muted); border-radius: 6px; background: var(--pi-bg); color: var(--pi-text-secondary); font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
|
|
476
476
|
code { padding: 2px 5px; }
|
|
477
477
|
pre { margin: 0; overflow: auto; padding: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
@@ -15,6 +15,7 @@ For a Relay using this profile:
|
|
|
15
15
|
|
|
16
16
|
- Have the preparation prompt select `relay-runner` before drafting the packet. Record it immediately in draft `operations.md` and retain it as required for every active leg, including implementation, review, remediation, and delivery.
|
|
17
17
|
- Name both `relay` and `relay-runner` in every handoff prompt. Fresh sessions cannot inherit a prior runner's loaded skills.
|
|
18
|
+
- Keep every Relay handoff on the current runner's model by omitting the `model` argument, unless instructed to use a specific model or to choose an appropriate one. Record any Relay-wide model instruction in `operations.md` so it remains available to later runners.
|
|
18
19
|
- Treat the charter as destination and scope edges, `operations.md` as this profile's repository and execution bindings, `status.md` as current position and next work, and repository instructions as the quality and implementation authority.
|
|
19
20
|
- Follow canonical repository policy when it conflicts with a profile default. Record a material operational adaptation in `operations.md`, not the charter. Stop for human intervention when reconciling the conflict would change the finish line or an edge, weaken a protected invariant, or require a product or business decision.
|
|
20
21
|
|
|
@@ -53,19 +54,26 @@ Relay intentionally does not predict the chain. Before dispatch, establish the d
|
|
|
53
54
|
|
|
54
55
|
Expected files, subsystems, dependencies, architecture, and sequencing are route assumptions. Keep only what the current or next leg needs in status or a targeted temporary artifact; do not turn route assumptions into stable agreement.
|
|
55
56
|
|
|
56
|
-
A leg is one context-contained, reviewable slice that
|
|
57
|
+
A leg is one context-contained, reviewable slice that advances the finish line. Development legs implement and verify by default: optimize for the smallest useful behaviour, not the smallest independently testable artifact. A functional checkpoint makes an observable charter outcome available and verifies it through the relevant application boundary. A tested but unused module is a prerequisite, not a functional outcome. Setup, required verification, review and delivery remain legitimate lifecycle legs.
|
|
58
|
+
|
|
59
|
+
Slice by supported cases across the necessary layers. When a journey is too large, choose a narrower case or a safe partial capability with explicit limitations, keeping the full charter outstanding. Keep directly coupled implementation, checks, contracts, generated outputs, documentation and integration together.
|
|
57
60
|
|
|
58
61
|
Before substantial work, state the leg's:
|
|
59
62
|
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
|
|
63
|
+
- observable outcome and application boundary;
|
|
64
|
+
- bounded change surface and coupled verification;
|
|
65
|
+
- remaining connection to usable behaviour, if any; and
|
|
66
|
+
- checkpoint type: functional, necessary prerequisite or profile-authorized transitional.
|
|
67
|
+
|
|
68
|
+
An unconnected prerequisite must name the behaviour it enables and why a connected slice cannot reasonably fit. Its successor prioritizes that connection. Before adding another prerequisite-only leg, reassess the slice and simplify the route; continue only when a concrete dependency still prevents connection.
|
|
69
|
+
|
|
70
|
+
Routine reading, design, sizing and test investigation belong inside implementation. A research-only leg requires a specific unanswered question blocking responsible implementation: record the blocked behaviour, why available evidence is insufficient and the result needed to proceed. Answer that question and hand off to implementation; intervene if it remains unresolved. Size or complexity alone calls for a smaller implementation slice.
|
|
71
|
+
|
|
72
|
+
Choose the simplest design satisfying the charter, canonical project rules and concrete risks introduced by the change. Justify additional safeguards against those obligations; keep speculative recovery systems and future-use abstractions outside the slice. Preserve safety when narrowing behaviour.
|
|
65
73
|
|
|
66
|
-
Persist only conclusions useful to the next runner.
|
|
74
|
+
Persist only conclusions useful to the next runner. Keep leg history in the packet log and project documentation focused on current behaviour and contracts.
|
|
67
75
|
|
|
68
|
-
If a leg grows beyond its context-contained slice, stop broadening before context exhaustion. Finish or revert to a functional checkpoint, or use an already authorized transition. Record the next bounded slice. Do not promise a fixed total leg count.
|
|
76
|
+
If a leg grows beyond its context-contained slice, stop broadening before context exhaustion. Finish or revert to a coherent functional or justified prerequisite checkpoint, or use an already authorized transition. Record the next bounded slice. Do not promise a fixed total leg count.
|
|
69
77
|
|
|
70
78
|
When status does not name the next task, choose the smallest coherent slice that advances the critical path or unblocks an agreed outcome. Do not invent cleanup or speculative follow-up merely to fill a leg.
|
|
71
79
|
|
|
@@ -130,7 +138,7 @@ Do **not** put a quality bar, technical design, expected files or subsystems, ve
|
|
|
130
138
|
Write the profile's mechanics to `operations.md` instead:
|
|
131
139
|
|
|
132
140
|
- packet identity and `relay-runner` as the profile required in every leg and handoff;
|
|
133
|
-
-
|
|
141
|
+
- implementation-first leg sizing and outcome-led task selection under this profile, with route assumptions provisional and no fixed leg count;
|
|
134
142
|
- pointers to canonical repository instructions and applicable project skills;
|
|
135
143
|
- checkpoint and transition policy;
|
|
136
144
|
- packet root, working location, branch, immutable base commit, initial HEAD, pre-existing state, packet isolation, and exact review range;
|
|
@@ -158,11 +166,11 @@ Use this loop:
|
|
|
158
166
|
|
|
159
167
|
1. Read `charter.md`, `operations.md`, `status.md`, and only targeted context they reference. Then load canonical project skills applicable to this leg.
|
|
160
168
|
2. Confirm that the prompt's leg identifier, status baton, working location, branch, and blockers are consistent. Resolve small baton defects with targeted inspection; intervene instead of broad archaeology or guessing about intent.
|
|
161
|
-
3.
|
|
169
|
+
3. Use status's next outcome as the starting point. Revise inherited sequencing or design when a simpler connected slice better advances it. Safe implementation splits within the charter are runner decisions, not approval requests. If the intended outcome remains ambiguous or falls outside the finish line, intervene.
|
|
162
170
|
4. Re-anchor to the finish line and perform the containment check. Do exactly one bounded slice. Do not audit unrelated code, execute the next nominal leg too, or expand scope under the guise of quality.
|
|
163
171
|
5. Run every focused check meaningful for the slice and report exact results. Before whole review, run the full verification named by `operations.md`. Never describe failed, skipped, or incomplete verification as passing.
|
|
164
172
|
6. Make delivery changes durable under the operations record's commit policy without absorbing unrelated state. Keep packet-only writes out of delivery commits.
|
|
165
|
-
7. Update status with the
|
|
173
|
+
7. Update status with the observable progress, completed and next leg identifiers, next outcome, existing seam to connect, concrete constraints, remaining unconnected work, targeted context, verification state, blockers and active transition/review pointers. Keep route choices provisional. Append the concise leg entry to the log before stopping or handing off.
|
|
166
174
|
8. Stop without spawning when Relay completion is recorded, the leg is blocked, or an intervention trigger fires. When the chartered outcome is implemented but required review, approval, or delivery remains, name that lifecycle work as the next leg instead of stopping. Surface the intervention signal clearly. Otherwise hand off exactly once at the end with `spawn_session`.
|
|
167
175
|
|
|
168
176
|
Use this handoff shape, substituting the actual paths and next identifier:
|
|
@@ -177,7 +185,7 @@ Load the `relay` and `relay-runner` skills, then read:
|
|
|
177
185
|
- .pi-web/relays/<name>/status.md
|
|
178
186
|
|
|
179
187
|
Do not read log.md end-to-end. Use only targeted entries referenced by charter.md, operations.md, or status.md.
|
|
180
|
-
Run exactly one leg
|
|
188
|
+
Run exactly one outcome-led leg under the profile's implementation-first rules. Use status's next outcome and connection priority; adapt the route within the charter. Make work and packet updates durable, then either hand off once or stop with the recorded intervention signal.
|
|
181
189
|
```
|
|
182
190
|
|
|
183
191
|
## Whole-work review and remediation
|
|
@@ -200,7 +208,7 @@ For each attempt:
|
|
|
200
208
|
- When attempt 2 has a blocking finding, do not automatically consume attempt 3. Invoke the remediation contingency only when concrete evidence shows that an attempted remediation reasonably expected to resolve a blocker did not, remediation introduced an in-scope regression, or materially new evidence reveals a blocker that could not reasonably have been assessed earlier—and one bounded remediation is likely to resolve it. Record that justification, mark the contingency invoked, and dispatch one coherent remediation leg followed by attempt 3. Expanded scrutiny, a changed standard, deferred already-available evidence, or speculative possibility does not qualify. If a genuine blocker remains but the contingency is not justified or bounded, intervene.
|
|
201
209
|
- When exceptional attempt 3 still has any blocking finding, stop the automatic loop. Record the unresolved findings and exact decision needed, raise the human intervention signal, and do **not** dispatch remediation or a fourth review. A human may accept an authorized risk, change the agreement, stop the Relay, or explicitly grant a bounded additional remediation/review attempt.
|
|
202
210
|
|
|
203
|
-
The reviewer chooses proportionate independent review and records that decision. Independent subreviews are optional; use them only when a specific changed surface benefits from focused expertise, not to create review theater or increase the chance of finding something. The reviewer may use `spawn_subsession` for report-only focused reviews, then `yield_to_subsessions` and consolidate. Subreview prompts must identify repository, base and exact diff, the charter's goal and edges, canonical quality instructions, and the prohibition on all writes including packet changes. The consolidating reviewer is the sole packet writer.
|
|
211
|
+
The reviewer chooses proportionate independent review and records that decision. Independent subreviews are optional; use them only when a specific changed surface benefits from focused expertise, not to create review theater or increase the chance of finding something. The reviewer may use `spawn_subsession` for report-only focused reviews, then `yield_to_subsessions` and consolidate. Subreview prompts must identify repository, base and exact diff, the charter's goal and edges, canonical quality instructions, and the prohibition on all writes including packet changes. The consolidating reviewer is the sole packet writer. The Relay handoff still uses one `spawn_session` only at the end of the leg.
|
|
204
212
|
|
|
205
213
|
A blocking finding needs concrete evidence of an in-scope defect: for example a reproduced failure, a failing relevant check, a specific execution path that violates the approved outcome, or a clear breach of a material contract, invariant, security, authorization, or data-integrity boundary. Mere possibility, stylistic preference, optional hardening, hypothetical future requirements, or “there could be an edge case” is not blocking. If proportionate targeted inspection cannot establish applicability and impact, classify the concern as non-blocking or omit it rather than forcing remediation.
|
|
206
214
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
2
|
+
<path d="M3 6.5A2.5 2.5 0 0 1 5.5 4H10l2 2h6.5A2.5 2.5 0 0 1 21 8.5v8A2.5 2.5 0 0 1 18.5 19h-13A2.5 2.5 0 0 1 3 16.5z"/>
|
|
3
|
+
</svg>
|