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,49 +0,0 @@
|
|
|
1
|
-
import type { RoomSessionRegistry } from './session-registry.js';
|
|
2
|
-
export declare const MANAGED_ROOM_CONTEXT_ENV = "SHENNIAN_MANAGED_ROOM_CONTEXT";
|
|
3
|
-
export type ManagedRoomAction = 'status' | 'read' | 'send' | 'attachment.get' | 'pause';
|
|
4
|
-
type ManagedRoomGrant = {
|
|
5
|
-
tokenHash: string;
|
|
6
|
-
registryKey: string;
|
|
7
|
-
registrationEpoch: number;
|
|
8
|
-
bindingId: string;
|
|
9
|
-
roomId: string;
|
|
10
|
-
credentialHash: string;
|
|
11
|
-
allowedActions: ReadonlySet<ManagedRoomAction>;
|
|
12
|
-
activationCauseMessageId?: string;
|
|
13
|
-
expiresAt: number;
|
|
14
|
-
};
|
|
15
|
-
export declare class ManagedRoomContextError extends Error {
|
|
16
|
-
readonly code: string;
|
|
17
|
-
constructor(code: string, message: string);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Daemon-memory-only authority. A daemon restart drops every grant. The opaque
|
|
21
|
-
* token is safe to inject into the exact child process, but is never persisted
|
|
22
|
-
* or included in a prompt, command argument, transcript, Room message or log.
|
|
23
|
-
*/
|
|
24
|
-
export declare class ManagedRoomContextAuthority {
|
|
25
|
-
private readonly registry;
|
|
26
|
-
private readonly now;
|
|
27
|
-
private readonly grants;
|
|
28
|
-
constructor(registry: RoomSessionRegistry, now?: () => number);
|
|
29
|
-
issue(input: {
|
|
30
|
-
registryKey: string;
|
|
31
|
-
machineCredential: string;
|
|
32
|
-
ttlMs?: number;
|
|
33
|
-
allowedActions?: ManagedRoomAction[];
|
|
34
|
-
activationCauseMessageId?: string;
|
|
35
|
-
}): string;
|
|
36
|
-
resolve(input: {
|
|
37
|
-
token: string;
|
|
38
|
-
action: ManagedRoomAction | 'manager';
|
|
39
|
-
machineCredential: string;
|
|
40
|
-
}): {
|
|
41
|
-
grant: ManagedRoomGrant;
|
|
42
|
-
registration: import("./session-registry.js").RoomSessionRegistration;
|
|
43
|
-
binding: import("./session-registry.js").RoomSessionBindingState;
|
|
44
|
-
};
|
|
45
|
-
revokeToken(token: string): void;
|
|
46
|
-
revokeSession(registryKey: string): void;
|
|
47
|
-
private prune;
|
|
48
|
-
}
|
|
49
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { ManagedAgentEnforcement, ManagedAgentPermissionPolicy, AgentType, RoomActivationMode } from '@shennian/wire';
|
|
2
|
-
export declare const MANAGED_ROOM_POLICY_VERSION = "managed-room-surface-v6";
|
|
3
|
-
export type ManagedRoomPromptInput = {
|
|
4
|
-
agent: {
|
|
5
|
-
displayName: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
systemPrompt?: string;
|
|
8
|
-
configurationVersion?: number;
|
|
9
|
-
};
|
|
10
|
-
room: {
|
|
11
|
-
name: string;
|
|
12
|
-
activationMode: RoomActivationMode;
|
|
13
|
-
members?: Array<{
|
|
14
|
-
displayName: string;
|
|
15
|
-
principalType: 'human' | 'agent';
|
|
16
|
-
description?: string;
|
|
17
|
-
ownerDisplayName?: string | null;
|
|
18
|
-
}>;
|
|
19
|
-
};
|
|
20
|
-
runtimePermissions?: ManagedRoomRuntimePermissions;
|
|
21
|
-
runtimeAdapter?: AgentType;
|
|
22
|
-
sessionModeInstructions?: string | null;
|
|
23
|
-
};
|
|
24
|
-
export type ManagedRoomRuntimePermissions = {
|
|
25
|
-
/** User authorization ceiling; native over-grants must never widen model behavior. */
|
|
26
|
-
requestedPolicy: ManagedAgentPermissionPolicy;
|
|
27
|
-
enforcement: ManagedAgentEnforcement;
|
|
28
|
-
/** daemon-verified realpath from the immutable per-turn policy snapshot. */
|
|
29
|
-
resolvedWorkDir: string;
|
|
30
|
-
};
|
|
31
|
-
export type ManagedRoomPromptSnapshot = {
|
|
32
|
-
agentConfigurationVersion?: number;
|
|
33
|
-
providerBaseVersion: 'provider-owned';
|
|
34
|
-
managedRoomPolicyVersion: typeof MANAGED_ROOM_POLICY_VERSION;
|
|
35
|
-
sessionModeInstructionsHash: string | null;
|
|
36
|
-
agentSystemPromptHash: string | null;
|
|
37
|
-
runtimePermissionPolicyHash: string | null;
|
|
38
|
-
resolvedWorkDirHash: string | null;
|
|
39
|
-
enforcementLevel: ManagedAgentEnforcement['level'] | null;
|
|
40
|
-
trustedRoomContextHash: string;
|
|
41
|
-
allowedRoomOperations: readonly string[];
|
|
42
|
-
};
|
|
43
|
-
export declare function composeManagedRoomPrompt(input: ManagedRoomPromptInput): {
|
|
44
|
-
systemPrompt: string;
|
|
45
|
-
snapshot: ManagedRoomPromptSnapshot;
|
|
46
|
-
};
|
|
47
|
-
export declare function buildManagedAgentPermissionPrompt(input: ManagedRoomRuntimePermissions): string;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { type AgentType, type RoomActivationMode } from '@shennian/wire';
|
|
2
|
-
import type { HttpRoomBindingClient } from './room-binding-client.js';
|
|
3
|
-
import type { RoomHostSessionObservationStore } from './host-session-observations.js';
|
|
4
|
-
import type { RoomSessionRegistry } from './session-registry.js';
|
|
5
|
-
export type ManagedRoomBindInput = {
|
|
6
|
-
roomId: string;
|
|
7
|
-
agentIdentityId: string;
|
|
8
|
-
nianSessionId: string;
|
|
9
|
-
assignmentIntentId: string;
|
|
10
|
-
sourceSessionKey: string;
|
|
11
|
-
agentType: AgentType;
|
|
12
|
-
activationMode?: RoomActivationMode;
|
|
13
|
-
};
|
|
14
|
-
export type ManagedRoomRestartInput = ManagedRoomBindInput & {
|
|
15
|
-
bindingId: string;
|
|
16
|
-
previousNianSessionId: string;
|
|
17
|
-
};
|
|
18
|
-
export type ManagedRoomBinder = {
|
|
19
|
-
bind(input: ManagedRoomBindInput): Promise<{
|
|
20
|
-
binding: {
|
|
21
|
-
id: string;
|
|
22
|
-
roomId: string;
|
|
23
|
-
agentIdentityId: string;
|
|
24
|
-
agentMembershipId: string;
|
|
25
|
-
nianSessionId: string;
|
|
26
|
-
status: 'pending_approval' | 'active' | 'paused' | 'detached';
|
|
27
|
-
activationMode: 'auto_follow' | 'mention_only' | 'paused';
|
|
28
|
-
};
|
|
29
|
-
resumeSequence: string;
|
|
30
|
-
idempotent: boolean;
|
|
31
|
-
}>;
|
|
32
|
-
restart(input: ManagedRoomRestartInput): Promise<{
|
|
33
|
-
binding: {
|
|
34
|
-
id: string;
|
|
35
|
-
roomId: string;
|
|
36
|
-
agentIdentityId: string;
|
|
37
|
-
agentMembershipId: string;
|
|
38
|
-
nianSessionId: string;
|
|
39
|
-
status: 'pending_approval' | 'active' | 'paused' | 'detached';
|
|
40
|
-
activationMode: 'auto_follow' | 'mention_only' | 'paused';
|
|
41
|
-
};
|
|
42
|
-
resumeSequence: string;
|
|
43
|
-
idempotent: boolean;
|
|
44
|
-
}>;
|
|
45
|
-
};
|
|
46
|
-
export declare class TrustedManagedRoomBinder implements ManagedRoomBinder {
|
|
47
|
-
private readonly deps;
|
|
48
|
-
constructor(deps: {
|
|
49
|
-
registry: RoomSessionRegistry;
|
|
50
|
-
observations: RoomHostSessionObservationStore;
|
|
51
|
-
bindingClient: Pick<HttpRoomBindingClient, 'create' | 'restart' | 'status'>;
|
|
52
|
-
getMachineCredentials: () => {
|
|
53
|
-
machineId?: string;
|
|
54
|
-
machineToken?: string;
|
|
55
|
-
};
|
|
56
|
-
hostProcessIdentity: () => string;
|
|
57
|
-
});
|
|
58
|
-
bind(input: ManagedRoomBindInput): Promise<{
|
|
59
|
-
binding: import("./room-binding-client.js").RemoteRoomBinding;
|
|
60
|
-
resumeSequence: string;
|
|
61
|
-
idempotent: boolean;
|
|
62
|
-
}>;
|
|
63
|
-
restart(input: ManagedRoomRestartInput): Promise<{
|
|
64
|
-
binding: import("./room-binding-client.js").RemoteRoomBinding;
|
|
65
|
-
resumeSequence: string;
|
|
66
|
-
idempotent: boolean;
|
|
67
|
-
}>;
|
|
68
|
-
private resolveServerOwnedWorkspace;
|
|
69
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { ScheduleAction } from '@shennian/wire';
|
|
2
|
-
import type { DaemonIpcHandler } from '../daemon-ipc/server.js';
|
|
3
|
-
import type { JsonValue } from '../daemon-ipc/json.js';
|
|
4
|
-
import type { ManagedWorkerRoomOrigin } from '../manager/registry.js';
|
|
5
|
-
import { ManagedRoomContextAuthority } from './managed-context.js';
|
|
6
|
-
import type { HttpRoomActionClient } from './room-action-client.js';
|
|
7
|
-
import type { RoomAttachmentCache } from './attachment-cache.js';
|
|
8
|
-
import type { RoomAttachmentUploader } from './attachment-upload.js';
|
|
9
|
-
import type { RoomHostSessionObservationStore } from './host-session-observations.js';
|
|
10
|
-
export declare function createManagedRoomIpcHandlers(input: {
|
|
11
|
-
authority: ManagedRoomContextAuthority;
|
|
12
|
-
actionClient: Pick<HttpRoomActionClient, 'status' | 'read' | 'send' | 'pause'>;
|
|
13
|
-
attachmentCache: Pick<RoomAttachmentCache, 'materialize'>;
|
|
14
|
-
attachmentUploader: Pick<RoomAttachmentUploader, 'upload'>;
|
|
15
|
-
observations: RoomHostSessionObservationStore;
|
|
16
|
-
getMachineCredentials: () => {
|
|
17
|
-
machineToken?: string;
|
|
18
|
-
};
|
|
19
|
-
scheduleExecutor?: (sessionId: string, action: ScheduleAction, params: Record<string, unknown>) => Promise<unknown>;
|
|
20
|
-
managerExecutor?: ManagedManagerExecutor;
|
|
21
|
-
}): Record<string, DaemonIpcHandler>;
|
|
22
|
-
export type ManagedRoomDynamicContentItem = {
|
|
23
|
-
type: 'inputText';
|
|
24
|
-
text: string;
|
|
25
|
-
} | {
|
|
26
|
-
type: 'inputImage';
|
|
27
|
-
imageUrl: string;
|
|
28
|
-
} | {
|
|
29
|
-
type: 'inputAudio';
|
|
30
|
-
audioUrl: string;
|
|
31
|
-
};
|
|
32
|
-
export type ManagedRoomExecutorOptions = {
|
|
33
|
-
signal?: AbortSignal;
|
|
34
|
-
attachmentOutput?: 'codex-inline';
|
|
35
|
-
};
|
|
36
|
-
export type ManagedRoomExecutor = (params: JsonValue | undefined, options?: ManagedRoomExecutorOptions) => Promise<JsonValue>;
|
|
37
|
-
export type ManagedManagerAction = 'manager.sessions.list' | 'manager.sessions.start' | 'manager.sessions.send' | 'manager.sessions.queue' | 'manager.sessions.queue.edit' | 'manager.sessions.queue.delete' | 'manager.sessions.stop' | 'manager.sessions.read' | 'manager.memory.path';
|
|
38
|
-
export type ManagedManagerExecutor = (input: {
|
|
39
|
-
managerSessionId: string;
|
|
40
|
-
roomOrigin?: ManagedWorkerRoomOrigin;
|
|
41
|
-
action: ManagedManagerAction;
|
|
42
|
-
params: Record<string, JsonValue>;
|
|
43
|
-
}) => Promise<JsonValue>;
|
|
44
|
-
/**
|
|
45
|
-
* Executes one managed Room action inside the daemon trust boundary. Both the
|
|
46
|
-
* local IPC compatibility transport and Codex dynamic tools call this same
|
|
47
|
-
* function, so token, binding, action and machine credential checks cannot
|
|
48
|
-
* diverge between transports.
|
|
49
|
-
*/
|
|
50
|
-
export declare function createManagedRoomExecutor(input: {
|
|
51
|
-
authority: ManagedRoomContextAuthority;
|
|
52
|
-
actionClient: Pick<HttpRoomActionClient, 'status' | 'read' | 'send' | 'pause'>;
|
|
53
|
-
attachmentCache: Pick<RoomAttachmentCache, 'materialize'>;
|
|
54
|
-
attachmentUploader: Pick<RoomAttachmentUploader, 'upload'>;
|
|
55
|
-
observations: RoomHostSessionObservationStore;
|
|
56
|
-
getMachineCredentials: () => {
|
|
57
|
-
machineToken?: string;
|
|
58
|
-
};
|
|
59
|
-
onPaused?: (input: {
|
|
60
|
-
registryKey: string;
|
|
61
|
-
sessionId: string;
|
|
62
|
-
}) => void;
|
|
63
|
-
scheduleExecutor?: (sessionId: string, action: ScheduleAction, params: Record<string, unknown>) => Promise<unknown>;
|
|
64
|
-
managerExecutor?: ManagedManagerExecutor;
|
|
65
|
-
}): ManagedRoomExecutor;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { HttpRoomActionClient } from './room-action-client.js';
|
|
2
|
-
import { RoomSessionRegistry, type RoomSessionRegistration } from './session-registry.js';
|
|
3
|
-
import type { RoomHostSessionObservationStore } from './host-session-observations.js';
|
|
4
|
-
import type { RoomMessageView } from '@shennian/wire';
|
|
5
|
-
import type { RoomActivationContext } from './activation-service.js';
|
|
6
|
-
type Timer = ReturnType<typeof setTimeout>;
|
|
7
|
-
export declare class RoomMirrorSyncService {
|
|
8
|
-
private readonly deps;
|
|
9
|
-
private timer;
|
|
10
|
-
private running;
|
|
11
|
-
private started;
|
|
12
|
-
constructor(deps: {
|
|
13
|
-
registry: RoomSessionRegistry;
|
|
14
|
-
observations?: RoomHostSessionObservationStore;
|
|
15
|
-
actionClient: Pick<HttpRoomActionClient, 'status' | 'read'>;
|
|
16
|
-
getMachineCredentials: () => {
|
|
17
|
-
machineToken?: string;
|
|
18
|
-
};
|
|
19
|
-
/** @deprecated ignored; messages are no longer mirrored to local JSONL. */
|
|
20
|
-
mirrorFactory?: (roomId: string) => unknown;
|
|
21
|
-
initialDelayMs?: number;
|
|
22
|
-
intervalMs?: number;
|
|
23
|
-
maxPagesPerRun?: number;
|
|
24
|
-
setTimeout?: (handler: () => void, delayMs: number) => Timer;
|
|
25
|
-
clearTimeout?: (timer: Timer) => void;
|
|
26
|
-
onMessages?: (roomId: string, messages: RoomMessageView[], registrations: RoomSessionRegistration[], context: RoomActivationContext) => Promise<void>;
|
|
27
|
-
isSessionDeleted?: (sessionId: string) => boolean;
|
|
28
|
-
onBindingPaused?: (registration: RoomSessionRegistration) => void;
|
|
29
|
-
});
|
|
30
|
-
start(): void;
|
|
31
|
-
stop(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Fast path for an authoritative Room message delivered over the machine
|
|
34
|
-
* Relay. The message body is already present, so this must not perform the
|
|
35
|
-
* normal status/read HTTP round-trip. The periodic cursor sync remains the
|
|
36
|
-
* compatibility and reconnect repair path for older servers and missed
|
|
37
|
-
* frames.
|
|
38
|
-
*/
|
|
39
|
-
deliverLive(message: RoomMessageView): Promise<{
|
|
40
|
-
accepted: boolean;
|
|
41
|
-
registrationCount: number;
|
|
42
|
-
}>;
|
|
43
|
-
runOnce(): Promise<void>;
|
|
44
|
-
private syncRoom;
|
|
45
|
-
private pullPages;
|
|
46
|
-
private retire;
|
|
47
|
-
private arm;
|
|
48
|
-
}
|
|
49
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { PublicRoomClient } from './public-room-client.js';
|
|
2
|
-
type AttachmentMetadata = {
|
|
3
|
-
attachmentId: string;
|
|
4
|
-
name: string;
|
|
5
|
-
mimeType: string;
|
|
6
|
-
byteSize: string;
|
|
7
|
-
sha256: string;
|
|
8
|
-
};
|
|
9
|
-
export declare class PublicAttachmentCache {
|
|
10
|
-
private readonly options;
|
|
11
|
-
constructor(options: {
|
|
12
|
-
client: PublicRoomClient;
|
|
13
|
-
rootDirectory?: string;
|
|
14
|
-
maxCacheBytes?: number;
|
|
15
|
-
maxCacheAgeMs?: number;
|
|
16
|
-
});
|
|
17
|
-
lookup(roomId: string, attachment: AttachmentMetadata): {
|
|
18
|
-
downloaded: boolean;
|
|
19
|
-
localPath: string | null;
|
|
20
|
-
};
|
|
21
|
-
materialize(roomId: string, attachmentId: string): Promise<{
|
|
22
|
-
localPath: string;
|
|
23
|
-
downloaded: true;
|
|
24
|
-
cached: boolean;
|
|
25
|
-
name: string;
|
|
26
|
-
mimeType: string;
|
|
27
|
-
byteSize: string;
|
|
28
|
-
sha256: string;
|
|
29
|
-
}>;
|
|
30
|
-
prune(preservePath?: string): void;
|
|
31
|
-
private root;
|
|
32
|
-
private entry;
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export declare class PublicRoomClientError extends Error {
|
|
2
|
-
readonly code: string;
|
|
3
|
-
readonly nextAction: Record<string, string> | null;
|
|
4
|
-
constructor(code: string, message: string, nextAction?: Record<string, string> | null);
|
|
5
|
-
}
|
|
6
|
-
export declare class PublicRoomClient {
|
|
7
|
-
private readonly fetchImpl;
|
|
8
|
-
constructor(fetchImpl?: typeof fetch);
|
|
9
|
-
create(name: string): Promise<Record<string, unknown>>;
|
|
10
|
-
join(roomId: string, inviteToken: string, message?: string): Promise<Record<string, unknown>>;
|
|
11
|
-
open(roomId: string): Promise<Record<string, unknown>>;
|
|
12
|
-
status(roomId: string): Promise<Record<string, unknown>>;
|
|
13
|
-
read(roomId: string, input: {
|
|
14
|
-
before?: string;
|
|
15
|
-
after?: string;
|
|
16
|
-
limit: number;
|
|
17
|
-
}): Promise<Record<string, unknown>>;
|
|
18
|
-
send(roomId: string, input: {
|
|
19
|
-
clientMessageId: string;
|
|
20
|
-
text?: string;
|
|
21
|
-
attachmentIds?: string[];
|
|
22
|
-
}): Promise<Record<string, unknown>>;
|
|
23
|
-
initializeAttachment(roomId: string, input: {
|
|
24
|
-
clientUploadId: string;
|
|
25
|
-
name: string;
|
|
26
|
-
mediaKind: 'image' | 'audio' | 'file';
|
|
27
|
-
mimeType: string;
|
|
28
|
-
byteSize: number;
|
|
29
|
-
sha256: string;
|
|
30
|
-
}): Promise<Record<string, unknown>>;
|
|
31
|
-
completeAttachment(roomId: string, attachmentId: string): Promise<Record<string, unknown>>;
|
|
32
|
-
getAttachmentDownload(roomId: string, attachmentId: string): Promise<Record<string, unknown>>;
|
|
33
|
-
leave(roomId: string): Promise<Record<string, unknown>>;
|
|
34
|
-
upload(url: string, headers: Record<string, string>, data: Buffer): Promise<void>;
|
|
35
|
-
download(url: string): Promise<Response>;
|
|
36
|
-
private request;
|
|
37
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { RoomSessionRegistration, RoomSessionRegistry } from './session-registry.js';
|
|
2
|
-
import type { RemoteRoomAgentStatus } from './room-action-client.js';
|
|
3
|
-
export declare function isCurrentRegistration(registry: RoomSessionRegistry, snapshot: RoomSessionRegistration): boolean;
|
|
4
|
-
export declare function matchesRoomOwner(registration: RoomSessionRegistration, remote: Pick<RemoteRoomAgentStatus, 'nianSessionId' | 'sessionRegistryKey'>): boolean;
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import type { ManagedAgentPermissionConfirmation, ManagedAgentPermissionPolicy, RoomActivationMode, SessionMode } from '@shennian/wire';
|
|
2
|
-
export type FetchLike = typeof fetch;
|
|
3
|
-
export type BindingTarget = {
|
|
4
|
-
machineToken: string;
|
|
5
|
-
roomId: string;
|
|
6
|
-
bindingId: string;
|
|
7
|
-
signal?: AbortSignal;
|
|
8
|
-
};
|
|
9
|
-
export type RemoteRoomAgentStatus = {
|
|
10
|
-
scheduleAuthorized?: boolean;
|
|
11
|
-
/** Additive authority fields; absent on older servers. */
|
|
12
|
-
nianSessionId?: string | null;
|
|
13
|
-
sessionRegistryKey?: string;
|
|
14
|
-
bindingId: string;
|
|
15
|
-
roomId: string;
|
|
16
|
-
agentIdentityId: string;
|
|
17
|
-
agentMembershipId: string | null;
|
|
18
|
-
status: 'pending_approval' | 'active' | 'paused' | 'detached';
|
|
19
|
-
activationCapability?: 'managed' | 'idle_resume' | 'notify_only';
|
|
20
|
-
activationMode: RoomActivationMode;
|
|
21
|
-
managedWorkspacePath?: string | null;
|
|
22
|
-
lastDeliveredSequence: string;
|
|
23
|
-
lastActivatedSequence: string;
|
|
24
|
-
appliedConfigurationVersion?: number;
|
|
25
|
-
pendingConfigurationVersion?: number | null;
|
|
26
|
-
agent?: {
|
|
27
|
-
displayName: string;
|
|
28
|
-
description: string;
|
|
29
|
-
systemPrompt?: string;
|
|
30
|
-
sessionMode: SessionMode;
|
|
31
|
-
managerConfig?: import('@shennian/wire').ManagerConfig | null;
|
|
32
|
-
permissionPolicy: ManagedAgentPermissionPolicy;
|
|
33
|
-
permissionConfirmation: ManagedAgentPermissionConfirmation | null;
|
|
34
|
-
configurationVersion?: number;
|
|
35
|
-
configurationPending?: boolean;
|
|
36
|
-
};
|
|
37
|
-
room: {
|
|
38
|
-
name: string;
|
|
39
|
-
status: string;
|
|
40
|
-
lastSequence: string;
|
|
41
|
-
memberCount?: number;
|
|
42
|
-
members?: Array<{
|
|
43
|
-
displayName: string;
|
|
44
|
-
principalType: 'human' | 'agent';
|
|
45
|
-
description?: string;
|
|
46
|
-
ownerDisplayName?: string | null;
|
|
47
|
-
}>;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
export type RemoteRoomJoinResult = {
|
|
51
|
-
outcome: 'joined' | 'pending_approval';
|
|
52
|
-
room: {
|
|
53
|
-
id: string;
|
|
54
|
-
name: string;
|
|
55
|
-
canonicalUrl: string;
|
|
56
|
-
};
|
|
57
|
-
agentIdentity: {
|
|
58
|
-
id: string;
|
|
59
|
-
displayName: string;
|
|
60
|
-
};
|
|
61
|
-
binding: {
|
|
62
|
-
id: string;
|
|
63
|
-
roomId: string;
|
|
64
|
-
agentIdentityId: string;
|
|
65
|
-
agentMembershipId: string | null;
|
|
66
|
-
status: 'pending_approval' | 'active' | 'paused';
|
|
67
|
-
activationMode: RoomActivationMode;
|
|
68
|
-
};
|
|
69
|
-
joinRequestId?: string;
|
|
70
|
-
idempotent: boolean;
|
|
71
|
-
};
|
|
72
|
-
export type RemoteRoomAttachmentCapability = {
|
|
73
|
-
attachmentId: string;
|
|
74
|
-
roomId: string;
|
|
75
|
-
safeName: string;
|
|
76
|
-
mimeType: string;
|
|
77
|
-
byteSize: string;
|
|
78
|
-
sha256: string;
|
|
79
|
-
downloadUrl: string;
|
|
80
|
-
expiresAt: string;
|
|
81
|
-
};
|
|
82
|
-
export type RemoteRoomAttachmentUpload = {
|
|
83
|
-
attachment: {
|
|
84
|
-
id: string;
|
|
85
|
-
roomId: string;
|
|
86
|
-
name: string;
|
|
87
|
-
mimeType: string;
|
|
88
|
-
byteSize: string;
|
|
89
|
-
sha256: string;
|
|
90
|
-
status: 'pending' | 'uploaded';
|
|
91
|
-
};
|
|
92
|
-
upload: {
|
|
93
|
-
method: 'PUT';
|
|
94
|
-
url: string;
|
|
95
|
-
headers: Record<string, string>;
|
|
96
|
-
expiresAt: string;
|
|
97
|
-
};
|
|
98
|
-
idempotent: boolean;
|
|
99
|
-
};
|
|
100
|
-
export type RemoteRoomCreateResult = {
|
|
101
|
-
outcome: 'created';
|
|
102
|
-
room: {
|
|
103
|
-
id: string;
|
|
104
|
-
name: string;
|
|
105
|
-
visibility: 'private';
|
|
106
|
-
joinPolicy: 'open';
|
|
107
|
-
canonicalUrl: string;
|
|
108
|
-
inviteUrl: string;
|
|
109
|
-
};
|
|
110
|
-
agentIdentity: {
|
|
111
|
-
id: string;
|
|
112
|
-
displayName: string;
|
|
113
|
-
};
|
|
114
|
-
binding: {
|
|
115
|
-
id: string;
|
|
116
|
-
roomId: string;
|
|
117
|
-
agentIdentityId: string;
|
|
118
|
-
agentMembershipId: string;
|
|
119
|
-
status: 'active' | 'paused';
|
|
120
|
-
activationMode: RoomActivationMode;
|
|
121
|
-
};
|
|
122
|
-
idempotent: boolean;
|
|
123
|
-
};
|
|
124
|
-
export type RemoteOperatorRoomCreateResult = {
|
|
125
|
-
outcome: 'created';
|
|
126
|
-
room: {
|
|
127
|
-
id: string;
|
|
128
|
-
name: string;
|
|
129
|
-
visibility: 'private';
|
|
130
|
-
joinPolicy: 'open';
|
|
131
|
-
canonicalUrl: string;
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
export declare class RoomActionHttpError extends Error {
|
|
135
|
-
readonly code: string;
|
|
136
|
-
constructor(code: string, message: string);
|
|
137
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { type RoomActivationMode, type RoomMessageView } from '@shennian/wire';
|
|
2
|
-
import { type BindingTarget, type FetchLike, type RemoteOperatorRoomCreateResult, type RemoteRoomAgentStatus, type RemoteRoomAttachmentCapability, type RemoteRoomAttachmentUpload, type RemoteRoomCreateResult, type RemoteRoomJoinResult } from './room-action-client-types.js';
|
|
3
|
-
export * from './room-action-client-types.js';
|
|
4
|
-
export declare class HttpRoomActionClient {
|
|
5
|
-
private readonly fetchImpl;
|
|
6
|
-
private readonly baseUrl;
|
|
7
|
-
constructor(serverUrl: string, fetchImpl?: FetchLike);
|
|
8
|
-
createOperatorRoom(input: {
|
|
9
|
-
machineToken: string;
|
|
10
|
-
name: string;
|
|
11
|
-
}): Promise<RemoteOperatorRoomCreateResult>;
|
|
12
|
-
resolveNativeSession(input: {
|
|
13
|
-
machineToken: string;
|
|
14
|
-
runtimeAdapter: 'codex' | 'claude_code' | 'workbuddy';
|
|
15
|
-
sourceSessionKey: string;
|
|
16
|
-
}): Promise<{
|
|
17
|
-
nianSessionId: string;
|
|
18
|
-
created: boolean;
|
|
19
|
-
}>;
|
|
20
|
-
createRoom(input: {
|
|
21
|
-
machineToken: string;
|
|
22
|
-
bindingIntentId: string;
|
|
23
|
-
nianSessionId: string;
|
|
24
|
-
runtimeAdapter: 'codex' | 'claude_code' | 'workbuddy';
|
|
25
|
-
sessionRegistryKey: string;
|
|
26
|
-
name: string;
|
|
27
|
-
agentAlias: string;
|
|
28
|
-
agentDescription?: string;
|
|
29
|
-
activationCapability: 'managed' | 'idle_resume' | 'notify_only';
|
|
30
|
-
activationMode: RoomActivationMode;
|
|
31
|
-
}): Promise<RemoteRoomCreateResult>;
|
|
32
|
-
joinRoom(input: {
|
|
33
|
-
machineToken: string;
|
|
34
|
-
bindingIntentId: string;
|
|
35
|
-
nianSessionId: string;
|
|
36
|
-
runtimeAdapter: 'codex' | 'claude_code' | 'workbuddy';
|
|
37
|
-
sessionRegistryKey: string;
|
|
38
|
-
inviteToken: string;
|
|
39
|
-
message?: string;
|
|
40
|
-
agentAlias: string;
|
|
41
|
-
agentDescription?: string;
|
|
42
|
-
activationCapability: 'managed' | 'idle_resume' | 'notify_only';
|
|
43
|
-
activationMode: RoomActivationMode;
|
|
44
|
-
}): Promise<RemoteRoomJoinResult>;
|
|
45
|
-
status(target: BindingTarget & {
|
|
46
|
-
scheduleAuthorization?: boolean;
|
|
47
|
-
causeMessageId?: string;
|
|
48
|
-
}): Promise<RemoteRoomAgentStatus>;
|
|
49
|
-
getAttachmentCapability(target: BindingTarget & {
|
|
50
|
-
attachmentId: string;
|
|
51
|
-
}): Promise<RemoteRoomAttachmentCapability>;
|
|
52
|
-
initializeAttachment(target: BindingTarget & {
|
|
53
|
-
clientUploadId: string;
|
|
54
|
-
name: string;
|
|
55
|
-
mediaKind: 'image' | 'audio' | 'file';
|
|
56
|
-
mimeType: string;
|
|
57
|
-
byteSize: number;
|
|
58
|
-
sha256: string;
|
|
59
|
-
}): Promise<RemoteRoomAttachmentUpload>;
|
|
60
|
-
completeAttachment(target: BindingTarget & {
|
|
61
|
-
attachmentId: string;
|
|
62
|
-
}): Promise<{
|
|
63
|
-
attachment: {
|
|
64
|
-
attachmentId: string;
|
|
65
|
-
mediaKind: 'image' | 'audio' | 'file';
|
|
66
|
-
name: string;
|
|
67
|
-
mimeType: string;
|
|
68
|
-
byteSize: string;
|
|
69
|
-
sha256: string;
|
|
70
|
-
status: 'ready';
|
|
71
|
-
};
|
|
72
|
-
idempotent: boolean;
|
|
73
|
-
}>;
|
|
74
|
-
read(target: BindingTarget & {
|
|
75
|
-
beforeSequence?: string;
|
|
76
|
-
afterSequence?: string;
|
|
77
|
-
limit: number;
|
|
78
|
-
}): Promise<{
|
|
79
|
-
messages: RoomMessageView[];
|
|
80
|
-
nextSequence: string;
|
|
81
|
-
hasMore: boolean;
|
|
82
|
-
historyFromSequence: string;
|
|
83
|
-
roomName: string;
|
|
84
|
-
}>;
|
|
85
|
-
send(target: BindingTarget & {
|
|
86
|
-
clientMessageId: string;
|
|
87
|
-
text: string;
|
|
88
|
-
mentionMembershipIds?: string[];
|
|
89
|
-
replyToMessageId?: string;
|
|
90
|
-
activationCauseMessageId?: string;
|
|
91
|
-
attachmentIds?: string[];
|
|
92
|
-
}): Promise<{
|
|
93
|
-
message: RoomMessageView;
|
|
94
|
-
idempotent: boolean;
|
|
95
|
-
}>;
|
|
96
|
-
mode(target: BindingTarget & {
|
|
97
|
-
activationMode: RoomActivationMode;
|
|
98
|
-
}): Promise<{
|
|
99
|
-
bindingId: string;
|
|
100
|
-
roomId: string;
|
|
101
|
-
status: 'active' | 'paused';
|
|
102
|
-
activationMode: RoomActivationMode;
|
|
103
|
-
idempotent: boolean;
|
|
104
|
-
}>;
|
|
105
|
-
pause(target: BindingTarget & {
|
|
106
|
-
reason: string;
|
|
107
|
-
}): Promise<{
|
|
108
|
-
bindingId: string;
|
|
109
|
-
roomId: string;
|
|
110
|
-
status: 'paused';
|
|
111
|
-
activationMode: 'paused';
|
|
112
|
-
message: RoomMessageView;
|
|
113
|
-
idempotent: boolean;
|
|
114
|
-
}>;
|
|
115
|
-
private request;
|
|
116
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { RoomActivationCapability, RoomActivationMode, RoomBindingStatus, RoomRuntimeAdapter } from '@shennian/wire';
|
|
2
|
-
import { HttpRoomActionClient } from './room-action-client.js';
|
|
3
|
-
type FetchLike = typeof fetch;
|
|
4
|
-
export type CreateRemoteRoomBindingInput = {
|
|
5
|
-
machineToken: string;
|
|
6
|
-
bindingIntentId: string;
|
|
7
|
-
roomId: string;
|
|
8
|
-
agentIdentityId: string;
|
|
9
|
-
nianSessionId: string;
|
|
10
|
-
runtimeAdapter: RoomRuntimeAdapter;
|
|
11
|
-
sessionRegistryKey: string;
|
|
12
|
-
activationCapability: RoomActivationCapability;
|
|
13
|
-
activationMode: RoomActivationMode;
|
|
14
|
-
};
|
|
15
|
-
export type RestartRemoteRoomBindingInput = Omit<CreateRemoteRoomBindingInput, 'bindingIntentId' | 'activationCapability' | 'activationMode'> & {
|
|
16
|
-
bindingId: string;
|
|
17
|
-
previousNianSessionId: string;
|
|
18
|
-
};
|
|
19
|
-
export type RemoteRoomBinding = {
|
|
20
|
-
id: string;
|
|
21
|
-
roomId: string;
|
|
22
|
-
agentIdentityId: string;
|
|
23
|
-
agentMembershipId: string;
|
|
24
|
-
nianSessionId: string;
|
|
25
|
-
runtimeAdapter: RoomRuntimeAdapter;
|
|
26
|
-
activationCapability: RoomActivationCapability;
|
|
27
|
-
activationMode: RoomActivationMode;
|
|
28
|
-
status: RoomBindingStatus;
|
|
29
|
-
};
|
|
30
|
-
export declare class RoomBindingHttpError extends Error {
|
|
31
|
-
readonly code: string;
|
|
32
|
-
constructor(code: string, message: string);
|
|
33
|
-
}
|
|
34
|
-
export declare class HttpRoomBindingClient {
|
|
35
|
-
private readonly fetchImpl;
|
|
36
|
-
private readonly baseUrl;
|
|
37
|
-
private readonly actionClient;
|
|
38
|
-
constructor(serverUrl: string, fetchImpl?: FetchLike);
|
|
39
|
-
status: HttpRoomActionClient['status'];
|
|
40
|
-
getAttachmentCapability: HttpRoomActionClient['getAttachmentCapability'];
|
|
41
|
-
initializeAttachment: HttpRoomActionClient['initializeAttachment'];
|
|
42
|
-
completeAttachment: HttpRoomActionClient['completeAttachment'];
|
|
43
|
-
createRoom: HttpRoomActionClient['createRoom'];
|
|
44
|
-
createOperatorRoom: HttpRoomActionClient['createOperatorRoom'];
|
|
45
|
-
resolveNativeSession: HttpRoomActionClient['resolveNativeSession'];
|
|
46
|
-
joinRoom: HttpRoomActionClient['joinRoom'];
|
|
47
|
-
read: HttpRoomActionClient['read'];
|
|
48
|
-
send: HttpRoomActionClient['send'];
|
|
49
|
-
mode: HttpRoomActionClient['mode'];
|
|
50
|
-
pause: HttpRoomActionClient['pause'];
|
|
51
|
-
create(input: CreateRemoteRoomBindingInput): Promise<{
|
|
52
|
-
binding: RemoteRoomBinding;
|
|
53
|
-
resumeSequence: string;
|
|
54
|
-
idempotent: boolean;
|
|
55
|
-
}>;
|
|
56
|
-
restart(input: RestartRemoteRoomBindingInput): Promise<{
|
|
57
|
-
binding: RemoteRoomBinding;
|
|
58
|
-
resumeSequence: string;
|
|
59
|
-
idempotent: boolean;
|
|
60
|
-
}>;
|
|
61
|
-
}
|
|
62
|
-
export {};
|