@lapis-notes/api 0.1.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +206 -0
- package/README.md +21 -2
- package/dist/__tests__/fixtures/indexed-mutations.json +6862 -0
- package/dist/__tests__/fixtures/memory-storage.json +309 -0
- package/dist/__tests__/fixtures/native-facade-contract.json +3224 -0
- package/dist/__tests__/fixtures/projection-query.json +195 -0
- package/dist/__tests__/fixtures/projection-values.json +60 -0
- package/dist/__tests__/fixtures/search-preparation.json +1513 -0
- package/dist/__tests__/fixtures/search-retrieval.json +15409 -0
- package/dist/__tests__/fixtures/search-semantic-model.json +3691 -0
- package/dist/__tests__/fixtures/search-semantic-retrieval.json +6603 -0
- package/dist/__tests__/fixtures/search-storage.json +409 -0
- package/dist/__tests__/fixtures/task-projection.json +428 -0
- package/dist/__tests__/indexed-mutation-support.js +262 -0
- package/dist/__tests__/projection-query-support.js +40 -0
- package/dist/__tests__/search-retrieval-support.js +47 -0
- package/dist/app-database-host.d.ts +1 -0
- package/dist/app-shell-plugin-persistence.d.ts +3 -2
- package/dist/app-shell-plugin-persistence.js +37 -3
- package/dist/cache.svelte.d.ts +8 -1
- package/dist/cache.svelte.js +103 -5
- package/dist/command.svelte.js +29 -2
- package/dist/components/editor/editor.css +4 -0
- package/dist/components/editor/editor.svelte +21 -9
- package/dist/components/editor/embedded-editor-surface.js +3 -1
- package/dist/components/editor/inline-title-alignment.d.ts +3 -0
- package/dist/components/editor/inline-title-alignment.js +57 -0
- package/dist/configuration.svelte.d.ts +270 -206
- package/dist/configuration.svelte.js +161 -86
- package/dist/context.svelte.d.ts +21 -3
- package/dist/context.svelte.js +63 -20
- package/dist/diagnostics.d.ts +8 -0
- package/dist/diagnostics.js +6 -0
- package/dist/editor-save-context.d.ts +12 -1
- package/dist/editor-save-context.js +32 -1
- package/dist/editor-view-registry.d.ts +10 -0
- package/dist/editor-view-registry.js +44 -4
- package/dist/editor.svelte.js +128 -37
- package/dist/embed-registry.d.ts +10 -0
- package/dist/embed-registry.js +15 -0
- package/dist/file-editing-failures.d.ts +2 -0
- package/dist/file-editing-failures.js +29 -0
- package/dist/file-editing-native-issues.d.ts +19 -0
- package/dist/file-editing-native-issues.js +65 -0
- package/dist/file-editing-sessions.d.ts +56 -8
- package/dist/file-editing-sessions.js +185 -15
- package/dist/file-manager.d.ts +8 -1
- package/dist/file-manager.js +37 -3
- package/dist/file-state-store.d.ts +5 -0
- package/dist/file-state-store.js +34 -0
- package/dist/file-text-conflicts.d.ts +25 -0
- package/dist/file-text-conflicts.js +35 -0
- package/dist/file-text-mutation.d.ts +13 -0
- package/dist/file-text-mutation.js +100 -0
- package/dist/file-text-persistence.d.ts +36 -0
- package/dist/file-text-persistence.js +234 -0
- package/dist/file-text-state-writer.d.ts +34 -0
- package/dist/file-text-state-writer.js +183 -0
- package/dist/files-configuration.d.ts +20 -0
- package/dist/files-configuration.js +47 -0
- package/dist/generated/plugin-host-modules.schema.generated.d.ts +87 -37
- package/dist/generated/plugin-host-modules.schema.generated.js +102 -37
- package/dist/glob.d.ts +3 -0
- package/dist/glob.js +2 -1
- package/dist/icons/changes.d.ts +3 -0
- package/dist/icons/changes.js +16 -0
- package/dist/icons/index.d.ts +5 -1
- package/dist/icons/index.js +44 -3
- package/dist/icons/registry.d.ts +35 -0
- package/dist/icons/registry.js +154 -0
- package/dist/icons/safe-svg.d.ts +2 -0
- package/dist/icons/safe-svg.js +44 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3 -1
- package/dist/lapis-extension.d.ts +6 -2
- package/dist/lapis-extension.js +2 -0
- package/dist/metadata.svelte.js +45 -2
- package/dist/native-background-indexing.d.ts +48 -0
- package/dist/native-background-indexing.js +208 -0
- package/dist/native-database-protocol.d.ts +29 -0
- package/dist/native-database-protocol.js +1 -0
- package/dist/native-editing-intent-lease.d.ts +17 -0
- package/dist/native-editing-intent-lease.js +188 -0
- package/dist/native-editing-intents-protocol.d.ts +70 -0
- package/dist/native-editing-intents-protocol.js +1 -0
- package/dist/native-editing-intents.d.ts +8 -0
- package/dist/native-editing-intents.js +1 -0
- package/dist/native-editing-problems.d.ts +3 -0
- package/dist/native-editing-problems.js +180 -0
- package/dist/native-editing-recovery.d.ts +24 -0
- package/dist/native-editing-recovery.js +198 -0
- package/dist/native-editing-session.d.ts +51 -0
- package/dist/native-editing-session.js +251 -0
- package/dist/native-history-index-protocol.d.ts +80 -0
- package/dist/native-history-index-protocol.js +1 -0
- package/dist/native-history-index.d.ts +6 -0
- package/dist/native-history-index.js +1 -0
- package/dist/native-indexing-protocol.d.ts +63 -0
- package/dist/native-indexing-protocol.js +1 -0
- package/dist/native-participant-protocol.d.ts +67 -0
- package/dist/native-participant-protocol.js +3 -0
- package/dist/native-queue-protocol.d.ts +73 -0
- package/dist/native-queue-protocol.js +3 -0
- package/dist/native-tasks-protocol.d.ts +264 -0
- package/dist/native-tasks-protocol.js +1 -0
- package/dist/native-tasks.d.ts +35 -0
- package/dist/native-tasks.js +79 -0
- package/dist/native-turn-protocol.d.ts +81 -0
- package/dist/native-turn-protocol.js +1 -0
- package/dist/native-turns.d.ts +29 -0
- package/dist/native-turns.js +2 -0
- package/dist/plugin-asset-server.js +3 -2
- package/dist/plugin-dependency-resolver.d.ts +1 -1
- package/dist/plugin-distribution/compatibility.d.ts +1 -1
- package/dist/plugin-distribution/compatibility.js +10 -5
- package/dist/plugin-distribution/installed-plugin-state.js +2 -1
- package/dist/plugin-distribution/installer.d.ts +6 -0
- package/dist/plugin-distribution/installer.js +90 -37
- package/dist/plugin-distribution/manager.d.ts +4 -1
- package/dist/plugin-distribution/manager.js +12 -5
- package/dist/plugin-distribution/registry-cache.js +2 -1
- package/dist/plugin-distribution/registry-source-state.js +2 -1
- package/dist/plugin-distribution/schemas.d.ts +26 -8
- package/dist/plugin-distribution/schemas.js +2 -1
- package/dist/plugin-distribution/types.d.ts +4 -0
- package/dist/plugin-manager.d.ts +20 -4
- package/dist/plugin-manager.js +228 -64
- package/dist/plugin-runtime-entry.d.ts +1 -1
- package/dist/plugin-runtime-entry.js +16 -0
- package/dist/plugin.d.ts +18 -2
- package/dist/plugin.js +93 -39
- package/dist/registry-schema/catalog-v1.d.ts +60 -9
- package/dist/registry-schema/catalog-v1.js +2 -1
- package/dist/registry-schema/catalog-v2.d.ts +60 -9
- package/dist/registry-schema/catalog-v2.js +1 -1
- package/dist/search-result-provider.d.ts +95 -0
- package/dist/search-result-provider.js +42 -0
- package/dist/status-bar.svelte.d.ts +26 -20
- package/dist/status-bar.svelte.js +1 -0
- package/dist/storage/app-database.d.ts +6 -2
- package/dist/storage/app-database.js +41 -34
- package/dist/storage/desktop-native.d.ts +5 -3
- package/dist/storage/desktop-native.js +59 -6
- package/dist/storage/directory-watcher.d.ts +27 -0
- package/dist/storage/directory-watcher.js +201 -0
- package/dist/storage/fs.d.ts +14 -27
- package/dist/storage/fs.js +2 -168
- package/dist/storage/index-projection.js +33 -15
- package/dist/storage/memory-vault-adapter.d.ts +2 -0
- package/dist/storage/memory-vault-adapter.js +14 -1
- package/dist/storage/path.d.ts +6 -2
- package/dist/storage/path.js +8 -2
- package/dist/storage/projection-query-candidates.d.ts +3 -0
- package/dist/storage/projection-query-candidates.js +69 -0
- package/dist/storage/remote-app-database.d.ts +2 -2
- package/dist/storage/remote-app-database.js +1 -1
- package/dist/storage/runtime.d.ts +3 -0
- package/dist/storage/runtime.js +3 -0
- package/dist/storage/search-embedding-record.d.ts +3 -0
- package/dist/storage/search-embedding-record.js +18 -0
- package/dist/storage/turso-app-database.d.ts +2 -0
- package/dist/storage/turso-app-database.js +67 -30
- package/dist/storage/vault-listing.d.ts +3 -0
- package/dist/storage/vault-listing.js +36 -0
- package/dist/storage/vault-reconciliation.d.ts +19 -0
- package/dist/storage/vault-reconciliation.js +137 -0
- package/dist/storage/vault-session.d.ts +8 -0
- package/dist/storage/vault-session.js +10 -2
- package/dist/storage/vault.svelte.d.ts +53 -4
- package/dist/storage/vault.svelte.js +223 -87
- package/dist/sync-host.d.ts +12 -3
- package/dist/sync-host.js +5 -1
- package/dist/vault-change-views.d.ts +4 -0
- package/dist/vault-change-views.js +43 -0
- package/dist/vault-changes.d.ts +37 -0
- package/dist/vault-changes.js +228 -0
- package/dist/view.svelte.d.ts +182 -149
- package/dist/view.svelte.js +11 -2
- package/dist/workspace-close-guard.d.ts +3 -0
- package/dist/workspace-close-guard.js +35 -0
- package/dist/workspace-host-internal.js +10 -2
- package/dist/workspace-layout-normalizer.d.ts +4 -2
- package/dist/workspace-layout-normalizer.js +5 -5
- package/dist/workspace-view-document.d.ts +3 -0
- package/dist/workspace-view-document.js +12 -0
- package/dist/workspace.svelte.d.ts +13 -2
- package/dist/workspace.svelte.js +371 -82
- package/package.json +45 -8
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { TurnInput, TurnOptions } from "./native-turn-protocol";
|
|
2
|
+
import type { QueueSelection } from "./native-queue-protocol";
|
|
3
|
+
export declare const PARTICIPANT_PROFILE_LIMIT: 16;
|
|
4
|
+
export declare const PARTICIPANT_REQUEST_LIMIT: 2097152;
|
|
5
|
+
export declare const PARTICIPANT_RECORD_LIMIT: 8388608;
|
|
6
|
+
export type ParticipantProfile = {
|
|
7
|
+
target_id: string;
|
|
8
|
+
selection: QueueSelection;
|
|
9
|
+
options: TurnOptions;
|
|
10
|
+
};
|
|
11
|
+
export type ParticipantMessageInput = {
|
|
12
|
+
acceptance_id: string;
|
|
13
|
+
user: unknown;
|
|
14
|
+
dispatch: unknown;
|
|
15
|
+
turns: Array<TurnInput>;
|
|
16
|
+
profiles?: Array<ParticipantProfile>;
|
|
17
|
+
};
|
|
18
|
+
export type ParticipantState = "pending" | "started" | "completed" | "rejected" | "unknown" | "not_sent" | "cancelled";
|
|
19
|
+
export type ParticipantDelivery = {
|
|
20
|
+
delivery_id: string;
|
|
21
|
+
request_id: string;
|
|
22
|
+
agent_binding_id: string;
|
|
23
|
+
session_id: string;
|
|
24
|
+
state: ParticipantState;
|
|
25
|
+
outcome_published: boolean;
|
|
26
|
+
};
|
|
27
|
+
export type ParticipantMessage = {
|
|
28
|
+
schema_version: number;
|
|
29
|
+
vault_id: string;
|
|
30
|
+
acceptance_id: string;
|
|
31
|
+
conversation_id: string;
|
|
32
|
+
input: ParticipantMessageInput;
|
|
33
|
+
deliveries: Array<ParticipantDelivery>;
|
|
34
|
+
recovered: boolean;
|
|
35
|
+
};
|
|
36
|
+
export type ParticipantCommand = {
|
|
37
|
+
kind: "profiles";
|
|
38
|
+
} | {
|
|
39
|
+
kind: "for_turn";
|
|
40
|
+
request_id: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "accept";
|
|
43
|
+
input: ParticipantMessageInput;
|
|
44
|
+
} | {
|
|
45
|
+
kind: "read";
|
|
46
|
+
acceptance_id: string;
|
|
47
|
+
} | {
|
|
48
|
+
kind: "stop";
|
|
49
|
+
acceptance_id: string;
|
|
50
|
+
} | {
|
|
51
|
+
kind: "cancel";
|
|
52
|
+
acceptance_id: string;
|
|
53
|
+
request_id: string;
|
|
54
|
+
};
|
|
55
|
+
export type ParticipantValue = {
|
|
56
|
+
kind: "profiles";
|
|
57
|
+
profiles: Array<ParticipantProfile>;
|
|
58
|
+
} | {
|
|
59
|
+
kind: "message";
|
|
60
|
+
message: ParticipantMessage | null;
|
|
61
|
+
} | {
|
|
62
|
+
kind: "stop_requested";
|
|
63
|
+
accepted: boolean;
|
|
64
|
+
} | {
|
|
65
|
+
kind: "cancel_requested";
|
|
66
|
+
accepted: boolean;
|
|
67
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const QUEUE_REQUEST_LIMIT: 1048576;
|
|
2
|
+
export declare const QUEUE_RECORD_LIMIT: 8388608;
|
|
3
|
+
export type QueueRecipient = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
token: string;
|
|
7
|
+
};
|
|
8
|
+
export type QueueModel = {
|
|
9
|
+
provider: string;
|
|
10
|
+
model: string;
|
|
11
|
+
};
|
|
12
|
+
export type QueueAgent = "codex" | "cursor" | "opencode" | "local";
|
|
13
|
+
export type QueueThinking = "default" | "off" | "low" | "medium" | "high";
|
|
14
|
+
export type QueueCaptureTarget = {
|
|
15
|
+
id: string;
|
|
16
|
+
agent: QueueAgent;
|
|
17
|
+
model?: QueueModel;
|
|
18
|
+
thinking?: QueueThinking;
|
|
19
|
+
executionMode?: string;
|
|
20
|
+
};
|
|
21
|
+
export type QueueSelection = {
|
|
22
|
+
recipient: QueueRecipient;
|
|
23
|
+
target: QueueCaptureTarget;
|
|
24
|
+
thinking?: QueueThinking;
|
|
25
|
+
};
|
|
26
|
+
export type QueueAccept = {
|
|
27
|
+
acceptance_id: string;
|
|
28
|
+
conversation_id: string;
|
|
29
|
+
after_request_id: string;
|
|
30
|
+
scope_dir: string;
|
|
31
|
+
target_id: string;
|
|
32
|
+
capture: unknown;
|
|
33
|
+
};
|
|
34
|
+
export type QueuePhase = "pending" | "started" | "completed" | "cancelled" | "rejected" | "unknown";
|
|
35
|
+
export type QueueEntry = {
|
|
36
|
+
input: QueueAccept;
|
|
37
|
+
request_id: string;
|
|
38
|
+
phase: QueuePhase;
|
|
39
|
+
receipt: unknown | null;
|
|
40
|
+
receipt_published: boolean;
|
|
41
|
+
};
|
|
42
|
+
export type QueueRecord = {
|
|
43
|
+
schema_version: number;
|
|
44
|
+
vault_id: string;
|
|
45
|
+
conversation_id: string;
|
|
46
|
+
scope_dir: string;
|
|
47
|
+
head_request_id: string;
|
|
48
|
+
paused: boolean;
|
|
49
|
+
barrier: string | null;
|
|
50
|
+
entries: Array<QueueEntry>;
|
|
51
|
+
};
|
|
52
|
+
export type QueueCommand = {
|
|
53
|
+
kind: "accept";
|
|
54
|
+
input: QueueAccept;
|
|
55
|
+
} | {
|
|
56
|
+
kind: "read";
|
|
57
|
+
conversation_id: string;
|
|
58
|
+
} | {
|
|
59
|
+
kind: "stop";
|
|
60
|
+
conversation_id: string;
|
|
61
|
+
} | {
|
|
62
|
+
kind: "cancel";
|
|
63
|
+
conversation_id: string;
|
|
64
|
+
acceptance_id: string;
|
|
65
|
+
} | {
|
|
66
|
+
kind: "resume";
|
|
67
|
+
conversation_id: string;
|
|
68
|
+
after_request_id: string;
|
|
69
|
+
};
|
|
70
|
+
export type QueueValue = {
|
|
71
|
+
kind: "queue";
|
|
72
|
+
queue: QueueRecord | null;
|
|
73
|
+
};
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
export type TextSnapshot = {
|
|
2
|
+
path: string;
|
|
3
|
+
text: string;
|
|
4
|
+
version: string;
|
|
5
|
+
};
|
|
6
|
+
export type NativeTaskStart = {
|
|
7
|
+
kind: "anytime";
|
|
8
|
+
} | {
|
|
9
|
+
kind: "someday";
|
|
10
|
+
} | {
|
|
11
|
+
kind: "date";
|
|
12
|
+
date: string;
|
|
13
|
+
};
|
|
14
|
+
export type NativeTaskPlanAt = "anytime" | "morning" | "afternoon" | "evening" | "time";
|
|
15
|
+
export type NativeTaskPlan = {
|
|
16
|
+
date: string;
|
|
17
|
+
at: NativeTaskPlanAt;
|
|
18
|
+
time?: string;
|
|
19
|
+
duration?: string;
|
|
20
|
+
durationMinutes?: number;
|
|
21
|
+
};
|
|
22
|
+
export type NativeTaskTracking = {
|
|
23
|
+
type: "boolean";
|
|
24
|
+
} | {
|
|
25
|
+
type: "count";
|
|
26
|
+
unit: string;
|
|
27
|
+
target?: number;
|
|
28
|
+
} | {
|
|
29
|
+
type: "duration";
|
|
30
|
+
target?: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: "number";
|
|
33
|
+
unit: string;
|
|
34
|
+
target?: number;
|
|
35
|
+
};
|
|
36
|
+
export type NativeTaskRepeatAnchor = "schedule" | "completion";
|
|
37
|
+
export type NativeTaskRepeatMissed = "carry" | "skip";
|
|
38
|
+
export type NativeTaskPauseRange = {
|
|
39
|
+
start: string;
|
|
40
|
+
end: string;
|
|
41
|
+
};
|
|
42
|
+
export type NativeTaskRepeat = {
|
|
43
|
+
start?: string;
|
|
44
|
+
rrule: string;
|
|
45
|
+
anchor: NativeTaskRepeatAnchor;
|
|
46
|
+
missed: NativeTaskRepeatMissed;
|
|
47
|
+
rdate?: Array<string>;
|
|
48
|
+
exdate?: Array<string>;
|
|
49
|
+
resetChecklist?: boolean;
|
|
50
|
+
paused?: boolean;
|
|
51
|
+
pausedSince?: string;
|
|
52
|
+
pauseRanges?: Array<NativeTaskPauseRange>;
|
|
53
|
+
lastCompletedAt?: string;
|
|
54
|
+
completionCount?: number;
|
|
55
|
+
};
|
|
56
|
+
export type NativeTaskMutation = {
|
|
57
|
+
type: "checklist";
|
|
58
|
+
position: number;
|
|
59
|
+
expectedText: string;
|
|
60
|
+
checked: boolean;
|
|
61
|
+
} | {
|
|
62
|
+
type: "plan";
|
|
63
|
+
plan: NativeTaskPlan | null;
|
|
64
|
+
at: string;
|
|
65
|
+
} | {
|
|
66
|
+
type: "start";
|
|
67
|
+
start: NativeTaskStart;
|
|
68
|
+
at: string;
|
|
69
|
+
} | {
|
|
70
|
+
type: "deadline";
|
|
71
|
+
deadline: string | null;
|
|
72
|
+
at: string;
|
|
73
|
+
} | {
|
|
74
|
+
type: "inbox";
|
|
75
|
+
inbox: boolean;
|
|
76
|
+
at: string;
|
|
77
|
+
} | {
|
|
78
|
+
type: "repeat";
|
|
79
|
+
repeat: NativeTaskRepeat | null;
|
|
80
|
+
at: string;
|
|
81
|
+
} | {
|
|
82
|
+
type: "tracking";
|
|
83
|
+
tracking: NativeTaskTracking | null;
|
|
84
|
+
at: string;
|
|
85
|
+
} | {
|
|
86
|
+
type: "pause";
|
|
87
|
+
at: string;
|
|
88
|
+
localDate: string | null;
|
|
89
|
+
} | {
|
|
90
|
+
type: "resume";
|
|
91
|
+
at: string;
|
|
92
|
+
localDate: string | null;
|
|
93
|
+
} | {
|
|
94
|
+
type: "cancel";
|
|
95
|
+
at: string;
|
|
96
|
+
} | {
|
|
97
|
+
type: "reopen";
|
|
98
|
+
at: string;
|
|
99
|
+
};
|
|
100
|
+
export type NativeTaskLifecycleAction = {
|
|
101
|
+
type: "complete";
|
|
102
|
+
at: string;
|
|
103
|
+
localDate: string;
|
|
104
|
+
trackedValue: number | null;
|
|
105
|
+
} | {
|
|
106
|
+
type: "skip";
|
|
107
|
+
at: string;
|
|
108
|
+
localDate: string;
|
|
109
|
+
};
|
|
110
|
+
export type NativeTaskLifecycleRequest = {
|
|
111
|
+
request_id: string;
|
|
112
|
+
path: string;
|
|
113
|
+
expected_version: string;
|
|
114
|
+
action: NativeTaskLifecycleAction;
|
|
115
|
+
};
|
|
116
|
+
export type NativeTaskCompletion = {
|
|
117
|
+
type: "boolean";
|
|
118
|
+
} | {
|
|
119
|
+
type: "count";
|
|
120
|
+
value: number;
|
|
121
|
+
unit: string;
|
|
122
|
+
} | {
|
|
123
|
+
type: "duration";
|
|
124
|
+
durationMinutes: number;
|
|
125
|
+
} | {
|
|
126
|
+
type: "number";
|
|
127
|
+
value: number;
|
|
128
|
+
unit: string;
|
|
129
|
+
};
|
|
130
|
+
export type NativeTaskDayParts = {
|
|
131
|
+
afternoonStartsAt: string;
|
|
132
|
+
eveningStartsAt: string;
|
|
133
|
+
};
|
|
134
|
+
export type NativeTaskDailySettings = {
|
|
135
|
+
folder: string;
|
|
136
|
+
date_format: string;
|
|
137
|
+
};
|
|
138
|
+
export type NativeTaskDailyFormat = {
|
|
139
|
+
locale: string;
|
|
140
|
+
firstDay: number;
|
|
141
|
+
minimalDays: number;
|
|
142
|
+
};
|
|
143
|
+
export type NativeTaskProvider = {
|
|
144
|
+
kind: "default";
|
|
145
|
+
} | {
|
|
146
|
+
kind: "unavailable";
|
|
147
|
+
message: string;
|
|
148
|
+
};
|
|
149
|
+
export type NativeTaskConfiguration = {
|
|
150
|
+
day_parts: NativeTaskDayParts;
|
|
151
|
+
daily: NativeTaskDailySettings;
|
|
152
|
+
format: NativeTaskDailyFormat;
|
|
153
|
+
provider: NativeTaskProvider;
|
|
154
|
+
};
|
|
155
|
+
export type NativeTaskDisposition = "retryable" | "divergent" | "completed";
|
|
156
|
+
export type NativeTaskKnownFailure = {
|
|
157
|
+
code: string;
|
|
158
|
+
message: string;
|
|
159
|
+
};
|
|
160
|
+
export type NativeTaskOperation = {
|
|
161
|
+
request: NativeTaskLifecycleRequest;
|
|
162
|
+
disposition: NativeTaskDisposition;
|
|
163
|
+
original: TextSnapshot;
|
|
164
|
+
task_replacement: string;
|
|
165
|
+
daily: TextSnapshot | null;
|
|
166
|
+
daily_replacement: string | null;
|
|
167
|
+
last_failure: NativeTaskKnownFailure | null;
|
|
168
|
+
};
|
|
169
|
+
export type NativeTaskFailure = {
|
|
170
|
+
name: string;
|
|
171
|
+
code: string | null;
|
|
172
|
+
message: string;
|
|
173
|
+
parts: Array<string> | null;
|
|
174
|
+
request_id: string | null;
|
|
175
|
+
uncertain: boolean;
|
|
176
|
+
operation: NativeTaskOperation | null;
|
|
177
|
+
};
|
|
178
|
+
export type NativeTaskTrackedFailure = {
|
|
179
|
+
path: string;
|
|
180
|
+
message: string;
|
|
181
|
+
daily_path: string | null;
|
|
182
|
+
daily_version: string | null;
|
|
183
|
+
};
|
|
184
|
+
export type NativeTaskTrackedStatus = {
|
|
185
|
+
date: string;
|
|
186
|
+
attempted: number;
|
|
187
|
+
materialized: number;
|
|
188
|
+
changed: number;
|
|
189
|
+
failures: Array<NativeTaskTrackedFailure>;
|
|
190
|
+
omitted_failures: number;
|
|
191
|
+
};
|
|
192
|
+
export type NativeTasksStatus = {
|
|
193
|
+
enabled: boolean;
|
|
194
|
+
configuration: NativeTaskConfiguration | null;
|
|
195
|
+
tracked: NativeTaskTrackedStatus | null;
|
|
196
|
+
};
|
|
197
|
+
export type NativeTaskOutcome = "completed" | "pending";
|
|
198
|
+
export type NativeTaskTrackingKind = "boolean" | "count" | "duration" | "number";
|
|
199
|
+
export type NativeTaskDayPart = "anytime" | "morning" | "afternoon" | "evening";
|
|
200
|
+
export type NativeTaskObservation = {
|
|
201
|
+
observationId: string;
|
|
202
|
+
taskId: string;
|
|
203
|
+
taskPath: string;
|
|
204
|
+
dailyDocumentPath: string;
|
|
205
|
+
occurrenceDate: string;
|
|
206
|
+
outcome: NativeTaskOutcome;
|
|
207
|
+
trackingKind: NativeTaskTrackingKind;
|
|
208
|
+
value?: number;
|
|
209
|
+
unit?: string;
|
|
210
|
+
durationMinutes?: number;
|
|
211
|
+
sourceStart: number;
|
|
212
|
+
sourceEnd: number;
|
|
213
|
+
projectionVersion: number;
|
|
214
|
+
checked: boolean;
|
|
215
|
+
title: string;
|
|
216
|
+
href: string;
|
|
217
|
+
dayPart: NativeTaskDayPart;
|
|
218
|
+
source: string;
|
|
219
|
+
};
|
|
220
|
+
export type NativeTaskCommand = {
|
|
221
|
+
kind: "configure";
|
|
222
|
+
configuration: NativeTaskConfiguration;
|
|
223
|
+
} | {
|
|
224
|
+
kind: "disable";
|
|
225
|
+
} | {
|
|
226
|
+
kind: "status";
|
|
227
|
+
} | {
|
|
228
|
+
kind: "mutate";
|
|
229
|
+
path: string;
|
|
230
|
+
expected_version: string;
|
|
231
|
+
mutation: NativeTaskMutation;
|
|
232
|
+
} | {
|
|
233
|
+
kind: "submit";
|
|
234
|
+
request: NativeTaskLifecycleRequest;
|
|
235
|
+
} | {
|
|
236
|
+
kind: "inspect";
|
|
237
|
+
request_id: string;
|
|
238
|
+
} | {
|
|
239
|
+
kind: "retry";
|
|
240
|
+
request_id: string;
|
|
241
|
+
} | {
|
|
242
|
+
kind: "occurrence";
|
|
243
|
+
path: string;
|
|
244
|
+
expected_version: string;
|
|
245
|
+
date: string;
|
|
246
|
+
completion: NativeTaskCompletion | null;
|
|
247
|
+
};
|
|
248
|
+
export type NativeTaskValue = {
|
|
249
|
+
kind: "status";
|
|
250
|
+
status: NativeTasksStatus;
|
|
251
|
+
} | {
|
|
252
|
+
kind: "snapshot";
|
|
253
|
+
snapshot: TextSnapshot;
|
|
254
|
+
} | {
|
|
255
|
+
kind: "operation";
|
|
256
|
+
operation: NativeTaskOperation | null;
|
|
257
|
+
} | {
|
|
258
|
+
kind: "observation";
|
|
259
|
+
document: TextSnapshot;
|
|
260
|
+
observation: NativeTaskObservation;
|
|
261
|
+
} | {
|
|
262
|
+
kind: "failure";
|
|
263
|
+
failure: NativeTaskFailure;
|
|
264
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { NativeTaskCommand, NativeTaskFailure, NativeTaskValue } from "./native-tasks-protocol";
|
|
2
|
+
export type * from "./native-tasks-protocol";
|
|
3
|
+
/** A bounded transport already admitted to one native vault owner. */
|
|
4
|
+
export interface NativeTasks {
|
|
5
|
+
call(command: NativeTaskCommand): Promise<NativeTaskValue>;
|
|
6
|
+
}
|
|
7
|
+
/** Capture the existing default daily provider's Luxon formatting context. */
|
|
8
|
+
export declare function nativeTaskDailyFormat(): {
|
|
9
|
+
locale: string;
|
|
10
|
+
firstDay: import("luxon").WeekdayNumbers;
|
|
11
|
+
minimalDays: import("luxon").WeekdayNumbers;
|
|
12
|
+
};
|
|
13
|
+
export declare class NativeTaskError extends Error {
|
|
14
|
+
readonly code: string | null;
|
|
15
|
+
readonly parts: string[] | null;
|
|
16
|
+
readonly requestId: string | null;
|
|
17
|
+
readonly uncertain: boolean;
|
|
18
|
+
readonly operation: NativeTaskFailure["operation"];
|
|
19
|
+
constructor(failure: NativeTaskFailure);
|
|
20
|
+
}
|
|
21
|
+
/** Observation lifetime is independent of accepted native work. */
|
|
22
|
+
export declare class NativeTasksSession implements NativeTasks {
|
|
23
|
+
private readonly transport;
|
|
24
|
+
private readonly declared;
|
|
25
|
+
private pending;
|
|
26
|
+
private stopped;
|
|
27
|
+
private detachPromise?;
|
|
28
|
+
constructor(transport: NativeTasks, declared?: () => boolean);
|
|
29
|
+
get detached(): boolean;
|
|
30
|
+
call(command: NativeTaskCommand): Promise<NativeTaskValue>;
|
|
31
|
+
/** Disable is explicit policy, never a consequence of closing a window. */
|
|
32
|
+
load(): Promise<void>;
|
|
33
|
+
disable(): Promise<void>;
|
|
34
|
+
detach(): Promise<void>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { DateTime, Info } from "luxon";
|
|
2
|
+
/** Capture the existing default daily provider's Luxon formatting context. */
|
|
3
|
+
export function nativeTaskDailyFormat() {
|
|
4
|
+
return {
|
|
5
|
+
locale: DateTime.fromISO("2000-01-01", {
|
|
6
|
+
zone: "utc",
|
|
7
|
+
}).resolvedLocaleOptions().locale,
|
|
8
|
+
firstDay: Info.getStartOfWeek(),
|
|
9
|
+
minimalDays: Info.getMinimumDaysInFirstWeek(),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export class NativeTaskError extends Error {
|
|
13
|
+
code;
|
|
14
|
+
parts;
|
|
15
|
+
requestId;
|
|
16
|
+
uncertain;
|
|
17
|
+
operation;
|
|
18
|
+
constructor(failure) {
|
|
19
|
+
super(failure.message);
|
|
20
|
+
this.name = failure.name;
|
|
21
|
+
this.code = failure.code;
|
|
22
|
+
this.parts = failure.parts;
|
|
23
|
+
this.requestId = failure.request_id;
|
|
24
|
+
this.uncertain = failure.uncertain;
|
|
25
|
+
this.operation = failure.operation;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** Observation lifetime is independent of accepted native work. */
|
|
29
|
+
export class NativeTasksSession {
|
|
30
|
+
transport;
|
|
31
|
+
declared;
|
|
32
|
+
pending = new Set();
|
|
33
|
+
stopped = false;
|
|
34
|
+
detachPromise;
|
|
35
|
+
constructor(transport, declared = () => true) {
|
|
36
|
+
this.transport = transport;
|
|
37
|
+
this.declared = declared;
|
|
38
|
+
}
|
|
39
|
+
get detached() {
|
|
40
|
+
return this.stopped;
|
|
41
|
+
}
|
|
42
|
+
call(command) {
|
|
43
|
+
if (this.stopped)
|
|
44
|
+
return Promise.reject(new Error("Native Tasks observer detached"));
|
|
45
|
+
const operation = Promise.resolve()
|
|
46
|
+
.then(() => this.transport.call(command))
|
|
47
|
+
.then((value) => {
|
|
48
|
+
if (value.kind === "failure")
|
|
49
|
+
throw new NativeTaskError(value.failure);
|
|
50
|
+
return value;
|
|
51
|
+
});
|
|
52
|
+
this.pending.add(operation);
|
|
53
|
+
void operation
|
|
54
|
+
.finally(() => this.pending.delete(operation))
|
|
55
|
+
.catch(() => undefined);
|
|
56
|
+
return operation;
|
|
57
|
+
}
|
|
58
|
+
/** Disable is explicit policy, never a consequence of closing a window. */
|
|
59
|
+
async load() {
|
|
60
|
+
await Promise.all([...this.pending]);
|
|
61
|
+
if (this.stopped)
|
|
62
|
+
return;
|
|
63
|
+
if (!this.declared()) {
|
|
64
|
+
await this.disable();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const value = await this.call({ kind: "status" });
|
|
68
|
+
if (value.kind !== "status")
|
|
69
|
+
throw new Error("Invalid native Tasks status");
|
|
70
|
+
}
|
|
71
|
+
async disable() {
|
|
72
|
+
await this.call({ kind: "disable" });
|
|
73
|
+
}
|
|
74
|
+
detach() {
|
|
75
|
+
this.stopped = true;
|
|
76
|
+
this.detachPromise ??= Promise.allSettled([...this.pending]).then(() => undefined);
|
|
77
|
+
return this.detachPromise;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { QueueSelection } from "./native-queue-protocol";
|
|
2
|
+
export type TurnOptions = {
|
|
3
|
+
model: string | null;
|
|
4
|
+
effort: string | null;
|
|
5
|
+
mode: string;
|
|
6
|
+
max_duration_ms: number;
|
|
7
|
+
};
|
|
8
|
+
export type TurnTarget = {
|
|
9
|
+
queue_selection?: QueueSelection;
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
default_mode: string;
|
|
13
|
+
};
|
|
14
|
+
export type TurnContinuation = {
|
|
15
|
+
conversation_id: string;
|
|
16
|
+
after_request_id: string;
|
|
17
|
+
};
|
|
18
|
+
export type TurnInput = {
|
|
19
|
+
request_id: string;
|
|
20
|
+
target_id: string;
|
|
21
|
+
scope_dir: string;
|
|
22
|
+
prompt: string;
|
|
23
|
+
context: string | null;
|
|
24
|
+
continuation?: TurnContinuation;
|
|
25
|
+
options: TurnOptions;
|
|
26
|
+
};
|
|
27
|
+
export type TurnPhase = "accepted" | "running" | "completed" | "failed" | "cancelled" | "interrupted" | "unknown";
|
|
28
|
+
export type TurnRecord = {
|
|
29
|
+
schema_version: number;
|
|
30
|
+
vault_id: string;
|
|
31
|
+
conversation_id: string;
|
|
32
|
+
input: TurnInput;
|
|
33
|
+
phase: TurnPhase;
|
|
34
|
+
accepted_at_ms: number;
|
|
35
|
+
updated_at_ms: number;
|
|
36
|
+
output: string | null;
|
|
37
|
+
failure_code: string | null;
|
|
38
|
+
};
|
|
39
|
+
export type TurnSummary = {
|
|
40
|
+
request_id: string;
|
|
41
|
+
conversation_id: string;
|
|
42
|
+
target_id: string;
|
|
43
|
+
scope_dir: string;
|
|
44
|
+
phase: TurnPhase;
|
|
45
|
+
accepted_at_ms: number;
|
|
46
|
+
updated_at_ms: number;
|
|
47
|
+
failure_code: string | null;
|
|
48
|
+
};
|
|
49
|
+
export type TurnCommand = {
|
|
50
|
+
kind: "targets";
|
|
51
|
+
} | {
|
|
52
|
+
kind: "set_enabled";
|
|
53
|
+
enabled: boolean;
|
|
54
|
+
} | {
|
|
55
|
+
kind: "submit";
|
|
56
|
+
input: TurnInput;
|
|
57
|
+
} | {
|
|
58
|
+
kind: "read";
|
|
59
|
+
request_id: string;
|
|
60
|
+
} | {
|
|
61
|
+
kind: "list";
|
|
62
|
+
} | {
|
|
63
|
+
kind: "cancel";
|
|
64
|
+
request_id: string;
|
|
65
|
+
};
|
|
66
|
+
export type TurnValue = {
|
|
67
|
+
kind: "targets";
|
|
68
|
+
targets: Array<TurnTarget>;
|
|
69
|
+
} | {
|
|
70
|
+
kind: "availability";
|
|
71
|
+
enabled: boolean;
|
|
72
|
+
} | {
|
|
73
|
+
kind: "record";
|
|
74
|
+
record: TurnRecord | null;
|
|
75
|
+
} | {
|
|
76
|
+
kind: "records";
|
|
77
|
+
records: Array<TurnSummary>;
|
|
78
|
+
} | {
|
|
79
|
+
kind: "cancel_requested";
|
|
80
|
+
accepted: boolean;
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TurnCommand, TurnValue } from "./native-turn-protocol";
|
|
2
|
+
export type * from "./native-turn-protocol";
|
|
3
|
+
/** A transport already admitted to one vault. Calls never own accepted work. */
|
|
4
|
+
export interface NativeTurnService {
|
|
5
|
+
call(command: TurnCommand): Promise<TurnValue>;
|
|
6
|
+
}
|
|
7
|
+
import type { QueueCommand, QueueValue } from "./native-queue-protocol";
|
|
8
|
+
export type * from "./native-queue-protocol";
|
|
9
|
+
export { QUEUE_REQUEST_LIMIT, QUEUE_RECORD_LIMIT, } from "./native-queue-protocol";
|
|
10
|
+
/**
|
|
11
|
+
* An admitted source-only queue transport; never retries uncertain acceptance.
|
|
12
|
+
* Native work outlives calls. Read retained state after a lost reply; cold
|
|
13
|
+
* resume requires the explicit current predecessor and never replays started
|
|
14
|
+
* entries.
|
|
15
|
+
*/
|
|
16
|
+
export interface NativeQueueService {
|
|
17
|
+
call(command: QueueCommand): Promise<QueueValue>;
|
|
18
|
+
}
|
|
19
|
+
import type { ParticipantCommand, ParticipantValue } from "./native-participant-protocol";
|
|
20
|
+
export type * from "./native-participant-protocol";
|
|
21
|
+
export { PARTICIPANT_PROFILE_LIMIT, PARTICIPANT_REQUEST_LIMIT, PARTICIPANT_RECORD_LIMIT, } from "./native-participant-protocol";
|
|
22
|
+
/**
|
|
23
|
+
* An admitted participant port. Captured logical attribution never selects an
|
|
24
|
+
* installed runtime. A lost reply is observed by acceptance ID without replay;
|
|
25
|
+
* Stop/cancel request native cancellation without inventing terminal outcomes.
|
|
26
|
+
*/
|
|
27
|
+
export interface NativeParticipantService {
|
|
28
|
+
call(command: ParticipantCommand): Promise<ParticipantValue>;
|
|
29
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { appStatePath } from "./storage/path";
|
|
1
2
|
import { joinPath } from "./storage/path";
|
|
2
3
|
import { assertSafePluginRelativePath } from "./plugin-distribution/path-safety";
|
|
3
4
|
import { sha256Hex } from "./plugin-distribution/hashes";
|
|
@@ -62,7 +63,7 @@ export function getInstalledPluginAssetFingerprint(record) {
|
|
|
62
63
|
sha256: normalizePluginAssetSha256(file.sha256),
|
|
63
64
|
size: file.size,
|
|
64
65
|
}))
|
|
65
|
-
.sort((left, right) => left.path.
|
|
66
|
+
.sort((left, right) => left.path < right.path ? -1 : left.path > right.path ? 1 : 0)
|
|
66
67
|
.map((file) => `${file.path}:${file.size}:${file.sha256}`)
|
|
67
68
|
.join("|");
|
|
68
69
|
}
|
|
@@ -106,7 +107,7 @@ export function getPluginAssetContentType(path) {
|
|
|
106
107
|
}
|
|
107
108
|
return "application/octet-stream";
|
|
108
109
|
}
|
|
109
|
-
export async function readInstalledPluginAsset({ adapter, installedPlugin, relativePath, expectedSha256, pluginsPath = "
|
|
110
|
+
export async function readInstalledPluginAsset({ adapter, installedPlugin, relativePath, expectedSha256, pluginsPath = appStatePath("plugins"), verifyHash = true, }) {
|
|
110
111
|
const path = normalizePluginAssetRelativePath(relativePath);
|
|
111
112
|
assertSupportedPluginAssetPath(path);
|
|
112
113
|
const metadata = getInstalledPluginAssetMetadata(installedPlugin, path);
|
|
@@ -3,7 +3,7 @@ export interface PluginDependencyContext {
|
|
|
3
3
|
pluginId: string;
|
|
4
4
|
pluginPath: string;
|
|
5
5
|
manifest: PluginManifest;
|
|
6
|
-
host: "workspace" | "electron-renderer" | "electron-sidecar";
|
|
6
|
+
host: "workspace" | "tauri-desktop" | "electron-renderer" | "electron-sidecar";
|
|
7
7
|
format: "commonjs" | "esm" | "node-esm";
|
|
8
8
|
}
|
|
9
9
|
export interface PluginSharedDependencyInfo {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PluginCatalogEntry, PluginCatalogRelease, PluginCompatibilityInput, PluginCompatibilityResult, PluginReleaseManifest } from "./types";
|
|
2
2
|
export declare const checkCatalogEntryCompatibility: (entry: PluginCatalogEntry, input: PluginCompatibilityInput) => PluginCompatibilityResult;
|
|
3
|
-
export declare const checkCatalogReleaseCompatibility: (release: PluginCatalogRelease, input: PluginCompatibilityInput) => PluginCompatibilityResult;
|
|
3
|
+
export declare const checkCatalogReleaseCompatibility: (release: PluginCatalogRelease, input: PluginCompatibilityInput, pluginId?: string) => PluginCompatibilityResult;
|
|
4
4
|
export declare const checkReleaseManifestCompatibility: (manifest: PluginReleaseManifest, input: PluginCompatibilityInput) => PluginCompatibilityResult;
|
|
5
5
|
export declare const compareVersions: (actual: string, required: string) => number;
|