@acryldev/blends-frame 0.0.0-stage → 0.1.6
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 +21 -0
- package/README.md +105 -2
- package/cordis.patch.yml +3 -0
- package/lib/app-generation.d.ts +38 -0
- package/lib/app-generation.js +101 -0
- package/lib/app-generation.js.map +1 -0
- package/lib/app-plugins.d.ts +145 -0
- package/lib/app-reload.d.ts +74 -0
- package/lib/app-snapshot.d.ts +40 -0
- package/lib/app-urls.d.ts +17 -0
- package/lib/applied-live.d.ts +43 -0
- package/lib/auto-save.d.ts +63 -0
- package/lib/branch-chats.d.ts +37 -0
- package/lib/client.js +50401 -0
- package/lib/client.js.map +1 -0
- package/lib/contract.d.ts +414 -0
- package/lib/git-sync.d.ts +52 -0
- package/lib/github-connect.d.ts +44 -0
- package/lib/graph-contract.d.ts +85 -0
- package/lib/graph-inspect.d.ts +16 -0
- package/lib/index.d.ts +186 -0
- package/lib/index.js +4060 -0
- package/lib/index.js.map +1 -0
- package/lib/outward-guard.d.ts +45 -0
- package/lib/plain.d.ts +26 -0
- package/lib/plugin-graph.d.ts +38 -0
- package/lib/real-chats.d.ts +42 -0
- package/lib/registry.d.ts +73 -0
- package/lib/selection-context.d.ts +118 -0
- package/lib/tool-call-guard.d.ts +104 -0
- package/lib/types/client/AppSection.d.ts +10 -0
- package/lib/types/client/BlendsFrame.d.ts +52 -0
- package/lib/types/client/FileView.d.ts +8 -0
- package/lib/types/client/FilesView.d.ts +17 -0
- package/lib/types/client/GitView.d.ts +18 -0
- package/lib/types/client/GraphView.d.ts +22 -0
- package/lib/types/client/LeftPanel.d.ts +71 -0
- package/lib/types/client/NameYourApp.d.ts +10 -0
- package/lib/types/client/PluginsSection.d.ts +17 -0
- package/lib/types/client/RegistryView.d.ts +11 -0
- package/lib/types/client/RemoteSync.d.ts +17 -0
- package/lib/types/client/RightPanel.d.ts +45 -0
- package/lib/types/client/SelectionChip.d.ts +59 -0
- package/lib/types/client/SettingsExpand.d.ts +6 -0
- package/lib/types/client/SettingsLauncher.d.ts +9 -0
- package/lib/types/client/ShareChooser.d.ts +21 -0
- package/lib/types/client/ShortcutsRow.d.ts +15 -0
- package/lib/types/client/TerminalView.d.ts +7 -0
- package/lib/types/client/TurnSaveFooter.d.ts +18 -0
- package/lib/types/client/app-reload.d.ts +28 -0
- package/lib/types/client/branch-chats.d.ts +71 -0
- package/lib/types/client/branches.d.ts +23 -0
- package/lib/types/client/canvas/AppCanvas.d.ts +25 -0
- package/lib/types/client/canvas/app-canvas.d.ts +59 -0
- package/lib/types/client/canvas/picker.d.ts +27 -0
- package/lib/types/client/chat-draft.d.ts +15 -0
- package/lib/types/client/chat-saves.d.ts +28 -0
- package/lib/types/client/chats.d.ts +182 -0
- package/lib/types/client/desktop-app.d.ts +65 -0
- package/lib/types/client/feedback.d.ts +21 -0
- package/lib/types/client/frame-state.d.ts +34 -0
- package/lib/types/client/frame-view.d.ts +35 -0
- package/lib/types/client/fuzzy.d.ts +23 -0
- package/lib/types/client/git-sync.d.ts +39 -0
- package/lib/types/client/graph-api.d.ts +11 -0
- package/lib/types/client/graph-canvas.d.ts +63 -0
- package/lib/types/client/graph-link.d.ts +21 -0
- package/lib/types/client/graph-model.d.ts +23 -0
- package/lib/types/client/graph-styles.d.ts +3 -0
- package/lib/types/client/highlight.d.ts +15 -0
- package/lib/types/client/index.d.ts +23 -0
- package/lib/types/client/panel-resize.d.ts +29 -0
- package/lib/types/client/plain-failure.d.ts +10 -0
- package/lib/types/client/plugins-navigator.d.ts +81 -0
- package/lib/types/client/registry-api.d.ts +21 -0
- package/lib/types/client/registry-list.d.ts +18 -0
- package/lib/types/client/selection.d.ts +56 -0
- package/lib/types/client/settings-fullscreen.d.ts +13 -0
- package/lib/types/client/sidebar-opens.d.ts +36 -0
- package/lib/types/client/snapshot.d.ts +11 -0
- package/lib/types/client/styles.d.ts +3 -0
- package/lib/types/client/switch-request.d.ts +18 -0
- package/lib/types/client/tab-sizing.d.ts +31 -0
- package/lib/types/client/tabs.d.ts +139 -0
- package/lib/types/client/theme-switch.d.ts +27 -0
- package/lib/types/client/tools.d.ts +15 -0
- package/lib/types/client/versions.d.ts +34 -0
- package/lib/types/client/view-state.d.ts +42 -0
- package/lib/types/contract.d.ts +414 -0
- package/lib/types/graph-contract.d.ts +85 -0
- package/lib/types/graph-inspect.d.ts +16 -0
- package/package.json +126 -4
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cordis Host plugin: the Blends frame's one route, `GET /api/acryl-blends-frame/state` - the app's name and folder, where its page is served,
|
|
3
|
+
* and its local branches. The frame itself is the client half (`./client`).
|
|
4
|
+
*
|
|
5
|
+
* One effect owns the confined git runner and both registrations; disposal unmounts the route and reaps any git call still running. The right
|
|
6
|
+
* panel's terminals, PTY agents, files and git are the workspace's own Host services (`acryl-workspace`), run here as a child plugin: only its
|
|
7
|
+
* Host half, since the frame, not the workbench, owns the page.
|
|
8
|
+
*/
|
|
9
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
+
import { Acryl } from 'acrylblends';
|
|
11
|
+
import { GitRunner, Versions } from '@acryldev/versions';
|
|
12
|
+
import { type ShareAppPluginResult } from './app-plugins.ts';
|
|
13
|
+
import { type GraphPort } from './plugin-graph.ts';
|
|
14
|
+
import { type AppRow } from './app-reload.ts';
|
|
15
|
+
import { SelectionInbox } from './selection-context.ts';
|
|
16
|
+
import { type BranchChatsRecord } from './branch-chats.ts';
|
|
17
|
+
import { type AppPluginKind, type AppReloadView, type AppPluginsView, type ChatSavesView, type FeedbackView, type PulledPluginView, type PushPlan, type RegistryView, type SavedPluginResult, type SharePlan, type ShareVisibility, type FrameBranch, type FrameState, type GithubConnectState, type GithubReadiness, type GitRemoteState, type GitSyncResult } from './contract.ts';
|
|
18
|
+
import { type AppSnapshotService } from './app-snapshot.ts';
|
|
19
|
+
/**
|
|
20
|
+
* The part of the runtime's `appInstance` service ACRYL plugins read (a separated interface: plugins do not import the runtime). Every plugin
|
|
21
|
+
* declares exactly this shape, so the Context augmentations agree in a program that loads several; the app's folder (`root`) is read apart.
|
|
22
|
+
*/
|
|
23
|
+
interface AppInstanceService {
|
|
24
|
+
readonly home: string;
|
|
25
|
+
readonly dshHome: string;
|
|
26
|
+
}
|
|
27
|
+
declare module '@deepseek-ai/cordis' {
|
|
28
|
+
interface Context {
|
|
29
|
+
appInstance: AppInstanceService;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export interface FrameConfig {
|
|
33
|
+
/** Where the app's own page is served (`/app`); the frame shows no app without it. */
|
|
34
|
+
readonly appPage?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The GitHub account or organization a local plugin is shared to; the signed-in `gh` account when absent. A rehearsal sets a test organization
|
|
37
|
+
* (`shareOwner: inboxxobni`) so nothing lands on the person's own account.
|
|
38
|
+
*/
|
|
39
|
+
readonly shareOwner?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const name = "@acryldev/blends-frame";
|
|
42
|
+
export declare const inject: string[];
|
|
43
|
+
/** `git for-each-ref` lines `<current marker> <name>`: the checked-out branch first, the rest by name. */
|
|
44
|
+
export declare function parseBranches(stdout: string): FrameBranch[];
|
|
45
|
+
/** A git call as the state and the shared-versions check use it: the versions runner satisfies it, and a test stands in for it. */
|
|
46
|
+
export interface GitLike {
|
|
47
|
+
run(args: readonly string[], cwd: string): Promise<{
|
|
48
|
+
readonly stdout: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The versions that are also on another local branch or a remote-tracking branch: another line of work has them, or they are on the remote, so
|
|
53
|
+
* the list marks them "shared". The current branch's own ref is left out (being on it is not sharing); one `rev-list` per other ref, then an
|
|
54
|
+
* intersection with the listed versions.
|
|
55
|
+
*/
|
|
56
|
+
export declare function sharedVersions(git: GitLike, root: string, hashes: readonly string[]): Promise<string[]>;
|
|
57
|
+
/** `git status --porcelain -z` entries: one per changed path (a rename's second, NUL-separated path is not counted twice). */
|
|
58
|
+
export declare function countChanges(stdout: string): number;
|
|
59
|
+
/** Settings → Plugins: the app's plugins, switching one in `blend.yaml`, and sharing a local one. */
|
|
60
|
+
export interface PluginsPort {
|
|
61
|
+
read(): Promise<AppPluginsView>;
|
|
62
|
+
switch(kind: AppPluginKind, name: string, on: boolean): Promise<void>;
|
|
63
|
+
/** What sharing one local plugin would do (repository, version, visibility); nothing is sent. */
|
|
64
|
+
planShare(name: string, visibility?: ShareVisibility, registry?: boolean): Promise<SharePlan>;
|
|
65
|
+
/** Publish one local plugin to its GitHub repository and release, through the plugin-hub path: only the plan the person confirmed. */
|
|
66
|
+
share(name: string, confirmed: SharePlan): Promise<ShareAppPluginResult>;
|
|
67
|
+
/** Keep a packed copy of one local plugin on this machine (the app's plugin store); nothing leaves the machine. */
|
|
68
|
+
save(name: string): Promise<SavedPluginResult>;
|
|
69
|
+
/** The public registry (cordisplugins.github.io), each entry marked with what this app has. Unreadable is an answer, not a failure. */
|
|
70
|
+
registry(): Promise<RegistryView>;
|
|
71
|
+
/** Add one released plugin (`github:<owner>/<repo>@<version>`) to the running app, through the app's plugin-share checks. @throws PlainError when it is refused. */
|
|
72
|
+
pull(source: string): Promise<PulledPluginView>;
|
|
73
|
+
/** Whether this computer can share to GitHub now; read before the person is asked anything. */
|
|
74
|
+
github(): Promise<GithubReadiness>;
|
|
75
|
+
/** Connect GitHub from the app: start (or rejoin) GitHub's browser sign-in, read where it is, or stop it. */
|
|
76
|
+
readonly connect: {
|
|
77
|
+
start(): Promise<GithubConnectState>;
|
|
78
|
+
state(): GithubConnectState;
|
|
79
|
+
cancel(): void;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/** A note's screenshot as the frame serves it: the bytes and their image type. */
|
|
83
|
+
export interface FeedbackShot {
|
|
84
|
+
readonly bytes: Uint8Array;
|
|
85
|
+
readonly mediaType: 'image/webp' | 'image/png';
|
|
86
|
+
}
|
|
87
|
+
/** The builder's side of the app's feedback: the notes people sent, marking them seen, and one note's screenshot. */
|
|
88
|
+
export interface FeedbackPort {
|
|
89
|
+
read(): Promise<FeedbackView>;
|
|
90
|
+
markSeen(ids: readonly string[]): Promise<void>;
|
|
91
|
+
screenshot(id: string): Promise<FeedbackShot | undefined>;
|
|
92
|
+
}
|
|
93
|
+
/** Reads the app's `feedback` service where it is now; `available` false without it. */
|
|
94
|
+
export declare function feedbackPort(source: () => unknown): FeedbackPort;
|
|
95
|
+
/** What the Branches "New" button asks of the Host. */
|
|
96
|
+
export interface BranchesPort {
|
|
97
|
+
/** Make the branch from the checked-out version and switch to it; rejects with git's reason. */
|
|
98
|
+
create(name: string): Promise<void>;
|
|
99
|
+
/** Move the app's folder to an existing local branch; rejects with git's reason. */
|
|
100
|
+
switchTo(name: string): Promise<void>;
|
|
101
|
+
}
|
|
102
|
+
/** The Git tab's push and pull for the checked-out branch (./git-sync.ts). Each rejects with the one line to show. */
|
|
103
|
+
export interface GitSyncPort {
|
|
104
|
+
state(options: {
|
|
105
|
+
readonly fetch?: boolean;
|
|
106
|
+
}): Promise<GitRemoteState>;
|
|
107
|
+
/** What a push would send and where; nothing is sent. */
|
|
108
|
+
planPush(): Promise<PushPlan>;
|
|
109
|
+
/** Sends only the plan the person confirmed. */
|
|
110
|
+
push(confirmed: PushPlan): Promise<GitSyncResult>;
|
|
111
|
+
pull(): Promise<GitSyncResult>;
|
|
112
|
+
}
|
|
113
|
+
/** What each turn of a chat saved (the auto-save), for the line under the answer. */
|
|
114
|
+
export interface ChatSavesPort {
|
|
115
|
+
read(session: string): Promise<ChatSavesView>;
|
|
116
|
+
}
|
|
117
|
+
/** The chats that have a turn (the left panel lists only those, and the open one). */
|
|
118
|
+
export interface RealChatsPort {
|
|
119
|
+
read(): Promise<readonly {
|
|
120
|
+
readonly id: string;
|
|
121
|
+
readonly title: string;
|
|
122
|
+
}[]>;
|
|
123
|
+
}
|
|
124
|
+
/** The app's code as the Host runs it: what it runs now, and the answer once that changes. */
|
|
125
|
+
export interface AppReloadPort {
|
|
126
|
+
view(): AppReloadView;
|
|
127
|
+
wait(after: number, timeoutMs: number): Promise<AppReloadView>;
|
|
128
|
+
}
|
|
129
|
+
/** The `name` of a branch request, or why it cannot be one. */
|
|
130
|
+
export declare function parseBranchName(body: unknown): {
|
|
131
|
+
name: string;
|
|
132
|
+
} | {
|
|
133
|
+
problem: string;
|
|
134
|
+
};
|
|
135
|
+
/** Which branch each chat was opened on (the frame lists a branch's own chats; DSH itself knows no branches), and which chats are open. */
|
|
136
|
+
export interface BranchChatsPort {
|
|
137
|
+
read(): Promise<BranchChatsRecord>;
|
|
138
|
+
/** Records a chat's branch once; a chat stays where it was opened. */
|
|
139
|
+
assign(id: string, branch: string): Promise<void>;
|
|
140
|
+
/** Opens or closes one chat. */
|
|
141
|
+
setOpen(id: string, open: boolean): Promise<void>;
|
|
142
|
+
/** Decides which chats are open when nobody has yet. */
|
|
143
|
+
initOpen(ids: readonly string[]): Promise<void>;
|
|
144
|
+
}
|
|
145
|
+
export interface FrameRoutesDeps {
|
|
146
|
+
readonly state: () => Promise<FrameState>;
|
|
147
|
+
readonly report?: (cause: unknown) => void;
|
|
148
|
+
readonly plugins?: PluginsPort;
|
|
149
|
+
/** The Host's plugin graph and the changes of its fibers (Settings > Plugins > Graph). */
|
|
150
|
+
readonly graph?: GraphPort;
|
|
151
|
+
readonly feedback?: FeedbackPort;
|
|
152
|
+
readonly branches?: BranchesPort;
|
|
153
|
+
readonly branchChats?: BranchChatsPort;
|
|
154
|
+
/** What each turn of a chat saved (the auto-save), for the line under the answer. */
|
|
155
|
+
readonly chatSaves?: ChatSavesPort;
|
|
156
|
+
/** Which of the listed versions are also on another branch or the remote. */
|
|
157
|
+
readonly shared?: (hashes: readonly string[]) => Promise<string[]>;
|
|
158
|
+
readonly realChats?: RealChatsPort;
|
|
159
|
+
readonly gitSync?: GitSyncPort;
|
|
160
|
+
/** The capture a Save point starts with. */
|
|
161
|
+
readonly snapshot?: Pick<AppSnapshotService, 'captureForSave'>;
|
|
162
|
+
readonly appReload?: AppReloadPort;
|
|
163
|
+
/** The element picks waiting for the step that reads the message they belong to (./selection-context.ts). */
|
|
164
|
+
readonly selection?: SelectionInbox;
|
|
165
|
+
}
|
|
166
|
+
export declare function frameRoutes({ state, report, plugins, graph, feedback, branches, branchChats, chatSaves, shared, realChats, gitSync, snapshot, appReload, selection }: FrameRoutesDeps): Acryl;
|
|
167
|
+
/**
|
|
168
|
+
* The app's rows, plugins first and routes after (the order they start in): each as the reloader drives it. A row's module is imported under the
|
|
169
|
+
* current generation (`./app-generation.ts`) by the loader itself, so `restart` stops the row's plugin and has the loader start the entry again - not
|
|
170
|
+
* `fiber.restart()`, which runs the module the row already has. The plugin leaves the registry (what DSH's own hot reload does) rather than its fiber
|
|
171
|
+
* being disposed: the loader reads a fiber disposed on its own as the person switching the row off, and writes that into the app's `cordis.yml`.
|
|
172
|
+
*/
|
|
173
|
+
export declare function appRowsOf(loader: Context['loader'] | undefined): AppRow[];
|
|
174
|
+
/**
|
|
175
|
+
* Save the app's folder as a version called `message`, and say which one it is (`v7`: how many versions the branch has then). Only a turn DSH says changed
|
|
176
|
+
* files comes here, but the commit takes the whole folder as a save point does: a file the person changed by hand since the last version goes into it. A folder
|
|
177
|
+
* with nothing to commit (the agent committed itself, or the files are ignored) makes no version.
|
|
178
|
+
*/
|
|
179
|
+
export declare function saveVersion(git: GitRunner, versions: Versions, root: string, message: string): Promise<{
|
|
180
|
+
hash: string;
|
|
181
|
+
version: number;
|
|
182
|
+
subject: string;
|
|
183
|
+
} | undefined>;
|
|
184
|
+
export declare function apply(ctx: Context, config?: FrameConfig): void;
|
|
185
|
+
export { AutoSave, messageText, requestSubject, SaveStore } from './auto-save.ts';
|
|
186
|
+
export { FRAME_API_PREFIX, FRAME_STATE_PATH, parseFrameState, type FrameBranch, type FrameState } from './contract.ts';
|