@anhlp/alp-daemon 0.0.0-stage → 0.0.1-beta.10
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/LICENSE +202 -0
- package/NOTICE +7 -0
- package/README.md +14 -2
- package/dist/THIRD-PARTY-NOTICES.txt +456 -0
- package/dist/alp-templates.d.ts +5 -0
- package/dist/alpd.js +64050 -0
- package/dist/attachments.d.ts +187 -0
- package/dist/attachments.js +856 -0
- package/dist/build-manifest.json +150 -0
- package/dist/conversation.d.ts +119 -0
- package/dist/conversation.js +688 -0
- package/dist/disk.d.ts +67 -0
- package/dist/disk.js +152 -0
- package/dist/files.d.ts +262 -0
- package/dist/files.js +674 -0
- package/dist/git.d.ts +98 -0
- package/dist/git.js +1246 -0
- package/dist/gitignore.d.ts +62 -0
- package/dist/gitignore.js +254 -0
- package/dist/history.d.ts +24 -0
- package/dist/history.js +149 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +28 -0
- package/dist/lifecycle.d.ts +101 -0
- package/dist/lifecycle.js +239 -0
- package/dist/lock.d.ts +21 -0
- package/dist/lock.js +42 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +363 -0
- package/dist/model-catalog.d.ts +2 -0
- package/dist/model-catalog.js +44 -0
- package/dist/native-entry.d.ts +2 -0
- package/dist/native-entry.js +3 -0
- package/dist/native-register.d.ts +1 -0
- package/dist/native-register.js +13 -0
- package/dist/native-terminal.d.ts +45 -0
- package/dist/native-terminal.js +201 -0
- package/dist/operations.d.ts +40 -0
- package/dist/operations.js +313 -0
- package/dist/registry.d.ts +89 -0
- package/dist/registry.js +343 -0
- package/dist/rpc-error.d.ts +6 -0
- package/dist/rpc-error.js +11 -0
- package/dist/scheduler.d.ts +96 -0
- package/dist/scheduler.js +298 -0
- package/dist/schedules.d.ts +70 -0
- package/dist/schedules.js +246 -0
- package/dist/server.d.ts +60 -0
- package/dist/server.js +1958 -0
- package/dist/store.d.ts +178 -0
- package/dist/store.js +386 -0
- package/dist/terminal-native/README.md +201 -0
- package/dist/terminal-native/prebuilt/darwin-arm64/manifest.json +11 -0
- package/dist/terminal-native/prebuilt/darwin-arm64/terminal-owner +0 -0
- package/dist/terminal-native/prebuilt/darwin-x64/manifest.json +11 -0
- package/dist/terminal-native/prebuilt/darwin-x64/terminal-owner +0 -0
- package/dist/terminal-native/prebuilt/linux-arm64-glibc/manifest.json +10 -0
- package/dist/terminal-native/prebuilt/linux-arm64-glibc/terminal-owner +0 -0
- package/dist/terminal-native/prebuilt/linux-arm64-musl/manifest.json +10 -0
- package/dist/terminal-native/prebuilt/linux-arm64-musl/terminal-owner +0 -0
- package/dist/terminal-native/prebuilt/linux-x64-glibc/manifest.json +10 -0
- package/dist/terminal-native/prebuilt/linux-x64-glibc/terminal-owner +0 -0
- package/dist/terminal-native/prebuilt/linux-x64-musl/manifest.json +10 -0
- package/dist/terminal-native/prebuilt/linux-x64-musl/terminal-owner +0 -0
- package/dist/terminal-native/terminal-owner.c +389 -0
- package/dist/terminal-screen.d.ts +24 -0
- package/dist/terminal-screen.js +99 -0
- package/dist/terminals.d.ts +203 -0
- package/dist/terminals.js +570 -0
- package/dist/windows-terminal.d.ts +32 -0
- package/dist/windows-terminal.js +79 -0
- package/dist/worktrees.d.ts +65 -0
- package/dist/worktrees.js +318 -0
- package/native/README.md +201 -0
- package/native/prebuilt/darwin-arm64/manifest.json +11 -0
- package/native/prebuilt/darwin-arm64/terminal-owner +0 -0
- package/native/prebuilt/darwin-x64/manifest.json +11 -0
- package/native/prebuilt/darwin-x64/terminal-owner +0 -0
- package/native/prebuilt/linux-arm64-glibc/manifest.json +10 -0
- package/native/prebuilt/linux-arm64-glibc/terminal-owner +0 -0
- package/native/prebuilt/linux-arm64-musl/manifest.json +10 -0
- package/native/prebuilt/linux-arm64-musl/terminal-owner +0 -0
- package/native/prebuilt/linux-x64-glibc/manifest.json +10 -0
- package/native/prebuilt/linux-x64-glibc/terminal-owner +0 -0
- package/native/prebuilt/linux-x64-musl/manifest.json +10 -0
- package/native/prebuilt/linux-x64-musl/terminal-owner +0 -0
- package/native/terminal-owner.c +389 -0
- package/package.json +163 -4
- package/src/alp-templates.d.ts +5 -0
- package/src/attachments.ts +908 -0
- package/src/conversation.ts +857 -0
- package/src/disk.ts +175 -0
- package/src/files.ts +884 -0
- package/src/git.ts +1220 -0
- package/src/gitignore.ts +277 -0
- package/src/history.ts +118 -0
- package/src/index.ts +12 -0
- package/src/lifecycle.ts +283 -0
- package/src/lock.ts +53 -0
- package/src/main.ts +381 -0
- package/src/model-catalog.ts +36 -0
- package/src/native-entry.ts +5 -0
- package/src/native-register.ts +21 -0
- package/src/native-terminal.ts +127 -0
- package/src/operations.ts +329 -0
- package/src/registry.ts +238 -0
- package/src/rpc-error.ts +4 -0
- package/src/scheduler.ts +438 -0
- package/src/schedules.ts +297 -0
- package/src/server.ts +2238 -0
- package/src/store.ts +449 -0
- package/src/terminal-screen.ts +74 -0
- package/src/terminals.ts +653 -0
- package/src/windows-terminal.ts +74 -0
- package/src/worktrees.ts +382 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.0.1-beta.10",
|
|
3
|
+
"entries": {
|
|
4
|
+
"packages/daemon/dist/alpd.js": {
|
|
5
|
+
"inputs": [
|
|
6
|
+
"packages/client/src/acp-probe.js",
|
|
7
|
+
"packages/client/src/index.js",
|
|
8
|
+
"packages/client/src/ipc.js",
|
|
9
|
+
"packages/client/src/mcp-probe.js",
|
|
10
|
+
"packages/client/src/portable.js",
|
|
11
|
+
"packages/client/src/rpc/client.js",
|
|
12
|
+
"packages/client/src/rpc/errors.js",
|
|
13
|
+
"packages/client/src/rpc/framing.js",
|
|
14
|
+
"packages/client/src/rpc/handshake.js",
|
|
15
|
+
"packages/client/src/rpc/reconnect.js",
|
|
16
|
+
"packages/client/src/rpc/registry.js",
|
|
17
|
+
"packages/client/src/rpc/terminal-directory.js",
|
|
18
|
+
"packages/client/src/rpc/timers.js",
|
|
19
|
+
"packages/client/src/websocket.js",
|
|
20
|
+
"packages/core/src/adapter.js",
|
|
21
|
+
"packages/core/src/atomic.js",
|
|
22
|
+
"packages/core/src/backup.js",
|
|
23
|
+
"packages/core/src/beads.js",
|
|
24
|
+
"packages/core/src/bridges.js",
|
|
25
|
+
"packages/core/src/delegation.js",
|
|
26
|
+
"packages/core/src/errors.js",
|
|
27
|
+
"packages/core/src/formulas.js",
|
|
28
|
+
"packages/core/src/gate-ledger.js",
|
|
29
|
+
"packages/core/src/hook-run.js",
|
|
30
|
+
"packages/core/src/hooks.js",
|
|
31
|
+
"packages/core/src/index.js",
|
|
32
|
+
"packages/core/src/init.js",
|
|
33
|
+
"packages/core/src/library-edit.js",
|
|
34
|
+
"packages/core/src/library.js",
|
|
35
|
+
"packages/core/src/log.js",
|
|
36
|
+
"packages/core/src/migrations.js",
|
|
37
|
+
"packages/core/src/models.js",
|
|
38
|
+
"packages/core/src/packaged.js",
|
|
39
|
+
"packages/core/src/permissions.js",
|
|
40
|
+
"packages/core/src/profiles.js",
|
|
41
|
+
"packages/core/src/promptsafe.js",
|
|
42
|
+
"packages/core/src/providers.js",
|
|
43
|
+
"packages/core/src/resolver.js",
|
|
44
|
+
"packages/core/src/safe-path.js",
|
|
45
|
+
"packages/core/src/shell.js",
|
|
46
|
+
"packages/core/src/skill-validate.js",
|
|
47
|
+
"packages/core/src/state-schema.js",
|
|
48
|
+
"packages/core/src/task-rows.js",
|
|
49
|
+
"packages/core/src/tasks.js",
|
|
50
|
+
"packages/core/src/teams.js",
|
|
51
|
+
"packages/core/src/template-path.js",
|
|
52
|
+
"packages/core/src/trust.js",
|
|
53
|
+
"packages/core/src/upgrade.js",
|
|
54
|
+
"packages/core/src/user-settings.js",
|
|
55
|
+
"packages/core/src/user-worktree.js",
|
|
56
|
+
"packages/core/src/validation.js",
|
|
57
|
+
"packages/core/src/verify.js",
|
|
58
|
+
"packages/core/src/workflow.js",
|
|
59
|
+
"packages/daemon/src/attachments.ts",
|
|
60
|
+
"packages/daemon/src/conversation.ts",
|
|
61
|
+
"packages/daemon/src/disk.ts",
|
|
62
|
+
"packages/daemon/src/files.ts",
|
|
63
|
+
"packages/daemon/src/git.ts",
|
|
64
|
+
"packages/daemon/src/gitignore.ts",
|
|
65
|
+
"packages/daemon/src/history.ts",
|
|
66
|
+
"packages/daemon/src/lifecycle.ts",
|
|
67
|
+
"packages/daemon/src/lock.ts",
|
|
68
|
+
"packages/daemon/src/main.ts",
|
|
69
|
+
"packages/daemon/src/model-catalog.ts",
|
|
70
|
+
"packages/daemon/src/native-terminal.ts",
|
|
71
|
+
"packages/daemon/src/operations.ts",
|
|
72
|
+
"packages/daemon/src/registry.ts",
|
|
73
|
+
"packages/daemon/src/rpc-error.ts",
|
|
74
|
+
"packages/daemon/src/scheduler.ts",
|
|
75
|
+
"packages/daemon/src/schedules.ts",
|
|
76
|
+
"packages/daemon/src/server.ts",
|
|
77
|
+
"packages/daemon/src/store.ts",
|
|
78
|
+
"packages/daemon/src/terminal-screen.ts",
|
|
79
|
+
"packages/daemon/src/terminals.ts",
|
|
80
|
+
"packages/daemon/src/windows-terminal.ts",
|
|
81
|
+
"packages/daemon/src/worktrees.ts",
|
|
82
|
+
"packages/protocol/src/contract-v1.js",
|
|
83
|
+
"packages/protocol/src/contract.js",
|
|
84
|
+
"packages/protocol/src/index.ts",
|
|
85
|
+
"packages/protocol/src/validate.js",
|
|
86
|
+
"packages/protocol/src/wire.js",
|
|
87
|
+
"packages/runtime/src/acp-transport.ts",
|
|
88
|
+
"packages/runtime/src/antigravity-transport.ts",
|
|
89
|
+
"packages/runtime/src/assignment-results.ts",
|
|
90
|
+
"packages/runtime/src/attachments.ts",
|
|
91
|
+
"packages/runtime/src/board-domain.ts",
|
|
92
|
+
"packages/runtime/src/board.ts",
|
|
93
|
+
"packages/runtime/src/catalog.ts",
|
|
94
|
+
"packages/runtime/src/claude-transport.ts",
|
|
95
|
+
"packages/runtime/src/compact.ts",
|
|
96
|
+
"packages/runtime/src/configure.ts",
|
|
97
|
+
"packages/runtime/src/contracts.ts",
|
|
98
|
+
"packages/runtime/src/conversation.ts",
|
|
99
|
+
"packages/runtime/src/github.ts",
|
|
100
|
+
"packages/runtime/src/handoff.ts",
|
|
101
|
+
"packages/runtime/src/index.ts",
|
|
102
|
+
"packages/runtime/src/input-limits.ts",
|
|
103
|
+
"packages/runtime/src/language.ts",
|
|
104
|
+
"packages/runtime/src/live.ts",
|
|
105
|
+
"packages/runtime/src/mailbox.ts",
|
|
106
|
+
"packages/runtime/src/mcp-tools.ts",
|
|
107
|
+
"packages/runtime/src/model-catalog.ts",
|
|
108
|
+
"packages/runtime/src/model-probes.ts",
|
|
109
|
+
"packages/runtime/src/permission-path.ts",
|
|
110
|
+
"packages/runtime/src/process-info.ts",
|
|
111
|
+
"packages/runtime/src/providers.ts",
|
|
112
|
+
"packages/runtime/src/recall.ts",
|
|
113
|
+
"packages/runtime/src/resolve.ts",
|
|
114
|
+
"packages/runtime/src/runtime-context.ts",
|
|
115
|
+
"packages/runtime/src/runtime.ts",
|
|
116
|
+
"packages/runtime/src/session-config.ts",
|
|
117
|
+
"packages/runtime/src/skill-resources.ts",
|
|
118
|
+
"packages/runtime/src/tool-detail.ts",
|
|
119
|
+
"packages/runtime/src/tool-results.ts",
|
|
120
|
+
"packages/runtime/src/tools.ts",
|
|
121
|
+
"packages/runtime/src/transport.ts",
|
|
122
|
+
"packages/runtime/src/usage.ts",
|
|
123
|
+
"packages/runtime/src/workspace.ts",
|
|
124
|
+
"packages/runtime/src/worktree-domain.ts",
|
|
125
|
+
"packages/runtime/src/write-error.ts"
|
|
126
|
+
],
|
|
127
|
+
"external": [
|
|
128
|
+
"child_process",
|
|
129
|
+
"fs",
|
|
130
|
+
"node:child_process",
|
|
131
|
+
"node:crypto",
|
|
132
|
+
"node:fs",
|
|
133
|
+
"node:fs/promises",
|
|
134
|
+
"node:module",
|
|
135
|
+
"node:net",
|
|
136
|
+
"node:os",
|
|
137
|
+
"node:path",
|
|
138
|
+
"node:process",
|
|
139
|
+
"node:readline",
|
|
140
|
+
"node:stream",
|
|
141
|
+
"node:stream/promises",
|
|
142
|
+
"node:string_decoder",
|
|
143
|
+
"node:timers/promises",
|
|
144
|
+
"node:url",
|
|
145
|
+
"node:zlib",
|
|
146
|
+
"path"
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { AlpRuntime, Envelope, SessionSnapshot } from '@anhlp/alp-runtime/index';
|
|
2
|
+
import type { ConfigureOutcome, ConfigurePreview, ConversationBranch, ForkProvenance, SessionSummary } from '@anhlp/alp-protocol/session';
|
|
3
|
+
import type { RpcMethodMap } from '@anhlp/alp-protocol/rpc';
|
|
4
|
+
import type { SessionRecord, Store } from './store.js';
|
|
5
|
+
import type { RegistryService } from './registry.js';
|
|
6
|
+
import type { Principal } from './attachments.js';
|
|
7
|
+
import { type LifecycleEntry, type LifecycleJournal } from './lifecycle.js';
|
|
8
|
+
export type Turn = {
|
|
9
|
+
id: string;
|
|
10
|
+
start: number;
|
|
11
|
+
end?: number;
|
|
12
|
+
state?: 'completed' | 'failed' | 'canceled';
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A fork's title when its creator gave none: the source's with " (fork)" where the fork stays in the
|
|
16
|
+
* source's workspace (the same grants see both); a neutral one in another workspace, whose viewers may
|
|
17
|
+
* not see the source (main's decision, 2026-10-23).
|
|
18
|
+
*/
|
|
19
|
+
export declare function defaultForkTitle(sourceTitle: string | undefined, sameWorkspace: boolean): string;
|
|
20
|
+
/** The turns of `root` in a timeline, in order: where each begins and how it ended. */
|
|
21
|
+
export declare function turnsOf(log: Envelope[], root: string): Turn[];
|
|
22
|
+
export type ConversationContext = {
|
|
23
|
+
runtime: AlpRuntime;
|
|
24
|
+
store: Store;
|
|
25
|
+
journal: LifecycleJournal;
|
|
26
|
+
records: Map<string, SessionRecord>;
|
|
27
|
+
cursors: Map<string, number>;
|
|
28
|
+
logs: Map<string, Envelope[]>;
|
|
29
|
+
treeLogLimit: number;
|
|
30
|
+
summary(sessionId: string): SessionSummary | undefined;
|
|
31
|
+
/** A stable digest of JSON data (the prompt receipt key's). */
|
|
32
|
+
digest(value: unknown): string;
|
|
33
|
+
/** Why a root cannot be mutated now (opening, recovering, prompts in flight), or undefined. */
|
|
34
|
+
unsettled(rootId: string): string | undefined;
|
|
35
|
+
/** Holds prompts, schedule deliveries and reopens of a root until `release` is called. */
|
|
36
|
+
holdPrompts(rootId: string): () => void;
|
|
37
|
+
/** Envelopes to every connection attached to a root's tree, live only. */
|
|
38
|
+
broadcast(rootId: string, envelope: Envelope): void;
|
|
39
|
+
registry?: RegistryService;
|
|
40
|
+
worktrees?: {
|
|
41
|
+
assertAvailable(directory: string): Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
attachments?: {
|
|
44
|
+
heldBy(holders: string[]): Promise<string[]>;
|
|
45
|
+
authorize(principal: Principal, attachmentIds: string[], forks?: string[]): Promise<void>;
|
|
46
|
+
pin(holder: string, sessionId: string, attachmentIds: string[], kind?: string): Promise<void>;
|
|
47
|
+
};
|
|
48
|
+
crashPoint(name: string): void;
|
|
49
|
+
log: {
|
|
50
|
+
warn(message: string, fields?: Record<string, unknown>): void;
|
|
51
|
+
info(message: string, fields?: Record<string, unknown>): void;
|
|
52
|
+
};
|
|
53
|
+
startedAt: string;
|
|
54
|
+
};
|
|
55
|
+
type ForkParams = RpcMethodMap['session.fork']['params'];
|
|
56
|
+
type RewindParams = RpcMethodMap['session.rewind']['params'];
|
|
57
|
+
type ReloadParams = RpcMethodMap['session.reload']['params'];
|
|
58
|
+
type ConfigureParams = RpcMethodMap['session.configure']['params'];
|
|
59
|
+
type ConfigurePreviewParams = RpcMethodMap['session.configure.preview']['params'];
|
|
60
|
+
export declare function createConversation(ctx: ConversationContext): {
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
reloads: boolean;
|
|
63
|
+
configures: boolean;
|
|
64
|
+
/** The fields session summaries carry for a record (§12.7, §12.8). */
|
|
65
|
+
fields(record: SessionRecord, session: SessionSnapshot | undefined): Partial<SessionSummary>;
|
|
66
|
+
/** Whether `after` lies in history a rewind set aside: such a client must start over (attach reset). */
|
|
67
|
+
discarded(record: SessionRecord | undefined, after: number): boolean;
|
|
68
|
+
fork: (params: ForkParams & {
|
|
69
|
+
principal: Principal;
|
|
70
|
+
}) => Promise<{
|
|
71
|
+
duplicate?: true;
|
|
72
|
+
session: SessionSummary;
|
|
73
|
+
forkedFrom: ForkProvenance;
|
|
74
|
+
}>;
|
|
75
|
+
rewind: (params: RewindParams) => Promise<{
|
|
76
|
+
duplicate?: true;
|
|
77
|
+
session: SessionSummary;
|
|
78
|
+
generation: string;
|
|
79
|
+
branch: ConversationBranch;
|
|
80
|
+
}>;
|
|
81
|
+
reload: (params: ReloadParams) => Promise<{
|
|
82
|
+
duplicate?: true;
|
|
83
|
+
session: SessionSummary;
|
|
84
|
+
}>;
|
|
85
|
+
resumeCommand: (sessionId: string) => {
|
|
86
|
+
argv: string[];
|
|
87
|
+
posix: string;
|
|
88
|
+
windows: string;
|
|
89
|
+
display: string;
|
|
90
|
+
platform: "posix" | "windows";
|
|
91
|
+
};
|
|
92
|
+
configure: (params: ConfigureParams) => Promise<{
|
|
93
|
+
duplicate?: true | undefined;
|
|
94
|
+
session: SessionSummary;
|
|
95
|
+
configured: ConfigureOutcome;
|
|
96
|
+
}>;
|
|
97
|
+
configurePreview: (params: ConfigurePreviewParams) => Promise<ConfigurePreview>;
|
|
98
|
+
/** The requestId of a rewind whose commit is unfinished for this root: prompts and reopens wait for it. */
|
|
99
|
+
fenced: (root: string) => string | undefined;
|
|
100
|
+
/** At start, before requests: finish or settle what a crash left (lifecycle.recover); a rewind left applied fences its root. */
|
|
101
|
+
recover(): Promise<void>;
|
|
102
|
+
lifecycle: {
|
|
103
|
+
run: <Plan, Native, Result>(request: {
|
|
104
|
+
resource: string;
|
|
105
|
+
operation: string;
|
|
106
|
+
requestId: string;
|
|
107
|
+
fingerprint: string;
|
|
108
|
+
}, steps: import("./lifecycle.js").LifecycleSteps<Plan, Native, Result>) => Promise<{
|
|
109
|
+
result: Result;
|
|
110
|
+
duplicate: boolean;
|
|
111
|
+
entry: LifecycleEntry<Plan, Native, Result>;
|
|
112
|
+
}>;
|
|
113
|
+
serial: <T>(resource: string, work: () => Promise<T>) => Promise<T>;
|
|
114
|
+
recover(commits: Record<string, (entry: LifecycleEntry) => Promise<unknown>>, log?: (message: string, fields: Record<string, unknown>) => void): Promise<LifecycleEntry<any, any, any>[]>;
|
|
115
|
+
};
|
|
116
|
+
/** Retention cannot erase an unfinished fork or its completion witness owner. */
|
|
117
|
+
retainsFork(root: string): Promise<boolean>;
|
|
118
|
+
};
|
|
119
|
+
export {};
|