shennian 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/publish-build-manifest.json +165 -125
- package/dist/src/agents/acp/adapter.js +2 -2
- package/dist/src/agents/acp/capability-cache.js +2 -2
- package/dist/src/agents/acp/catalog.js +2 -2
- package/dist/src/agents/acp/manifests.js +2 -2
- package/dist/src/agents/claude.js +8 -6
- package/dist/src/agents/codex.js +2 -2
- package/dist/src/agents/command-spec.js +4 -4
- package/dist/src/agents/cursor.js +1 -1
- package/dist/src/agents/custom-recovery-conformance.js +2 -2
- package/dist/src/agents/gemini.js +1 -1
- package/dist/src/agents/model-registry/discovery.js +3 -3
- package/dist/src/agents/model-registry/service.js +1 -1
- package/dist/src/agents/model-registry.js +1 -1
- package/dist/src/agents/openclaw.js +2 -2
- package/dist/src/agents/opencode.js +1 -1
- package/dist/src/agents/pi-coding-agent.js +3 -4
- package/dist/src/agents/pi-session-ownership.js +2 -2
- package/dist/src/agents/spawn-errors.js +1 -0
- package/dist/src/agents/windows-agent-paths.js +1 -0
- package/dist/src/commands/agent-readiness.js +2 -2
- package/dist/src/commands/daemon-service-spec.js +1 -1
- package/dist/src/commands/daemon.js +6 -6
- package/dist/src/commands/queue.js +1 -0
- package/dist/src/commands/room.js +3 -3
- package/dist/src/config/index.js +2 -2
- package/dist/src/fs/atomic-rename.js +1 -0
- package/dist/src/index.js +3 -3
- package/dist/src/native-fusion/claude-entry-parser.js +7 -0
- package/dist/src/native-fusion/local-repository.js +2 -2
- package/dist/src/native-fusion/native-source-deletions.js +2 -2
- package/dist/src/native-fusion/parsers.js +1 -3
- package/dist/src/native-fusion/state.js +2 -2
- package/dist/src/personal-sync/epoch.js +2 -2
- package/dist/src/personal-sync/identity.js +2 -2
- package/dist/src/relay/client.js +1 -1
- package/dist/src/room/activation-service.js +6 -6
- package/dist/src/room/attachment-cache.js +2 -2
- package/dist/src/room/host-session-observations.js +2 -2
- package/dist/src/room/managed-context.js +1 -1
- package/dist/src/room/managed-room-ipc.js +2 -2
- package/dist/src/room/mirror-sync-service.js +1 -1
- package/dist/src/room/public-attachment-cache.js +2 -2
- package/dist/src/room/room-error-guidance.js +1 -0
- package/dist/src/room/session-registry.js +2 -2
- package/dist/src/security/managed-agent-policy.js +1 -1
- package/dist/src/security/managed-agent-runtime.js +1 -1
- package/dist/src/session/attachment-transfer-store.js +2 -2
- package/dist/src/session/canonical-store.js +5 -5
- package/dist/src/session/deletion-sync-state.js +2 -2
- package/dist/src/session/handlers/agent-workspace-validation.js +1 -1
- package/dist/src/session/handlers/chat-adapter-config.js +1 -1
- package/dist/src/session/handlers/chat-events.js +2 -2
- package/dist/src/session/handlers/chat-recovery.js +1 -1
- package/dist/src/session/handlers/chat.js +1 -1
- package/dist/src/session/manager.js +1 -1
- package/dist/src/session/native-cleanup-outbox.js +2 -2
- package/dist/src/session/queue-diagnostics.js +1 -0
- package/dist/src/session/queue-dispatch-failure.js +1 -0
- package/dist/src/session/queue-helpers.js +5 -5
- package/dist/src/session/queue-retry.js +1 -1
- package/dist/src/session/queue-storage.js +2 -2
- package/dist/src/session/queue.js +1 -1
- package/dist/src/session/room-reply-notice.js +1 -0
- package/dist/src/session/run-recovery/journal.js +2 -2
- package/dist/src/session/run-stall.js +1 -0
- package/dist/src/session/store.js +2 -2
- package/dist/src/session/tool-detail-store.js +2 -2
- package/node_modules/@shennian/wire/dist/agent-capabilities.js +1 -1
- package/node_modules/@shennian/wire/dist/agent-workspace.js +1 -144
- package/node_modules/@shennian/wire/dist/envelope.js +1 -1
- package/node_modules/@shennian/wire/dist/events.js +1 -1
- package/node_modules/@shennian/wire/dist/external-message-format.js +3 -70
- package/node_modules/@shennian/wire/dist/frames.js +1 -1
- package/node_modules/@shennian/wire/dist/fs.js +2 -7
- package/node_modules/@shennian/wire/dist/index.js +1 -21
- package/node_modules/@shennian/wire/dist/machine.js +1 -1
- package/node_modules/@shennian/wire/dist/message-payload.js +8 -307
- package/node_modules/@shennian/wire/dist/methods.js +1 -3
- package/node_modules/@shennian/wire/dist/native-session.js +1 -1
- package/node_modules/@shennian/wire/dist/project-fs.js +1 -462
- package/node_modules/@shennian/wire/dist/project-path.js +1 -25
- package/node_modules/@shennian/wire/dist/project.js +1 -3
- package/node_modules/@shennian/wire/dist/relay-connectivity.js +1 -29
- package/node_modules/@shennian/wire/dist/room.js +1 -20
- package/node_modules/@shennian/wire/dist/schedule.js +1 -1
- package/node_modules/@shennian/wire/dist/session-sync.js +1 -123
- package/node_modules/@shennian/wire/dist/session.js +1 -60
- package/node_modules/@shennian/wire/dist/tool-detail.js +1 -9
- package/node_modules/@shennian/wire/dist/voice-chief.js +1 -3
- package/package.json +3 -8
- package/dist/bin/shennian.d.ts +0 -2
- package/dist/src/agent-env.d.ts +0 -44
- package/dist/src/agents/acp/adapter.d.ts +0 -82
- package/dist/src/agents/acp/auth-state.d.ts +0 -3
- package/dist/src/agents/acp/auth.d.ts +0 -7
- package/dist/src/agents/acp/capability-cache.d.ts +0 -14
- package/dist/src/agents/acp/catalog.d.ts +0 -11
- package/dist/src/agents/acp/client-services.d.ts +0 -37
- package/dist/src/agents/acp/discovery.d.ts +0 -10
- package/dist/src/agents/acp/events.d.ts +0 -4
- package/dist/src/agents/acp/manifests.d.ts +0 -63
- package/dist/src/agents/acp/metrics.d.ts +0 -24
- package/dist/src/agents/acp/package-commands.d.ts +0 -4
- package/dist/src/agents/acp/process-client.d.ts +0 -41
- package/dist/src/agents/acp/process-tree.d.ts +0 -2
- package/dist/src/agents/acp/types.d.ts +0 -31
- package/dist/src/agents/acp/watcher.d.ts +0 -22
- package/dist/src/agents/adapter.d.ts +0 -180
- package/dist/src/agents/auth-status.d.ts +0 -4
- package/dist/src/agents/claude-managed-permissions.d.ts +0 -33
- package/dist/src/agents/claude.d.ts +0 -69
- package/dist/src/agents/codex-managed-permissions.d.ts +0 -32
- package/dist/src/agents/codex-managed-room-tools.d.ts +0 -41
- package/dist/src/agents/codex-protocol.d.ts +0 -103
- package/dist/src/agents/codex-runtime.d.ts +0 -91
- package/dist/src/agents/codex-utils.d.ts +0 -29
- package/dist/src/agents/codex.d.ts +0 -59
- package/dist/src/agents/command-spec.d.ts +0 -55
- package/dist/src/agents/config-status.d.ts +0 -18
- package/dist/src/agents/cursor-managed-permissions.d.ts +0 -28
- package/dist/src/agents/cursor.d.ts +0 -44
- package/dist/src/agents/custom-managed-runtime.d.ts +0 -37
- package/dist/src/agents/custom-recovery-conformance.d.ts +0 -2
- package/dist/src/agents/custom.d.ts +0 -62
- package/dist/src/agents/detect.d.ts +0 -23
- package/dist/src/agents/event-terminal-gate.d.ts +0 -16
- package/dist/src/agents/external-channel-instructions.d.ts +0 -4
- package/dist/src/agents/gemini.d.ts +0 -32
- package/dist/src/agents/manager.d.ts +0 -57
- package/dist/src/agents/model-registry/cache.d.ts +0 -4
- package/dist/src/agents/model-registry/discovery.d.ts +0 -4
- package/dist/src/agents/model-registry/opencode-api.d.ts +0 -2
- package/dist/src/agents/model-registry/parsers.d.ts +0 -20
- package/dist/src/agents/model-registry/runner.d.ts +0 -6
- package/dist/src/agents/model-registry/service.d.ts +0 -10
- package/dist/src/agents/model-registry/types.d.ts +0 -39
- package/dist/src/agents/model-registry.d.ts +0 -17
- package/dist/src/agents/native-capabilities.d.ts +0 -10
- package/dist/src/agents/openclaw.d.ts +0 -29
- package/dist/src/agents/opencode-managed-permissions.d.ts +0 -25
- package/dist/src/agents/opencode.d.ts +0 -46
- package/dist/src/agents/pi-coding-agent-managed-permissions.d.ts +0 -7
- package/dist/src/agents/pi-coding-agent.d.ts +0 -63
- package/dist/src/agents/pi-managed-extension.d.ts +0 -12
- package/dist/src/agents/pi-managed-model-broker.d.ts +0 -27
- package/dist/src/agents/pi-managed-model-broker.js +0 -1
- package/dist/src/agents/pi-rpc-client.d.ts +0 -31
- package/dist/src/agents/pi-session-ownership.d.ts +0 -2
- package/dist/src/agents/platform-instructions.d.ts +0 -5
- package/dist/src/agents/runtime-compatibility.d.ts +0 -11
- package/dist/src/agents/workbuddy-managed-permissions.d.ts +0 -37
- package/dist/src/agents/workbuddy.d.ts +0 -63
- package/dist/src/commands/agent-readiness.d.ts +0 -17
- package/dist/src/commands/agent.d.ts +0 -2
- package/dist/src/commands/daemon-instance-lock.d.ts +0 -21
- package/dist/src/commands/daemon-process.d.ts +0 -6
- package/dist/src/commands/daemon-service-spec.d.ts +0 -26
- package/dist/src/commands/daemon-start-wait.d.ts +0 -9
- package/dist/src/commands/daemon-state.d.ts +0 -57
- package/dist/src/commands/daemon-windows.d.ts +0 -33
- package/dist/src/commands/daemon.d.ts +0 -67
- package/dist/src/commands/integration.d.ts +0 -3
- package/dist/src/commands/logout.d.ts +0 -3
- package/dist/src/commands/manager.d.ts +0 -2
- package/dist/src/commands/pair-authorization.d.ts +0 -3
- package/dist/src/commands/pair-browser.d.ts +0 -44
- package/dist/src/commands/pair-qr.d.ts +0 -4
- package/dist/src/commands/pair.d.ts +0 -19
- package/dist/src/commands/room.d.ts +0 -16
- package/dist/src/commands/runtime.d.ts +0 -2
- package/dist/src/commands/schedule.d.ts +0 -2
- package/dist/src/commands/tools.d.ts +0 -2
- package/dist/src/commands/upgrade.d.ts +0 -31
- package/dist/src/commands/worker.d.ts +0 -11
- package/dist/src/config/index.d.ts +0 -58
- package/dist/src/daemon-ipc/agent-readiness.d.ts +0 -15
- package/dist/src/daemon-ipc/client.d.ts +0 -8
- package/dist/src/daemon-ipc/control.d.ts +0 -16
- package/dist/src/daemon-ipc/json.d.ts +0 -3
- package/dist/src/daemon-ipc/paths.d.ts +0 -15
- package/dist/src/daemon-ipc/protocol.d.ts +0 -31
- package/dist/src/daemon-ipc/secret.d.ts +0 -3
- package/dist/src/daemon-ipc/server.d.ts +0 -20
- package/dist/src/daemon-log.d.ts +0 -9
- package/dist/src/env-path.d.ts +0 -15
- package/dist/src/fs/boundary.d.ts +0 -23
- package/dist/src/fs/handler.d.ts +0 -26
- package/dist/src/fs/security.d.ts +0 -2
- package/dist/src/fs/text-decoder.d.ts +0 -10
- package/dist/src/index.d.ts +0 -1
- package/dist/src/log-redaction.d.ts +0 -4
- package/dist/src/log-reporter.d.ts +0 -41
- package/dist/src/manager/prompt.d.ts +0 -2
- package/dist/src/manager/registry.d.ts +0 -184
- package/dist/src/manager/retired-external-channel-compat.d.ts +0 -78
- package/dist/src/manager/runtime.d.ts +0 -90
- package/dist/src/manager/worker-ipc.d.ts +0 -28
- package/dist/src/manager/worker-markdown.d.ts +0 -10
- package/dist/src/native-fusion/codex-files.d.ts +0 -10
- package/dist/src/native-fusion/codex-message-parser.d.ts +0 -9
- package/dist/src/native-fusion/codex-parser.d.ts +0 -8
- package/dist/src/native-fusion/codex-user-input.d.ts +0 -11
- package/dist/src/native-fusion/config.d.ts +0 -1
- package/dist/src/native-fusion/file-identity.d.ts +0 -9
- package/dist/src/native-fusion/file-watcher.d.ts +0 -26
- package/dist/src/native-fusion/local-repository.d.ts +0 -90
- package/dist/src/native-fusion/native-source-deletions.d.ts +0 -47
- package/dist/src/native-fusion/opencode-parser.d.ts +0 -29
- package/dist/src/native-fusion/parser-common.d.ts +0 -35
- package/dist/src/native-fusion/parsers.d.ts +0 -13
- package/dist/src/native-fusion/service.d.ts +0 -64
- package/dist/src/native-fusion/session-header.d.ts +0 -13
- package/dist/src/native-fusion/session-native-sources.d.ts +0 -24
- package/dist/src/native-fusion/source-visibility-audit.d.ts +0 -16
- package/dist/src/native-fusion/source-visibility.d.ts +0 -25
- package/dist/src/native-fusion/state.d.ts +0 -4
- package/dist/src/native-fusion/types.d.ts +0 -82
- package/dist/src/personal-sync/epoch.d.ts +0 -17
- package/dist/src/personal-sync/identity.d.ts +0 -1
- package/dist/src/personal-sync/machine-authority.d.ts +0 -12
- package/dist/src/personal-sync/metrics.d.ts +0 -25
- package/dist/src/personal-sync/paths.d.ts +0 -5
- package/dist/src/region.d.ts +0 -15
- package/dist/src/relay/client.d.ts +0 -81
- package/dist/src/room/activation-audit.d.ts +0 -15
- package/dist/src/room/activation-policy.d.ts +0 -8
- package/dist/src/room/activation-service.d.ts +0 -77
- package/dist/src/room/attachment-cache.d.ts +0 -44
- package/dist/src/room/attachment-upload.d.ts +0 -20
- package/dist/src/room/device-authorization-client.d.ts +0 -91
- package/dist/src/room/host-session-observations.d.ts +0 -54
- package/dist/src/room/invite-bootstrap.d.ts +0 -49
- package/dist/src/room/invite-qr.d.ts +0 -6
- package/dist/src/room/live-delivery.d.ts +0 -5
- package/dist/src/room/managed-context.d.ts +0 -49
- package/dist/src/room/managed-prompt-composer.d.ts +0 -47
- package/dist/src/room/managed-room-binding.d.ts +0 -69
- package/dist/src/room/managed-room-ipc.d.ts +0 -65
- package/dist/src/room/mirror-sync-service.d.ts +0 -49
- package/dist/src/room/public-attachment-cache.d.ts +0 -34
- package/dist/src/room/public-room-client.d.ts +0 -37
- package/dist/src/room/registration-authority.d.ts +0 -4
- package/dist/src/room/room-action-client-types.d.ts +0 -137
- package/dist/src/room/room-action-client.d.ts +0 -116
- package/dist/src/room/room-binding-client.d.ts +0 -62
- package/dist/src/room/session-registry.d.ts +0 -158
- package/dist/src/runtime-distribution.d.ts +0 -7
- package/dist/src/schedules/personal-context.d.ts +0 -2
- package/dist/src/schedules/server-client.d.ts +0 -19
- package/dist/src/security/managed-agent-credential-paths.d.ts +0 -6
- package/dist/src/security/managed-agent-executable.d.ts +0 -19
- package/dist/src/security/managed-agent-policy.d.ts +0 -66
- package/dist/src/security/managed-agent-runtime.d.ts +0 -44
- package/dist/src/session/archive-zip.d.ts +0 -10
- package/dist/src/session/attachment-reference.d.ts +0 -2
- package/dist/src/session/attachment-transfer-store.d.ts +0 -45
- package/dist/src/session/canonical-store.d.ts +0 -104
- package/dist/src/session/deletion-sync-state.d.ts +0 -20
- package/dist/src/session/deletion-sync-validation.d.ts +0 -2
- package/dist/src/session/deletion-synchronizer.d.ts +0 -9
- package/dist/src/session/handlers/agent-capabilities.d.ts +0 -3
- package/dist/src/session/handlers/agent-config.d.ts +0 -7
- package/dist/src/session/handlers/agent-control.d.ts +0 -4
- package/dist/src/session/handlers/agent-workspace-validation.d.ts +0 -28
- package/dist/src/session/handlers/agents.d.ts +0 -11
- package/dist/src/session/handlers/chat-adapter-config.d.ts +0 -11
- package/dist/src/session/handlers/chat-context.d.ts +0 -31
- package/dist/src/session/handlers/chat-events.d.ts +0 -5
- package/dist/src/session/handlers/chat-recovery.d.ts +0 -4
- package/dist/src/session/handlers/chat-session-lifecycle.d.ts +0 -9
- package/dist/src/session/handlers/chat.d.ts +0 -6
- package/dist/src/session/handlers/control.d.ts +0 -5
- package/dist/src/session/handlers/fs.d.ts +0 -14
- package/dist/src/session/handlers/message-status.d.ts +0 -3
- package/dist/src/session/handlers/pi-validation-session.d.ts +0 -7
- package/dist/src/session/handlers/pi-validation-session.js +0 -1
- package/dist/src/session/handlers/project-fs.d.ts +0 -11
- package/dist/src/session/handlers/remote-access.d.ts +0 -4
- package/dist/src/session/handlers/room-managed.d.ts +0 -6
- package/dist/src/session/handlers/session-refresh.d.ts +0 -3
- package/dist/src/session/handlers/title.d.ts +0 -3
- package/dist/src/session/handlers/tool-detail.d.ts +0 -3
- package/dist/src/session/handlers/voice-window.d.ts +0 -3
- package/dist/src/session/history-subscriptions.d.ts +0 -29
- package/dist/src/session/index-publisher.d.ts +0 -3
- package/dist/src/session/manager-event-authority.d.ts +0 -3
- package/dist/src/session/manager.d.ts +0 -95
- package/dist/src/session/native-cleanup-outbox.d.ts +0 -64
- package/dist/src/session/native-session-lifecycle.d.ts +0 -56
- package/dist/src/session/project-fs-store.d.ts +0 -43
- package/dist/src/session/projection.d.ts +0 -3
- package/dist/src/session/queue-control.d.ts +0 -27
- package/dist/src/session/queue-helpers.d.ts +0 -20
- package/dist/src/session/queue-message.d.ts +0 -35
- package/dist/src/session/queue-retry.d.ts +0 -11
- package/dist/src/session/queue-storage.d.ts +0 -8
- package/dist/src/session/queue-types.d.ts +0 -31
- package/dist/src/session/queue.d.ts +0 -73
- package/dist/src/session/queued-chat-dispatch.d.ts +0 -12
- package/dist/src/session/run-recovery/barrier.d.ts +0 -12
- package/dist/src/session/run-recovery/coordinator.d.ts +0 -32
- package/dist/src/session/run-recovery/journal.d.ts +0 -30
- package/dist/src/session/run-recovery/schema.d.ts +0 -48
- package/dist/src/session/store.d.ts +0 -128
- package/dist/src/session/tool-detail-store.d.ts +0 -17
- package/dist/src/session/turn-trigger.d.ts +0 -43
- package/dist/src/session/types.d.ts +0 -93
- package/dist/src/tools/markdown-to-pdf.d.ts +0 -42
- package/dist/src/upgrade/channel.d.ts +0 -5
- package/dist/src/upgrade/distribution.d.ts +0 -21
- package/dist/src/upgrade/engine.d.ts +0 -104
- package/dist/src/upgrade/scheduler.d.ts +0 -60
- package/dist/src/upgrade/updater-bootstrap.d.ts +0 -12
- package/dist/src/upgrade/updater-launcher.d.ts +0 -37
- package/dist/src/upgrade/updater-protocol.d.ts +0 -40
- package/dist/src/upgrade/updater-service-entry.d.ts +0 -7
- package/dist/src/upgrade/updater-worker.d.ts +0 -57
- package/dist/src/windows-shell.d.ts +0 -6
- package/node_modules/@shennian/wire/dist/agent-capabilities.d.ts +0 -16
- package/node_modules/@shennian/wire/dist/agent-workspace.d.ts +0 -133
- package/node_modules/@shennian/wire/dist/envelope.d.ts +0 -7
- package/node_modules/@shennian/wire/dist/events.d.ts +0 -125
- package/node_modules/@shennian/wire/dist/external-message-format.d.ts +0 -37
- package/node_modules/@shennian/wire/dist/frames.d.ts +0 -33
- package/node_modules/@shennian/wire/dist/fs.d.ts +0 -107
- package/node_modules/@shennian/wire/dist/index.d.ts +0 -21
- package/node_modules/@shennian/wire/dist/machine.d.ts +0 -160
- package/node_modules/@shennian/wire/dist/message-payload.d.ts +0 -71
- package/node_modules/@shennian/wire/dist/methods.d.ts +0 -5
- package/node_modules/@shennian/wire/dist/native-session.d.ts +0 -20
- package/node_modules/@shennian/wire/dist/project-fs.d.ts +0 -146
- package/node_modules/@shennian/wire/dist/project-path.d.ts +0 -4
- package/node_modules/@shennian/wire/dist/project.d.ts +0 -16
- package/node_modules/@shennian/wire/dist/relay-connectivity.d.ts +0 -30
- package/node_modules/@shennian/wire/dist/room.d.ts +0 -190
- package/node_modules/@shennian/wire/dist/schedule.d.ts +0 -37
- package/node_modules/@shennian/wire/dist/session-sync.d.ts +0 -406
- package/node_modules/@shennian/wire/dist/session.d.ts +0 -465
- package/node_modules/@shennian/wire/dist/tool-detail.d.ts +0 -38
- package/node_modules/@shennian/wire/dist/voice-chief.d.ts +0 -116
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ReqFrame } from '@shennian/wire';
|
|
2
|
-
import type { SessionManagerRuntime } from './types.js';
|
|
3
|
-
import { type ChatSendExecutionContext } from './handlers/chat.js';
|
|
4
|
-
import { type PreparedManagedRoomTurn } from './queue.js';
|
|
5
|
-
export declare function managedChatContext(prepared: PreparedManagedRoomTurn): ChatSendExecutionContext;
|
|
6
|
-
export declare function managedManagerEventContext(prepared: PreparedManagedRoomTurn): ChatSendExecutionContext;
|
|
7
|
-
export declare function dispatchManagedChat(runtime: SessionManagerRuntime, req: ReqFrame, prepared: PreparedManagedRoomTurn): Promise<void>;
|
|
8
|
-
export declare function dispatchQueuedChat(runtime: SessionManagerRuntime, req: ReqFrame, prepared?: PreparedManagedRoomTurn): Promise<{
|
|
9
|
-
deliveryMode?: string;
|
|
10
|
-
queuedSubmissionId?: string;
|
|
11
|
-
}>;
|
|
12
|
-
export declare function interruptQueuedChat(runtime: SessionManagerRuntime, sessionId: string): Promise<void>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class RunRecoveryBarrier {
|
|
2
|
-
private recovering;
|
|
3
|
-
private releases;
|
|
4
|
-
private dispatchFrozen;
|
|
5
|
-
freezeDispatch(): void;
|
|
6
|
-
unfreezeDispatch(): void;
|
|
7
|
-
isDispatchFrozen(): boolean;
|
|
8
|
-
begin(sessionId: string): void;
|
|
9
|
-
end(sessionId: string): void;
|
|
10
|
-
isRecovering(sessionId: string): boolean;
|
|
11
|
-
wait(sessionId: string): Promise<void>;
|
|
12
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { AgentRecoveryResult } from '../../agents/adapter.js';
|
|
2
|
-
import type { ActiveRunJournal } from './journal.js';
|
|
3
|
-
import type { RunRecoveryBarrier } from './barrier.js';
|
|
4
|
-
import { type RunJournalRecord } from './schema.js';
|
|
5
|
-
export type RecoveryTerminal = Extract<AgentRecoveryResult, {
|
|
6
|
-
result: 'interrupted_by_upgrade' | 'recovery_failed';
|
|
7
|
-
}>;
|
|
8
|
-
export declare class RunRecoveryCoordinator {
|
|
9
|
-
private readonly deps;
|
|
10
|
-
private pendingBySession;
|
|
11
|
-
constructor(deps: {
|
|
12
|
-
journal: ActiveRunJournal;
|
|
13
|
-
barrier: RunRecoveryBarrier;
|
|
14
|
-
recover(record: RunJournalRecord, beforeContinueDispatch: () => void): Promise<AgentRecoveryResult>;
|
|
15
|
-
commitTerminal(record: RunJournalRecord, result: RecoveryTerminal): Promise<void>;
|
|
16
|
-
/** True only when the local canonical transaction for this run already committed. */
|
|
17
|
-
isCanonicalTerminal?: (record: RunJournalRecord) => boolean;
|
|
18
|
-
onOutcome?: (outcome: {
|
|
19
|
-
adapterType: string;
|
|
20
|
-
source: RunJournalRecord['source'];
|
|
21
|
-
result: AgentRecoveryResult['result'];
|
|
22
|
-
attempts: number;
|
|
23
|
-
durationMs: number;
|
|
24
|
-
reason?: string;
|
|
25
|
-
}) => void;
|
|
26
|
-
maxAttempts?: number;
|
|
27
|
-
});
|
|
28
|
-
recoverAll(): Promise<void>;
|
|
29
|
-
completeFromProvider(sessionId: string, runId: string): void;
|
|
30
|
-
private recoverOne;
|
|
31
|
-
private finishTerminal;
|
|
32
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type RunJournalRecord } from './schema.js';
|
|
2
|
-
type JournalInput = Omit<RunJournalRecord, 'schemaVersion' | 'lastObservedEventSeq' | 'phase' | 'upgradeJobId' | 'interruptionReason' | 'continueDispatchState' | 'recoveryAttempts' | 'createdAt' | 'updatedAt' | 'recoveryReason' | 'deliveryMode' | 'externalRunId'>;
|
|
3
|
-
export type RunJournalLoadResult = {
|
|
4
|
-
records: RunJournalRecord[];
|
|
5
|
-
quarantined: string[];
|
|
6
|
-
};
|
|
7
|
-
export declare class ActiveRunJournal {
|
|
8
|
-
readonly daemonInstallationId: string;
|
|
9
|
-
readonly directory: string;
|
|
10
|
-
readonly quarantineDirectory: string;
|
|
11
|
-
constructor(daemonInstallationId: string, options?: {
|
|
12
|
-
directory?: string;
|
|
13
|
-
});
|
|
14
|
-
begin(input: JournalInput): RunJournalRecord;
|
|
15
|
-
update(sessionId: string, runId: string, patch: Partial<Omit<RunJournalRecord, 'schemaVersion' | 'daemonInstallationId' | 'sessionId' | 'runId' | 'createdAt'>>): RunJournalRecord | null;
|
|
16
|
-
get(sessionId: string, runId: string): RunJournalRecord | null;
|
|
17
|
-
loadRecoverable(): RunJournalLoadResult;
|
|
18
|
-
/** Records that still require either provider recovery or terminal cleanup. */
|
|
19
|
-
loadPendingReconciliation(): RunJournalLoadResult;
|
|
20
|
-
private load;
|
|
21
|
-
markPlannedUpgrade(upgradeJobId: string): number;
|
|
22
|
-
markAborted(sessionId: string, runId: string): void;
|
|
23
|
-
markSessionAborted(sessionId: string): number;
|
|
24
|
-
remove(sessionId: string, runId: string): void;
|
|
25
|
-
sync(): void;
|
|
26
|
-
private recordPath;
|
|
27
|
-
private write;
|
|
28
|
-
private quarantine;
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { type AgentType, type SessionMode } from '@shennian/wire';
|
|
2
|
-
export declare const RUN_JOURNAL_SCHEMA_VERSION: 1;
|
|
3
|
-
export declare const RECOVERY_CONTINUE_TEXT: "Continue.";
|
|
4
|
-
export type RunJournalPhase = 'dispatching' | 'running' | 'waiting_approval' | 'recovering' | 'terminal' | 'interrupted_by_upgrade' | 'recovery_failed' | 'aborted';
|
|
5
|
-
export type RunRecoverySource = 'personal' | 'managed_room' | 'managed_direct' | 'manager_event' | 'manager_worker';
|
|
6
|
-
export type ContinueDispatchState = 'none' | 'intent' | 'accepted';
|
|
7
|
-
export type RunDeliveryMode = 'direct' | 'external_owner_queue';
|
|
8
|
-
export type RunJournalRecord = {
|
|
9
|
-
schemaVersion: typeof RUN_JOURNAL_SCHEMA_VERSION;
|
|
10
|
-
daemonInstallationId: string;
|
|
11
|
-
sessionId: string;
|
|
12
|
-
runId: string;
|
|
13
|
-
clientMessageId: string;
|
|
14
|
-
agentType: AgentType;
|
|
15
|
-
sessionMode: SessionMode;
|
|
16
|
-
workDir: string;
|
|
17
|
-
agentSessionId: string | null;
|
|
18
|
-
modelId: string | null;
|
|
19
|
-
reasoningEffort: string | null;
|
|
20
|
-
nativeSessionVisibility: 'user' | 'internal';
|
|
21
|
-
providerRunId: string | null;
|
|
22
|
-
lastObservedEventSeq: number;
|
|
23
|
-
phase: RunJournalPhase;
|
|
24
|
-
source: RunRecoverySource;
|
|
25
|
-
parentSessionId: string | null;
|
|
26
|
-
/** Public Skill workers use the host's normal full-access provider policy. */
|
|
27
|
-
managerWorkerNativeFull?: boolean;
|
|
28
|
-
roomContextRegistryKey: string | null;
|
|
29
|
-
activationCauseMessageId: string | null;
|
|
30
|
-
rootCauseMessageId: string | null;
|
|
31
|
-
activationSequence: string | null;
|
|
32
|
-
activationHopCount: number | null;
|
|
33
|
-
managedPolicyVersion?: string | null;
|
|
34
|
-
managedRuntimePolicyHash?: string | null;
|
|
35
|
-
upgradeJobId: string | null;
|
|
36
|
-
interruptionReason: 'daemon_crash' | 'planned_upgrade' | 'os_restart' | null;
|
|
37
|
-
continueDispatchState: ContinueDispatchState;
|
|
38
|
-
deliveryMode: RunDeliveryMode;
|
|
39
|
-
externalRunId: string | null;
|
|
40
|
-
recoveryAttempts: number;
|
|
41
|
-
/** Non-sensitive stable reason used to replay a pending terminal commit. */
|
|
42
|
-
recoveryReason?: string | null;
|
|
43
|
-
createdAt: string;
|
|
44
|
-
updatedAt: string;
|
|
45
|
-
};
|
|
46
|
-
/** Strict parsing keeps corrupt or future records out of the recovery path. */
|
|
47
|
-
export declare function parseRunJournalRecord(value: unknown): RunJournalRecord;
|
|
48
|
-
export declare function isRecoverableJournalPhase(phase: RunJournalPhase): boolean;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { type AgentType, type Envelope, type ManagerConfig, type SessionDeliveryState, type SessionIndexUpdate, type SessionMessageStatusResponse, type SessionMode, type SessionTitleGenerateResponse, type SessionTitleGenerationEligibility, type SessionTitleSource } from '@shennian/wire';
|
|
2
|
-
import { getDaemonInstallationId } from '../personal-sync/identity.js';
|
|
3
|
-
import { PERSONAL_SYNC_V1_ROOT_NAME } from '../personal-sync/paths.js';
|
|
4
|
-
import { CanonicalSessionStore } from './canonical-store.js';
|
|
5
|
-
export { PERSONAL_SYNC_V1_ROOT_NAME };
|
|
6
|
-
export type LocalSessionRecord = {
|
|
7
|
-
daemonInstallationId: string;
|
|
8
|
-
sessionId: string;
|
|
9
|
-
agentType: AgentType;
|
|
10
|
-
sessionMode?: SessionMode;
|
|
11
|
-
nativeSessionVisibility?: 'user' | 'internal';
|
|
12
|
-
managerConfig?: ManagerConfig | null;
|
|
13
|
-
workDir: string;
|
|
14
|
-
agentSessionId?: string | null;
|
|
15
|
-
modelId?: string | null;
|
|
16
|
-
managerDefaultWorkerAgentType?: AgentType | null;
|
|
17
|
-
managerDefaultWorkerModelId?: string | null;
|
|
18
|
-
status?: 'active' | 'completed' | 'failed';
|
|
19
|
-
createdAt: string;
|
|
20
|
-
updatedAt: string;
|
|
21
|
-
lastActivityAt: string;
|
|
22
|
-
lastMessagePreview?: string | null;
|
|
23
|
-
lastMessagePreviewMessageId: string | null;
|
|
24
|
-
lastMessagePreviewAt: string | null;
|
|
25
|
-
lastVisibleEventAt?: string | null;
|
|
26
|
-
localReady: boolean;
|
|
27
|
-
firstUserMessageId: string | null;
|
|
28
|
-
firstUserBodyRevision: number | null;
|
|
29
|
-
bodyRevision: number;
|
|
30
|
-
indexRevision: number;
|
|
31
|
-
title: string;
|
|
32
|
-
titleSource: SessionTitleSource;
|
|
33
|
-
titleRevision: number;
|
|
34
|
-
titleLockedByUser: boolean;
|
|
35
|
-
titleOriginEventId: string | null;
|
|
36
|
-
firstAvailableSeq: number | null;
|
|
37
|
-
visibleMessageCount: number;
|
|
38
|
-
lastVisibleMessageId: string | null;
|
|
39
|
-
attentionCount: number;
|
|
40
|
-
lastAttentionId: string | null;
|
|
41
|
-
/** Local-only replay ledger. This field is never included in SessionIndexUpdate. */
|
|
42
|
-
seenAttentionIds?: string[];
|
|
43
|
-
lastBodyCommittedAt: string | null;
|
|
44
|
-
deletionRevision: number;
|
|
45
|
-
deletedAt: string | null;
|
|
46
|
-
syncedIndexRevision: number;
|
|
47
|
-
indexSyncState?: 'pending' | 'applied' | 'quarantined' | 'terminal';
|
|
48
|
-
indexSyncStateRevision?: number;
|
|
49
|
-
indexSyncAttempts?: number;
|
|
50
|
-
indexSyncNextAttemptAt?: string | null;
|
|
51
|
-
indexSyncErrorCode?: string | null;
|
|
52
|
-
indexQuarantineCode?: string | null;
|
|
53
|
-
/** Local attempt marker only. The ephemeral titleSeed is never stored. */
|
|
54
|
-
titleGenerationAttemptedAt: string | null;
|
|
55
|
-
/** Local retry schedule for a request that did not produce a title. */
|
|
56
|
-
titleGenerationNextAttemptAt?: string | null;
|
|
57
|
-
titleGenerationAttempts?: number;
|
|
58
|
-
};
|
|
59
|
-
export { getDaemonInstallationId };
|
|
60
|
-
export declare function recordSession(input: {
|
|
61
|
-
sessionId: string;
|
|
62
|
-
agentType: AgentType;
|
|
63
|
-
sessionMode?: SessionMode;
|
|
64
|
-
nativeSessionVisibility?: 'user' | 'internal';
|
|
65
|
-
managerConfig?: ManagerConfig | null;
|
|
66
|
-
workDir: string;
|
|
67
|
-
agentSessionId?: string | null;
|
|
68
|
-
modelId?: string | null;
|
|
69
|
-
managerDefaultWorkerAgentType?: AgentType | null;
|
|
70
|
-
managerDefaultWorkerModelId?: string | null;
|
|
71
|
-
status?: 'active' | 'completed' | 'failed';
|
|
72
|
-
lastActivityAt?: string;
|
|
73
|
-
lastMessagePreview?: string | null;
|
|
74
|
-
lastMessagePreviewMessageId?: string | null;
|
|
75
|
-
lastMessagePreviewAt?: string | null;
|
|
76
|
-
lastVisibleEventAt?: string | null;
|
|
77
|
-
localReady?: boolean;
|
|
78
|
-
firstUserMessageId?: string | null;
|
|
79
|
-
firstUserBodyRevision?: number | null;
|
|
80
|
-
title?: string;
|
|
81
|
-
titleSource?: SessionTitleSource;
|
|
82
|
-
titleRevision?: number;
|
|
83
|
-
titleLockedByUser?: boolean;
|
|
84
|
-
titleOriginEventId?: string | null;
|
|
85
|
-
/** Stable terminal/approval identity; a repeated identity is idempotent. */
|
|
86
|
-
attentionId?: string | null;
|
|
87
|
-
deletedAt?: string | null;
|
|
88
|
-
}): LocalSessionRecord;
|
|
89
|
-
export declare function listSessionRecords(): LocalSessionRecord[];
|
|
90
|
-
export declare function purgeSessionRecord(sessionId: string): void;
|
|
91
|
-
export declare function purgeCanonicalSession(sessionId: string): void;
|
|
92
|
-
export declare function listPendingSessionIndexUpdates(): SessionIndexUpdate[];
|
|
93
|
-
export declare function acknowledgeSessionIndexUpdate(sessionId: string, indexRevision: number): void;
|
|
94
|
-
export declare function markAllSessionIndexesForRepublish(): number;
|
|
95
|
-
export declare function recordSessionIndexRejection(input: {
|
|
96
|
-
sessionId: string;
|
|
97
|
-
indexRevision: number;
|
|
98
|
-
code: string;
|
|
99
|
-
disposition: 'retry' | 'quarantined' | 'terminal';
|
|
100
|
-
now?: number;
|
|
101
|
-
maxAttempts?: number;
|
|
102
|
-
}): 'retry' | 'quarantined' | 'terminal';
|
|
103
|
-
export type SessionTitleGenerationCandidate = {
|
|
104
|
-
sessionId: string;
|
|
105
|
-
requestId: string;
|
|
106
|
-
titleSeed: string;
|
|
107
|
-
baseTitleRevision: number;
|
|
108
|
-
eligibility: SessionTitleGenerationEligibility;
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Claims each fallback at most once. Only the durable attempt timestamp is
|
|
112
|
-
* written; the bounded seed returned to the caller never enters local JSON.
|
|
113
|
-
*/
|
|
114
|
-
export declare function claimSessionTitleGenerationCandidates(nowMs?: number, graceMs?: number): SessionTitleGenerationCandidate[];
|
|
115
|
-
export declare function deferSessionTitleGeneration(sessionId: string, nowMs?: number): string | null;
|
|
116
|
-
export declare function applyGeneratedSessionTitle(sessionId: string, result: Extract<SessionTitleGenerateResponse, {
|
|
117
|
-
generated: true;
|
|
118
|
-
}>): boolean;
|
|
119
|
-
export declare function appendMessage(sessionId: string, envelope: Envelope, deliveryState?: SessionDeliveryState): number;
|
|
120
|
-
export declare function upsertMessage(sessionId: string, envelope: Envelope, deliveryState?: SessionDeliveryState): number;
|
|
121
|
-
export declare function getMessageDeliveryStatus(sessionId: string, clientMessageId: string): SessionMessageStatusResponse;
|
|
122
|
-
export declare function tombstoneMessage(sessionId: string, messageId: string): number;
|
|
123
|
-
export declare function readMessages(sessionId: string, opts?: {
|
|
124
|
-
limit?: number;
|
|
125
|
-
before?: number;
|
|
126
|
-
}): Envelope[];
|
|
127
|
-
export declare function listSessions(): string[];
|
|
128
|
-
export declare function getCanonicalSessionStore(): CanonicalSessionStore;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ToolDetailRef } from '@shennian/wire';
|
|
2
|
-
export type LocalToolDetail = {
|
|
3
|
-
schemaVersion: 1;
|
|
4
|
-
sessionId: string;
|
|
5
|
-
toolCallId: string;
|
|
6
|
-
detailRevision: number;
|
|
7
|
-
ts: number;
|
|
8
|
-
name: string;
|
|
9
|
-
args?: unknown;
|
|
10
|
-
result?: unknown;
|
|
11
|
-
status: 'running' | 'completed' | 'failed';
|
|
12
|
-
durationMs?: number;
|
|
13
|
-
detailRef: ToolDetailRef;
|
|
14
|
-
};
|
|
15
|
-
export declare function writeToolDetail(detail: Omit<LocalToolDetail, 'schemaVersion'>): void;
|
|
16
|
-
export declare function readToolDetail(sessionId: string, toolCallId: string): LocalToolDetail | null;
|
|
17
|
-
export declare function purgeToolDetails(sessionId: string): void;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { ManagedWorkerRoomOrigin } from '../manager/registry.js';
|
|
2
|
-
export type ManagedRoomTriggerContext = {
|
|
3
|
-
registryKey: string;
|
|
4
|
-
causeMessageId: string;
|
|
5
|
-
rootCauseMessageId: string;
|
|
6
|
-
sequence: string;
|
|
7
|
-
hopCount: number;
|
|
8
|
-
};
|
|
9
|
-
export type TurnTrigger = {
|
|
10
|
-
kind: 'scheduled';
|
|
11
|
-
taskId: string;
|
|
12
|
-
bindingId?: string;
|
|
13
|
-
roomId?: string;
|
|
14
|
-
} | {
|
|
15
|
-
kind: 'personal';
|
|
16
|
-
} | {
|
|
17
|
-
kind: 'managed_direct';
|
|
18
|
-
} | ({
|
|
19
|
-
kind: 'room_activation';
|
|
20
|
-
} & ManagedRoomTriggerContext) | {
|
|
21
|
-
kind: 'manager_event';
|
|
22
|
-
eventId: string;
|
|
23
|
-
roomOrigin?: ManagedWorkerRoomOrigin;
|
|
24
|
-
} | {
|
|
25
|
-
kind: 'manager_worker';
|
|
26
|
-
parentSessionId: string;
|
|
27
|
-
roomOrigin?: ManagedWorkerRoomOrigin;
|
|
28
|
-
};
|
|
29
|
-
export type RecoveryAuthority = {
|
|
30
|
-
kind: 'personal';
|
|
31
|
-
} | {
|
|
32
|
-
kind: 'managed_direct';
|
|
33
|
-
} | ({
|
|
34
|
-
kind: 'room_activation';
|
|
35
|
-
} & ManagedRoomTriggerContext) | {
|
|
36
|
-
kind: 'manager_event';
|
|
37
|
-
eventId: string;
|
|
38
|
-
roomOrigin?: ManagedWorkerRoomOrigin;
|
|
39
|
-
} | {
|
|
40
|
-
kind: 'manager_worker';
|
|
41
|
-
parentSessionId: string;
|
|
42
|
-
roomOrigin?: ManagedWorkerRoomOrigin;
|
|
43
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import type { AgentType, ExternalChannelSessionStatus, SessionMode, SessionRunPhase } from '@shennian/wire';
|
|
2
|
-
import type { AgentAdapter } from '../agents/adapter.js';
|
|
3
|
-
import type { CliRelayClient } from '../relay/client.js';
|
|
4
|
-
import type { NativeSessionFusionService } from '../native-fusion/service.js';
|
|
5
|
-
import type { ManagerRuntimeService } from '../manager/runtime.js';
|
|
6
|
-
import type { ResolveAuthorizedPathResult } from '../fs/boundary.js';
|
|
7
|
-
import type { ManagedRoomExecutor } from '../room/managed-room-ipc.js';
|
|
8
|
-
import type { ActiveRunJournal } from './run-recovery/journal.js';
|
|
9
|
-
import type { RunRecoveryBarrier } from './run-recovery/barrier.js';
|
|
10
|
-
import type { RunJournalRecord } from './run-recovery/schema.js';
|
|
11
|
-
import type { PreparedManagedRoomTurn } from './queue.js';
|
|
12
|
-
export type ActiveSession = {
|
|
13
|
-
adapter: AgentAdapter;
|
|
14
|
-
workDir: string;
|
|
15
|
-
agentType: AgentType;
|
|
16
|
-
sessionMode?: SessionMode;
|
|
17
|
-
nativeSessionVisibility?: 'user' | 'internal';
|
|
18
|
-
agentSessionId: string | null;
|
|
19
|
-
lastActiveAt: number;
|
|
20
|
-
currentRunId: string | null;
|
|
21
|
-
currentRunPhase: SessionRunPhase | null;
|
|
22
|
-
nextEventSeq: number;
|
|
23
|
-
heartbeatSeq: number;
|
|
24
|
-
heartbeatTimer: ReturnType<typeof setInterval> | null;
|
|
25
|
-
pendingTextEvent: {
|
|
26
|
-
runId: string;
|
|
27
|
-
seq: number;
|
|
28
|
-
text: string;
|
|
29
|
-
thinking: boolean;
|
|
30
|
-
} | null;
|
|
31
|
-
externalChannel?: ExternalChannelSessionStatus | null;
|
|
32
|
-
externalChannelEnv?: NodeJS.ProcessEnv;
|
|
33
|
-
externalReplyTarget?: string | null;
|
|
34
|
-
/** Opaque per-turn Room capability; revoked and cleared on every terminal path. */
|
|
35
|
-
managedRoomContextToken?: string | null;
|
|
36
|
-
/** Stable Shennian recovery identity; provider run ids are stored separately. */
|
|
37
|
-
journalRunId?: string | null;
|
|
38
|
-
};
|
|
39
|
-
export type PendingTransfer = {
|
|
40
|
-
transferId: string;
|
|
41
|
-
rootPath: string;
|
|
42
|
-
lastActivityAt: number;
|
|
43
|
-
};
|
|
44
|
-
export type ChatQueueService = {
|
|
45
|
-
handleEnqueue(req: import('@shennian/wire').ReqFrame): Promise<boolean>;
|
|
46
|
-
handleGet(req: import('@shennian/wire').ReqFrame): Promise<void>;
|
|
47
|
-
handleEdit(req: import('@shennian/wire').ReqFrame): Promise<void>;
|
|
48
|
-
handleDelete(req: import('@shennian/wire').ReqFrame): Promise<void>;
|
|
49
|
-
handlePromote(req: import('@shennian/wire').ReqFrame): Promise<void>;
|
|
50
|
-
noteExternalClaim(sessionId: string, canonicalMessageId: string): void;
|
|
51
|
-
noteTerminal(sessionId: string): void;
|
|
52
|
-
purgeSession(sessionId: string): void;
|
|
53
|
-
getSnapshot(sessionId: string): import('@shennian/wire').ChatQueueSnapshot;
|
|
54
|
-
};
|
|
55
|
-
export type SessionActivityPublisher = {
|
|
56
|
-
publish(sessionId: string, activity: import('@shennian/wire').SessionActivitySnapshot | null): void;
|
|
57
|
-
};
|
|
58
|
-
export type UpgradePolicyController = {
|
|
59
|
-
setPolicy(policy: 'none' | 'patch'): void;
|
|
60
|
-
getPolicy(): 'none' | 'patch';
|
|
61
|
-
};
|
|
62
|
-
export type RemoteAccessPauseController = {
|
|
63
|
-
prepare(): {
|
|
64
|
-
disabledAt: string;
|
|
65
|
-
autoStartDisabled: boolean;
|
|
66
|
-
autoStartError?: string;
|
|
67
|
-
};
|
|
68
|
-
isDisabled(): boolean;
|
|
69
|
-
shutdownAfterResponse(): void;
|
|
70
|
-
};
|
|
71
|
-
export type SessionManagerRuntime = {
|
|
72
|
-
client: CliRelayClient;
|
|
73
|
-
pendingTransfers: Map<string, PendingTransfer>;
|
|
74
|
-
processedReqIds: Set<string>;
|
|
75
|
-
reloadCustomAgents: () => void;
|
|
76
|
-
resolvePath: (pathValue: string) => string;
|
|
77
|
-
resolveAuthorizedPath: (pathValue: string, rootPath: string) => ResolveAuthorizedPathResult;
|
|
78
|
-
resolveAuthorizedPathAsync: (pathValue: string, rootPath: string) => Promise<ResolveAuthorizedPathResult>;
|
|
79
|
-
runTextAcc: Map<string, string>;
|
|
80
|
-
sessions: Map<string, ActiveSession>;
|
|
81
|
-
evictIdleSessions: () => void;
|
|
82
|
-
nativeFusion: NativeSessionFusionService | null;
|
|
83
|
-
managerRuntime: ManagerRuntimeService | null;
|
|
84
|
-
chatQueue: ChatQueueService | null;
|
|
85
|
-
activityPublisher?: SessionActivityPublisher | null;
|
|
86
|
-
upgradePolicyController?: UpgradePolicyController | null;
|
|
87
|
-
revokeManagedRoomContextToken?: ((token: string) => void) | null;
|
|
88
|
-
managedRoomExecutor?: ManagedRoomExecutor | null;
|
|
89
|
-
runJournal?: ActiveRunJournal | null;
|
|
90
|
-
recoveryBarrier?: RunRecoveryBarrier | null;
|
|
91
|
-
/** Rebuilds short-lived Room authority from current server state after restart. */
|
|
92
|
-
prepareManagedRecovery?: (record: RunJournalRecord) => Promise<PreparedManagedRoomTurn | null>;
|
|
93
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export declare const MARKDOWN_PDF_SKILL_ID = "markdown-to-pdf";
|
|
2
|
-
export declare const MARKDOWN_PDF_BROWSER_DOCTOR_ID = "markdownPdf.browser";
|
|
3
|
-
export declare const MARKDOWN_PDF_MANAGED_CHROMIUM_ACTION_ID = "markdownPdf.installManagedChromium";
|
|
4
|
-
export declare const MARKDOWN_PDF_SETUP_REQUIRED_CODE = "SKILL_SETUP_REQUIRED";
|
|
5
|
-
export declare const PLAYWRIGHT_VERSION_FOR_MANAGED_CHROMIUM = "1.59.1";
|
|
6
|
-
export type MarkdownPdfSetupRequiredPayload = {
|
|
7
|
-
code: typeof MARKDOWN_PDF_SETUP_REQUIRED_CODE;
|
|
8
|
-
skillId: typeof MARKDOWN_PDF_SKILL_ID;
|
|
9
|
-
doctorId: typeof MARKDOWN_PDF_BROWSER_DOCTOR_ID;
|
|
10
|
-
recommendedRepairActionId: typeof MARKDOWN_PDF_MANAGED_CHROMIUM_ACTION_ID;
|
|
11
|
-
};
|
|
12
|
-
export declare function markdownPdfSetupRequiredPayload(): MarkdownPdfSetupRequiredPayload;
|
|
13
|
-
export declare class MarkdownPdfBrowserMissingError extends Error {
|
|
14
|
-
readonly code = "SKILL_SETUP_REQUIRED";
|
|
15
|
-
readonly setup: MarkdownPdfSetupRequiredPayload;
|
|
16
|
-
constructor(message?: string);
|
|
17
|
-
}
|
|
18
|
-
export type MarkdownToPdfOptions = {
|
|
19
|
-
outputPath?: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
keepHtml?: boolean;
|
|
22
|
-
chromePath?: string;
|
|
23
|
-
};
|
|
24
|
-
export type MarkdownToPdfResult = {
|
|
25
|
-
inputPath: string;
|
|
26
|
-
outputPath: string;
|
|
27
|
-
htmlPath: string | null;
|
|
28
|
-
browserPath: string;
|
|
29
|
-
};
|
|
30
|
-
export declare function defaultPdfOutputPath(inputPath: string): string;
|
|
31
|
-
export declare function renderMarkdownBody(markdown: string, sourceDir?: string): string;
|
|
32
|
-
export declare function renderMarkdownHtml(markdown: string, options?: {
|
|
33
|
-
title?: string;
|
|
34
|
-
sourceDir?: string;
|
|
35
|
-
}): string;
|
|
36
|
-
export declare function managedChromiumBrowsersPath(): string;
|
|
37
|
-
export declare function findChromiumExecutable(explicitPath?: string): Promise<string>;
|
|
38
|
-
export declare function installManagedChromium(): Promise<{
|
|
39
|
-
browsersPath: string;
|
|
40
|
-
output: string;
|
|
41
|
-
}>;
|
|
42
|
-
export declare function convertMarkdownToPdf(inputPath: string, options?: MarkdownToPdfOptions): Promise<MarkdownToPdfResult>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type UpgradeChannel = 'stable' | 'preview';
|
|
2
|
-
/** Separate from identity config: selecting a channel must never rewrite pairing data. */
|
|
3
|
-
export declare function getUpgradeChannel(): UpgradeChannel;
|
|
4
|
-
export declare function setUpgradeChannel(channel: string): void;
|
|
5
|
-
export declare function getUpgradeDistTag(): 'latest' | 'next';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type UpgradeChannel } from './channel.js';
|
|
2
|
-
export type CliDistribution = {
|
|
3
|
-
schemaVersion: 1;
|
|
4
|
-
channel: UpgradeChannel;
|
|
5
|
-
version: string;
|
|
6
|
-
artifact: {
|
|
7
|
-
url: string;
|
|
8
|
-
size: number;
|
|
9
|
-
integrity: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export type CliUpdateSourceOrder = 'npm-first' | 'oss-first';
|
|
13
|
-
export declare function getCliUpdateSourceOrder(value?: string | undefined): CliUpdateSourceOrder;
|
|
14
|
-
export declare function parseCliDistribution(value: unknown, channel: UpgradeChannel): CliDistribution;
|
|
15
|
-
export declare function fetchCliDistribution(options?: {
|
|
16
|
-
baseUrl?: string;
|
|
17
|
-
channel?: UpgradeChannel;
|
|
18
|
-
machineToken?: string;
|
|
19
|
-
timeoutMs?: number;
|
|
20
|
-
}): Promise<CliDistribution>;
|
|
21
|
-
export declare function fetchOwnedCliArtifact(version: string): Promise<CliDistribution['artifact'] | null>;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
export type UpgradeProgress = {
|
|
2
|
-
step: 'checking';
|
|
3
|
-
} | {
|
|
4
|
-
step: 'backing-up';
|
|
5
|
-
} | {
|
|
6
|
-
step: 'installing';
|
|
7
|
-
version: string;
|
|
8
|
-
} | {
|
|
9
|
-
step: 'verifying';
|
|
10
|
-
version: string;
|
|
11
|
-
} | {
|
|
12
|
-
step: 'restarting';
|
|
13
|
-
from: string;
|
|
14
|
-
to: string;
|
|
15
|
-
} | {
|
|
16
|
-
step: 'done';
|
|
17
|
-
from: string;
|
|
18
|
-
to: string;
|
|
19
|
-
};
|
|
20
|
-
export type UpgradeResult = {
|
|
21
|
-
ok: true;
|
|
22
|
-
from: string;
|
|
23
|
-
to: string;
|
|
24
|
-
} | {
|
|
25
|
-
ok: false;
|
|
26
|
-
error: string;
|
|
27
|
-
rolledBack?: boolean;
|
|
28
|
-
};
|
|
29
|
-
export type UpgradeAttempt = {
|
|
30
|
-
from: string;
|
|
31
|
-
to: string;
|
|
32
|
-
attemptCount: number;
|
|
33
|
-
attemptAt: number;
|
|
34
|
-
jobId?: string;
|
|
35
|
-
operation?: 'upgrade' | 'rollback';
|
|
36
|
-
};
|
|
37
|
-
export type UpgradeFailureRecord = {
|
|
38
|
-
version: string;
|
|
39
|
-
failureCount: number;
|
|
40
|
-
firstFailedAt: number;
|
|
41
|
-
lastFailedAt: number;
|
|
42
|
-
nextRetryAt: number;
|
|
43
|
-
error: string;
|
|
44
|
-
};
|
|
45
|
-
export type UpgradeFailures = {
|
|
46
|
-
versions: Record<string, UpgradeFailureRecord>;
|
|
47
|
-
};
|
|
48
|
-
export declare function getCurrentVersion(): string;
|
|
49
|
-
export declare function findPackageJson(startFilePath?: string): string | null;
|
|
50
|
-
export declare function fetchLatestVersion(): Promise<string>;
|
|
51
|
-
/**
|
|
52
|
-
* Compare semver strings. Returns:
|
|
53
|
-
* 'none' — same or older
|
|
54
|
-
* 'patch' — only patch differs
|
|
55
|
-
* 'minor' — minor or patch differs
|
|
56
|
-
* 'major' — major differs
|
|
57
|
-
*/
|
|
58
|
-
export declare function compareVersions(current: string, latest: string): 'none' | 'patch' | 'minor' | 'major';
|
|
59
|
-
export declare function resolveNpmGlobalPrefixFromPackageJson(packageJsonPath: string, platform?: NodeJS.Platform): string | null;
|
|
60
|
-
export declare function readUpgradeAttempt(): UpgradeAttempt | null;
|
|
61
|
-
export declare function writeUpgradeAttempt(attempt: UpgradeAttempt): void;
|
|
62
|
-
export declare function clearUpgradeAttempt(): void;
|
|
63
|
-
export type UpgradeLock = {
|
|
64
|
-
release(): void;
|
|
65
|
-
};
|
|
66
|
-
export declare function acquireUpgradeLock(filePath?: string, opts?: {
|
|
67
|
-
now?: number;
|
|
68
|
-
pid?: number;
|
|
69
|
-
isProcessAlive?: (pid: number) => boolean;
|
|
70
|
-
}): UpgradeLock;
|
|
71
|
-
export declare function readUpgradeFailures(filePath?: string): UpgradeFailures;
|
|
72
|
-
export declare function getUpgradeRetryDelayMs(failureCount: number): number;
|
|
73
|
-
export declare function isUpgradeVersionInCooldown(version: string, now?: number, failures?: UpgradeFailures): boolean;
|
|
74
|
-
export declare function recordUpgradeFailure(version: string, error: string, now?: number): UpgradeFailureRecord;
|
|
75
|
-
export declare function clearUpgradeFailure(version: string): void;
|
|
76
|
-
/**
|
|
77
|
-
* Called on daemon startup. Detects crash loops from a failed upgrade and
|
|
78
|
-
* requests an external rollback if crash count exceeds threshold.
|
|
79
|
-
* Package replacement remains owned by the npm-package-independent Updater.
|
|
80
|
-
*/
|
|
81
|
-
export declare function handleStartupCrashCheck(): Promise<UpgradeAttempt | null>;
|
|
82
|
-
export declare function performUpgrade(targetVersion: string, onProgress: (p: UpgradeProgress) => void, opts?: {
|
|
83
|
-
currentVersion?: string;
|
|
84
|
-
}): Promise<UpgradeResult>;
|
|
85
|
-
export declare function npmExecOptionsForPlatform(platform: NodeJS.Platform, timeout: number): {
|
|
86
|
-
timeout: number;
|
|
87
|
-
windowsHide: boolean;
|
|
88
|
-
shell: boolean;
|
|
89
|
-
};
|
|
90
|
-
export declare function installShennianVersion(targetVersion: string): Promise<void>;
|
|
91
|
-
export declare function verifyInstalledVersion(targetVersion: string): Promise<void>;
|
|
92
|
-
export declare function rollbackToExactVersion(version: string, deps?: {
|
|
93
|
-
install?: (version: string) => Promise<void>;
|
|
94
|
-
verify?: (version: string) => Promise<void>;
|
|
95
|
-
}): Promise<void>;
|
|
96
|
-
export type VersionCheckResult = {
|
|
97
|
-
hasUpdate: false;
|
|
98
|
-
} | {
|
|
99
|
-
hasUpdate: true;
|
|
100
|
-
current: string;
|
|
101
|
-
latest: string;
|
|
102
|
-
changeType: 'patch' | 'minor' | 'major';
|
|
103
|
-
};
|
|
104
|
-
export declare function checkForUpdate(currentVersion?: string): Promise<VersionCheckResult>;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { RuntimeAutoUpgradePolicy } from '../config/index.js';
|
|
2
|
-
import { type VersionCheckResult } from './engine.js';
|
|
3
|
-
export type UpgradeIdleState = {
|
|
4
|
-
idle: boolean;
|
|
5
|
-
reasons: string[];
|
|
6
|
-
};
|
|
7
|
-
export type CliReleasePolicy = {
|
|
8
|
-
automaticPatchEnabled: boolean;
|
|
9
|
-
rolloutPercentage: number;
|
|
10
|
-
pausedVersions: string[];
|
|
11
|
-
blockedVersions: string[];
|
|
12
|
-
blockedCurrentVersions: string[];
|
|
13
|
-
killSwitch: boolean;
|
|
14
|
-
releaseLevel: 'normal' | 'required' | 'blocked';
|
|
15
|
-
/** Legacy wire field; normal updates now wait for idle without a deadline. */
|
|
16
|
-
maxIdleWaitMs: number;
|
|
17
|
-
minimumSessionSyncProtocolVersion?: number;
|
|
18
|
-
minimumDataEpoch?: number;
|
|
19
|
-
requiredCapabilities: string[];
|
|
20
|
-
externalUpdaterEnabled: boolean;
|
|
21
|
-
minimumUpdaterProtocolVersion?: number;
|
|
22
|
-
};
|
|
23
|
-
type AutoUpgradeSchedulerDeps = {
|
|
24
|
-
currentVersion: string;
|
|
25
|
-
machineId: string;
|
|
26
|
-
serverUrl: string;
|
|
27
|
-
getIdleState: () => UpgradeIdleState;
|
|
28
|
-
startUpgrade: (targetVersion: string, mandatory?: boolean) => Promise<void>;
|
|
29
|
-
checkForUpdate?: (currentVersion?: string) => Promise<VersionCheckResult>;
|
|
30
|
-
fetchReleasePolicy?: () => Promise<CliReleasePolicy>;
|
|
31
|
-
inCooldown?: (version: string) => boolean;
|
|
32
|
-
initialDelayMs?: number;
|
|
33
|
-
intervalMs?: number;
|
|
34
|
-
setTimeout?: (handler: () => void, delayMs: number) => ReturnType<typeof setTimeout>;
|
|
35
|
-
clearTimeout?: (timer: ReturnType<typeof setTimeout>) => void;
|
|
36
|
-
random?: () => number;
|
|
37
|
-
sessionSyncProtocolVersion?: number;
|
|
38
|
-
dataEpoch?: number;
|
|
39
|
-
advertisedCapabilities?: readonly string[];
|
|
40
|
-
updaterProtocolVersion?: number;
|
|
41
|
-
};
|
|
42
|
-
export declare function deterministicRolloutBucket(machineId: string): number;
|
|
43
|
-
export declare function isAutomaticPatchAllowed(policy: CliReleasePolicy, machineId: string, currentVersion: string, targetVersion: string): boolean;
|
|
44
|
-
export declare function fetchCliReleasePolicy(serverUrl: string): Promise<CliReleasePolicy>;
|
|
45
|
-
export declare class AutoUpgradeScheduler {
|
|
46
|
-
private deps;
|
|
47
|
-
private policy;
|
|
48
|
-
private timer;
|
|
49
|
-
private started;
|
|
50
|
-
private upgradeInFlight;
|
|
51
|
-
constructor(deps: AutoUpgradeSchedulerDeps);
|
|
52
|
-
start(): void;
|
|
53
|
-
stop(): void;
|
|
54
|
-
setPolicy(policy: RuntimeAutoUpgradePolicy): void;
|
|
55
|
-
getPolicy(): RuntimeAutoUpgradePolicy;
|
|
56
|
-
runOnce(): Promise<void>;
|
|
57
|
-
private nextIntervalMs;
|
|
58
|
-
private arm;
|
|
59
|
-
}
|
|
60
|
-
export {};
|