@ycodium-ai/plugin-api 0.2.4486 → 0.2.5004
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 +194 -6
- package/css/ui.css +28 -4
- package/dist/capabilityPorts.d.ts +94 -1
- package/dist/capabilityPorts.d.ts.map +1 -1
- package/dist/capabilityPorts.js.map +1 -1
- package/dist/commands.d.ts +21 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js.map +1 -1
- package/dist/composer-control.d.ts +16 -0
- package/dist/composer-control.d.ts.map +1 -0
- package/dist/composer-control.js +10 -0
- package/dist/composer-control.js.map +1 -0
- package/dist/conversation-queue.d.ts +15 -0
- package/dist/conversation-queue.d.ts.map +1 -1
- package/dist/conversation.d.ts +16 -16
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js +0 -30
- package/dist/conversation.js.map +1 -1
- package/dist/conversationBase.d.ts +15 -1
- package/dist/conversationBase.d.ts.map +1 -1
- package/dist/conversationComposerApi.d.ts +24 -52
- package/dist/conversationComposerApi.d.ts.map +1 -1
- package/dist/conversationComposerEnvironment.d.ts +0 -13
- package/dist/conversationComposerEnvironment.d.ts.map +1 -1
- package/dist/conversationComposerHandle.d.ts +16 -9
- package/dist/conversationComposerHandle.d.ts.map +1 -1
- package/dist/conversationDerive.d.ts +5 -0
- package/dist/conversationDerive.d.ts.map +1 -1
- package/dist/conversationDrafts.d.ts +0 -1
- package/dist/conversationDrafts.d.ts.map +1 -1
- package/dist/conversationHostModels.d.ts +37 -5
- package/dist/conversationHostModels.d.ts.map +1 -1
- package/dist/conversationRows.d.ts +6 -0
- package/dist/conversationRows.d.ts.map +1 -1
- package/dist/conversationSkills.d.ts +1 -0
- package/dist/conversationSkills.d.ts.map +1 -1
- package/dist/conversationTrajectory.d.ts +6 -1
- package/dist/conversationTrajectory.d.ts.map +1 -1
- package/dist/conversationViewProps.d.ts +8 -4
- package/dist/conversationViewProps.d.ts.map +1 -1
- package/dist/conversationWorkEntry.d.ts +8 -0
- package/dist/conversationWorkEntry.d.ts.map +1 -1
- package/dist/dataPorts.gen.d.ts +1726 -1190
- package/dist/dataPorts.gen.d.ts.map +1 -1
- package/dist/dataPorts.gen.js.map +1 -1
- package/dist/executorCard.d.ts +7 -0
- package/dist/executorCard.d.ts.map +1 -1
- package/dist/executorCard.js +1 -0
- package/dist/executorCard.js.map +1 -1
- package/dist/executorModelOptions.d.ts +5 -0
- package/dist/executorModelOptions.d.ts.map +1 -1
- package/dist/executorModelOptions.js +11 -0
- package/dist/executorModelOptions.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +26 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +2 -0
- package/dist/messages.js.map +1 -0
- package/dist/model-picker.d.ts +62 -0
- package/dist/model-picker.d.ts.map +1 -0
- package/dist/model-picker.js +2 -0
- package/dist/model-picker.js.map +1 -0
- package/dist/modelChoiceTraits.d.ts +38 -0
- package/dist/modelChoiceTraits.d.ts.map +1 -0
- package/dist/modelChoiceTraits.js +90 -0
- package/dist/modelChoiceTraits.js.map +1 -0
- package/dist/modelDisplayName.d.ts +17 -0
- package/dist/modelDisplayName.d.ts.map +1 -0
- package/dist/modelDisplayName.js +21 -0
- package/dist/modelDisplayName.js.map +1 -0
- package/dist/plugin-tools.d.ts +9 -0
- package/dist/plugin-tools.d.ts.map +1 -1
- package/dist/process-socket.d.ts +32 -2
- package/dist/process-socket.d.ts.map +1 -1
- package/dist/providerInstanceSelection.d.ts +44 -0
- package/dist/providerInstanceSelection.d.ts.map +1 -0
- package/dist/providerInstanceSelection.js +51 -0
- package/dist/providerInstanceSelection.js.map +1 -0
- package/dist/sign-in.d.ts +41 -0
- package/dist/sign-in.d.ts.map +1 -0
- package/dist/sign-in.js +14 -0
- package/dist/sign-in.js.map +1 -0
- package/dist/slashCommands.d.ts +34 -0
- package/dist/slashCommands.d.ts.map +1 -0
- package/dist/slashCommands.js +2 -0
- package/dist/slashCommands.js.map +1 -0
- package/dist/traits-picker.d.ts +70 -0
- package/dist/traits-picker.d.ts.map +1 -0
- package/dist/traits-picker.js +2 -0
- package/dist/traits-picker.js.map +1 -0
- package/dist/ui.d.ts +14 -25
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +3 -25
- package/dist/ui.js.map +1 -1
- package/dist/uiHostCapabilities.d.ts +2 -1
- package/dist/uiHostCapabilities.d.ts.map +1 -1
- package/dist/uiHostCapabilities.js +3 -0
- package/dist/uiHostCapabilities.js.map +1 -1
- package/dist/version.d.ts +3 -3
- package/dist/version.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -224,6 +224,45 @@ draws the row as your plugin's icon, the title and the summary; Ycodium's own pl
|
|
|
224
224
|
the Ycodium badge, and third-party plugins are named before the title. Web and mobile use the
|
|
225
225
|
same declaration.
|
|
226
226
|
|
|
227
|
+
### Wallpaper skins
|
|
228
|
+
|
|
229
|
+
A plugin can provide one wallpaper through `package.json#ycodium.ui.appearance`.
|
|
230
|
+
The image sits behind the interface and shows through translucent surfaces. The theme
|
|
231
|
+
still supplies all colors; the wallpaper does not change them.
|
|
232
|
+
|
|
233
|
+
```json
|
|
234
|
+
{
|
|
235
|
+
"ycodium": {
|
|
236
|
+
"ui": {
|
|
237
|
+
"assetsPath": "./assets",
|
|
238
|
+
"appearance": {
|
|
239
|
+
"name": "Nord night",
|
|
240
|
+
"wallpaper": "./bg.jpg",
|
|
241
|
+
"dimLight": 60,
|
|
242
|
+
"dimDark": 30,
|
|
243
|
+
"blur": 0
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
- Keep the image inside the plugin's `assetsPath`. Supported formats are `.png`, `.jpg`,
|
|
251
|
+
`.jpeg`, and `.webp`, with a maximum size of 4 MiB. Paths outside that directory,
|
|
252
|
+
unsupported formats, and oversized images are rejected during installation.
|
|
253
|
+
- `dimLight`, `dimDark`, and `blur` are suggested starting values. A person's changes
|
|
254
|
+
take precedence. Choose suitable defaults for the image: a dark photo and a light
|
|
255
|
+
illustration need different overlays, so users should not have to configure them from zero.
|
|
256
|
+
- Each plugin supplies at most one wallpaper, shown as a single choice in settings, without
|
|
257
|
+
a nested list. The user chooses whether to apply it to the whole window or only the sidebar,
|
|
258
|
+
workspace bar, or conversation area; the plugin does not choose those regions.
|
|
259
|
+
- If disabling or uninstalling the plugin makes its image unavailable, the wallpaper falls
|
|
260
|
+
back to None instead of leaving a black surface.
|
|
261
|
+
|
|
262
|
+
Only these appearance fields are supported; wallpaper plugins cannot supply arbitrary CSS.
|
|
263
|
+
Global styles could imitate an approval dialog or hide a refusal button, so this interface
|
|
264
|
+
does not expose them.
|
|
265
|
+
|
|
227
266
|
## Experimental seats
|
|
228
267
|
|
|
229
268
|
`project.workbench.tab` and `sidebar.project.actions` render on Web and Desktop.
|
|
@@ -271,7 +310,7 @@ is refused with `reason: "undeclared"`.
|
|
|
271
310
|
| `network.serve` | Expose the declared loopback routes to paired clients |
|
|
272
311
|
| `executor` | Contribute an agent driver |
|
|
273
312
|
| `systemPrompt` | Add text every agent on the machine sees in its model input: a fixed section and per-turn text |
|
|
274
|
-
| `tools.guard` | Allow or
|
|
313
|
+
| `tools.guard` | Allow, block or ask a person to approve Ycodium tools, and rewrite their results |
|
|
275
314
|
| `sessionProjection` | Store one JSON snapshot per conversation and let the app subscribe to it; also gates `ctx.threads.subscribeList` |
|
|
276
315
|
| `agentPresets` | Add a preset a person can pick before the first message |
|
|
277
316
|
| `ui.seats` | Draw into the named seats |
|
|
@@ -286,11 +325,36 @@ is refused with `reason: "undeclared"`.
|
|
|
286
325
|
The installation review explains each permission before the user accepts it. Declare only the
|
|
287
326
|
capabilities your plugin uses; the public TypeScript declarations define each request's shape.
|
|
288
327
|
|
|
328
|
+
## Public service routes
|
|
329
|
+
|
|
330
|
+
Bind a declared `network.serve` service with `{ port, public: true }` to receive external HTTP or
|
|
331
|
+
WebSocket requests without pairing. Only the default instance can be public. The returned
|
|
332
|
+
`publicPath` and `publicUrls(route)` identify its addresses; disabling or unbinding the plugin closes
|
|
333
|
+
access. Authenticate callers in the plugin and expose only intended routes. See the
|
|
334
|
+
[author guide](../../docs/user/develop/public-routes.md) for the manifest and lifecycle.
|
|
335
|
+
|
|
336
|
+
## External account sign-in
|
|
337
|
+
|
|
338
|
+
Register OAuth parameters with `ctx.signIn.register`, then call `ctx.signIn.accessToken(name)` when
|
|
339
|
+
your plugin needs a token. The host handles device codes or PKCE, refresh and sign-out on that
|
|
340
|
+
machine. Tokens live independently of config; clients and other plugins see only status and identity.
|
|
341
|
+
Call `ctx.signIn.reportInvalid(name, token)` when the service rejects the token used for a request;
|
|
342
|
+
stale reports do not expire a replacement token. Your UI opens the host dialog through
|
|
343
|
+
`bridge.signIn.start(name)`. See [sign-in author guidance](../../docs/user/develop/sign-in.md)
|
|
344
|
+
for callback registration, cancellation and vendor verification requirements.
|
|
345
|
+
|
|
289
346
|
## Shaping the model's turn
|
|
290
347
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
348
|
+
Plugins can shape model input, guard tools and expose progress. The permission-based capabilities
|
|
349
|
+
below are covered in the [prompt and guard guide](../../docs/user/develop/prompt-and-guard.md).
|
|
350
|
+
Their types are exported from `@ycodium-ai/plugin-api`.
|
|
351
|
+
|
|
352
|
+
- **`ctx.messages.beforeSend(hook)`** needs no permission declaration. The host calls it for human
|
|
353
|
+
messages, including human text forwarded by a plugin, before accepting a turn or queued edit.
|
|
354
|
+
Return `null`, `{ text }`, or `{ block }`. Hooks run serially by plugin id, each with a 10 s
|
|
355
|
+
deadline and an abort signal. Errors and invalid answers block sending. The message owns its
|
|
356
|
+
original text, final input and provenance; intermediate drafts are not kept. Automatic wakes and
|
|
357
|
+
notifications bypass these hooks. See [message commands](../../docs/user/develop/message-commands.md).
|
|
294
358
|
|
|
295
359
|
- **`ctx.systemPrompt.section({ id, text, whenPresetId? })`** and **`ctx.systemPrompt.context(fn)`**
|
|
296
360
|
(`systemPrompt`). The host composes every plugin's sections and per-turn contexts into one block
|
|
@@ -299,7 +363,7 @@ through all four.
|
|
|
299
363
|
turn over the input limit, the plugin prompt is dropped and the user message goes out unchanged.
|
|
300
364
|
- **`ctx.tools.guard(fn)`** (`tools.guard`). Runs before every tool on Ycodium's built-in MCP server,
|
|
301
365
|
host and plugin tools alike, in registration order; the first `deny` wins and its `reason` becomes
|
|
302
|
-
the tool's error result.
|
|
366
|
+
the tool's error result. `allow` runs the tool; `ask` waits for a person. A deny blocks it: a throw, a malformed
|
|
303
367
|
answer or 5 s of silence is a denial naming your plugin. Guards do not rewrite arguments or replace
|
|
304
368
|
the tool. A provider's native tools (its own shell and file edits) never pass through here.
|
|
305
369
|
- **`ctx.sessionProjections.register({ name })`** (`sessionProjection`), then
|
|
@@ -315,6 +379,23 @@ through all four.
|
|
|
315
379
|
A selfdev mount (`thread-plugins.<threadId>.<pluginId>`) applies these only to its own conversation;
|
|
316
380
|
a machine-level install applies them to every conversation on the machine.
|
|
317
381
|
|
|
382
|
+
## Slash commands
|
|
383
|
+
|
|
384
|
+
Register `ctx.slashCommand({ kind, name, ... })` during activation to contribute a command to web,
|
|
385
|
+
desktop and mobile, including mobile's new-task composer. No permission declaration is required.
|
|
386
|
+
Use `descriptionKey` and `argumentHintKey` for entries in your plugin's locale files, or the
|
|
387
|
+
corresponding literal fields. Names are unique within a plugin.
|
|
388
|
+
|
|
389
|
+
A `prompt` command supplies `expand(input, { signal })`: its result goes through before-send hooks
|
|
390
|
+
before the turn is accepted. An `action` supplies `run(input, { signal })` and runs without an agent
|
|
391
|
+
turn. It can return a `notice` or an `insert` draft. A run with a thread and no insert leaves a
|
|
392
|
+
timeline activity; a run without a thread shows a notice. Prompt expansion has a 10 s deadline;
|
|
393
|
+
actions have 60 s. Unloading cancels outstanding callbacks.
|
|
394
|
+
|
|
395
|
+
The host uses `plugins.invoke` for actions. Ordinary `ctx.command` registrations remain callable
|
|
396
|
+
from plugin UI and do not appear in the slash menu; the `slash.` prefix belongs to the host.
|
|
397
|
+
See [examples and name resolution](../../docs/user/develop/message-commands.md#给--菜单加命令).
|
|
398
|
+
|
|
318
399
|
## Skills
|
|
319
400
|
|
|
320
401
|
A plugin can ship skills for the agents. List directories inside your package under
|
|
@@ -513,9 +594,116 @@ update. A plugin that declares a version newer than the window is refused until
|
|
|
513
594
|
updated, with no update button. There is no compatibility layer: update against the new types and
|
|
514
595
|
republish.
|
|
515
596
|
|
|
597
|
+
`ctx.tools.observe({ after })` observes persisted tool outcomes without permission. Its view shares
|
|
598
|
+
status, source and duration with the tool-call list; retrieve full IO using `ctx.threads.toolCall.get`.
|
|
599
|
+
Callbacks run on the shared host worker with a five-second limit. Restart does not replay outcomes.
|
|
600
|
+
Slow observers can delay the same worker delivering a person's approval answer.
|
|
601
|
+
|
|
602
|
+
`ctx.tools.rewrite` uses `tools.guard`. It chains text replacements with a five-second callback
|
|
603
|
+
limit and a 1 MiB output limit. The host records both versions before returning the replacement;
|
|
604
|
+
recording failure returns the original. Read the original through `threads.toolCall.get` with
|
|
605
|
+
`part: "original"`. People, plugins and agents share that read: rewriting is not secrecy.
|
|
606
|
+
Successful MCP results containing `structuredContent` bypass rewrites: changing only their text
|
|
607
|
+
would give clients conflicting results, while removing the structured value can violate the tool's
|
|
608
|
+
`outputSchema`. This includes successful object results from host toolkits. Error replacements omit
|
|
609
|
+
structured content. Rewrite failure reports an error even when the underlying tool already produced
|
|
610
|
+
side effects. If rewriting and recording both fail, the original result is returned.
|
|
611
|
+
|
|
612
|
+
A guard may return `{ decision: "ask", reason? }`. The host opens a person-only decision card and
|
|
613
|
+
waits within the executor card's `mcpToolCallCeilingSeconds` budget, with no session-wide grant.
|
|
614
|
+
No thread, timeout, interruption or restart cancels the call. Guard callbacks still have five seconds.
|
|
615
|
+
|
|
516
616
|
<!-- plugin-api-versions:start (generated by scripts/gen-plugin-api-version.ts from packages/plugin-api/version-history.json; edit that file) -->
|
|
517
617
|
|
|
518
|
-
The current API is **
|
|
618
|
+
The current API is **142**. This Ycodium loads plugins declaring 141 through 142.
|
|
619
|
+
|
|
620
|
+
API 142 adds the optional `homeOnly` flag on tools (`PluginTool`), commands (`PluginCommand`) and streams (`PluginStreamCommand`): a flagged entry runs only on the machine that is home of its target project. Another machine is refused before the handler runs (a tool returns an `isError` result with `errorCode` `not-project-home` and a pointer to the home machine; a command or stream fails with `pluginCode` `not-project-home` and `pluginData` `{ reason, projectId, homeEnvironmentId?, homeName? }`), and a home that cannot be read blocks the call with `project-home-unconfirmed`. Unflagged entries, single-machine setups, projects homed here and calls with no target project are unchanged. A write the write gate refuses inside a command now carries the same `pluginCode`. A flagged stream must name `projectId` in its payload (a subscription carries no invoking session); without it the subscription ends with an error instead of being let through. A caller's cancellation interrupts the home check. The UI bridge gains `i18n.useHostFailureText()`: a hook returning a function that turns such a failure (with its `pluginCode` / `pluginData`) into the host's localized sentence, and `undefined` for any other failure; a surface page now receives the failure with those two fields intact.
|
|
621
|
+
|
|
622
|
+
API 141 adds a `queued` result to `ctx.memory.experiences.record` and `ctx.work.items.update`: when the project's home machine cannot be reached, the call is kept on this machine and delivered when the home is back, and resolves with `{ _tag: "queued", outboxId, homeEnvironmentId }` instead of the receipt. Narrow on `_tag` before reading `sequence` or `result`.
|
|
623
|
+
|
|
624
|
+
API 140 adds the denial reasons `not-project-home` and `project-home-unconfirmed`: a plugin's writes (`ctx.events.append`, and the command and service ports such as `ctx.threads`) to a project whose home is another machine are refused with `not-project-home`, and blocked with `project-home-unconfirmed` while that home cannot be read. Reads, single-machine setups and projects homed here are unchanged; stopping and archiving sessions the plugin itself opened stays allowed.
|
|
625
|
+
|
|
626
|
+
API 139 removes `ctx.projects.home.set`. It was human-only and refused every plugin; a project's home can no longer be changed by registration alone, so the port is gone.
|
|
627
|
+
|
|
628
|
+
API 138 adds the `principal` post anchor `{ kind: "principal", principalId, memberId? }` and the optional `source.remoteThreadId` on posts: a post addressed to a remote agent is anchored on that agent (and member) instead of being refused, and a post written by a remote credential records the sending member in `source.memberId`. `communication.records.send` to a remote agent, with `aboutThreadId`, or through a remote credential now writes a post. Post views gain the optional `authorMemberId`: the member a remote author wrote through, so a reply goes back to that member and not to the whole machine. Older machines read the anchor as an unknown kind and omit the new field; no other public type changes.
|
|
629
|
+
|
|
630
|
+
API 137 adds `bridge.ui.TraitsPicker` and `bridge.ui.TraitsMenuContent`, the host's model-options picker (effort, fast mode, context window) that settings and the conversation composer share, typed by `TraitsPickerProps` / `TraitsMenuContentProps` in `@ycodium-ai/plugin-api/ui`. Pass the resolver's `choice` or a model list with stored options, and a thread, a draft or `onModelOptionsChange`; options of a model the catalog no longer lists show read-only, and `disabled` greys the trigger. The main entry adds the rules the picker uses: `modelChoiceTraitDescriptors`, `modelTraitDescriptors`, `isReadOnlyModelChoice`, `hasModelTraitControls` and `modelOptionsAfterChange`, plus `modelOptionTitle` (a label for a bare option id) and `isWithinProviderSelectionLock` with `ProviderSelectionLock` (whether an instance fits a started thread's locked driver and continuation group).
|
|
631
|
+
|
|
632
|
+
API 136 adds the `recipient-wake-paused` code to the `recipientWarnings` of `communication.records.send`: automatic wake-ups between the sender and the recipient are paused after eight exchanges, so the message reaches the inbox without starting a turn. `recipient-not-running` now also covers a session a person stopped, where the message waits in the inbox and no restart is requested. Unknown future codes are still dropped, so older machines omit the new code. No other public type changes.
|
|
633
|
+
|
|
634
|
+
API 135 adds the `work-item` kind to `ConversationCommunicationRecipient`: a trajectory send row for a post on a work item names the work item as its recipient
|
|
635
|
+
|
|
636
|
+
API 134 adds `bridge.ui.ComposerControl`, `ComposerControlIcon`, `ComposerControlChevron` and `ComposerSelectControl`, the controls of the host's composer footer (the host model picker's trigger is one), with `ComposerControlIconProps` in `@ycodium-ai/plugin-api/ui`. `ComposerControl` takes the host `Button`'s props and `ComposerSelectControl` the host `SelectTrigger`'s. The main entry adds the provider-instance rules the host uses: `isProviderSelectionAvailable` (an instance can be chosen and is listed when it is enabled), `sortProviderInstanceEntries` (grouped by driver in settings order) and `resolveProviderDriverKindForInstanceSelection` (an instance id back to its driver).
|
|
637
|
+
|
|
638
|
+
API 133 adds optional `ConversationPendingApproval.presentation`: host-classified intent, justification, sandbox exception, headline, body, remaining arguments and file changes. Conversation UIs render these data without classifying provider arguments again; older hosts can omit it.
|
|
639
|
+
|
|
640
|
+
API 133 adds `bridge.ui.ProviderModelPicker`, the host's model picker that settings and the conversation composer share, typed by `ProviderModelPickerProps` in `@ycodium-ai/plugin-api/ui`. The host owns favorites, row actions, the model-list status row with Retry and the collapsible unavailable section; you pass candidates and callbacks. The main entry adds the display-name helpers `getDisplayModelName` / `getTriggerDisplayModelName` and the row type `ProviderModelPickerModel`, the same rules the host picker uses. Removed from the conversation composer API, since only the picker used them: `model.resolveSelectableModel`, `model.sortProviderModelItems`, `model.useModelCatalogRetry`, `model.isProviderUpdateInFlight`, `model.resolvePickerRowAction`, `settings.useClientSettings`, `settings.useUpdateClientSettings`, `keybindings.modelPickerJumpCommandForIndex`, `keybindings.modelPickerJumpIndexFromCommand`, `keybindings.shortcutLabelForCommand`, and the type `ConversationModelFavorite`. Render `bridge.ui.ProviderModelPicker` instead of drawing your own picker.
|
|
641
|
+
|
|
642
|
+
API 133 replaces `environment.useActiveEnvironmentId()` in the conversation composer API with `environment.useScopedEnvironmentId()`: the machine the surface belongs to (in a conversation view, the thread's machine, which may be remote). The old hook always returned the local machine, so model favorites and per-instance lookups in a remote thread went to the wrong machine.
|
|
643
|
+
|
|
644
|
+
API 132 exports PluginSignInUnavailableError for status reads while account records load
|
|
645
|
+
|
|
646
|
+
API 131 adds host-managed OAuth sign-in through ctx.signIn (including rejected-token reports) and the signIn.start UI bridge
|
|
647
|
+
|
|
648
|
+
API 131 adds optional `statement` to `ctx.approvals.pending.list` records: what the agent wants to do, why it asks, the command, and whether it runs outside the sandbox. When the executor gives none, as in older history, the statement is read from the request's arguments, and is absent when nothing can be read.
|
|
649
|
+
|
|
650
|
+
API 131 adds optional `authorName` and `inGroup` to the post views returned by `ctx.communication.posts.list()` and `ctx.communication.posts.get()`: the author's display name in this project, and whether the post's thread is a group.
|
|
651
|
+
|
|
652
|
+
API 130 Plugins can create, edit and delete schedules and schedule or cancel wake-ups through the generated data ports with commands.dispatch. Schedule and wake creators include plugin signatures; wake summaries expose optional createdBy. Conversation speakers and queue sources identify scheduled tasks and the plugin behind a wake-up.
|
|
653
|
+
|
|
654
|
+
API 129 adds an optional `addedBy: { kind: "plugin", pluginId }` to MCP server entries read through `ctx.projects.config.get` and the machine settings ports. The host stamps it when a plugin adds an entry through `ctx.projects.config.update` or `ctx.machineSettings.update`; any later edit keeps it, and the write inputs have no such field. An entry a plugin added is only started in sessions on machines where that plugin is loaded.
|
|
655
|
+
|
|
656
|
+
API 128 adds public network.serve bindings with publicPath and on-demand publicUrls
|
|
657
|
+
|
|
658
|
+
API 128 renames `ctx.providers.instances.cancelSignIn` to `ctx.providers.instances.cancelMaintenance`; maintenance commands remain human-only.
|
|
659
|
+
|
|
660
|
+
API 128 adds `ctx.threads.session.restart({ threadId, requestId? })` to restart an agent while retaining history and pausing queued messages; declare `thread.session.restart` in `commands.dispatch`; the reply includes a confirmed outcome or unconfirmed after a bounded wait
|
|
661
|
+
|
|
662
|
+
API 127 adds optional `publicBaseUrl` to `ctx.machineSettings.endpoints.list()`: this machine's public `https://<host>` address through its Ycodium Connect tunnel, present only when the machine has one. It is never one of `items`.
|
|
663
|
+
|
|
664
|
+
API 126 Machine tasks carry optional `input.projectTask` resolved from home project configuration. `projects.machines.list` supplies the home task catalog; action availability reports `machine-needs-update` for older machines. Approval-required errors may include the resolved input for owner approval.
|
|
665
|
+
|
|
666
|
+
API 125 Adds the projects.machines.exclusion.set data port and the optional projectMachineExclusion environment capability.
|
|
667
|
+
|
|
668
|
+
API 124 Tool guards may ask for person-only approval. Executor cards can declare mcpToolCallCeilingSeconds for bounded approval waits.
|
|
669
|
+
|
|
670
|
+
API 124 Observe persisted tool call outcomes through tools.observe.after with the same folding as tool call lists.
|
|
671
|
+
|
|
672
|
+
API 124 Observe host tool calls before execution and correlate unambiguous successful outcomes by invocationId.
|
|
673
|
+
|
|
674
|
+
API 124 Rewrite host tool result text with tools.rewrite, retain both versions as decider facts and read original through threads.toolCall.get. Conversation views expose rewrite annotations and original-result controls.
|
|
675
|
+
|
|
676
|
+
API 124 adds `machineLocal` to the `x-ycodium-form` annotation and to `ExecutorFormField`. Mark settings whose value only holds on one machine, such as a home or credentials directory; Ycodium leaves them out when it copies an agent to another machine. `executable-path` fields always count as machine-local.
|
|
677
|
+
|
|
678
|
+
API 124 lets `ctx.communication.wakeLoops` pairs have a plugin on the other side (turn continuation): `peerThreadId` is now optional and `peerPluginId` is new, and `resume` takes either one. Pairs between two conversations still carry `peerThreadId`.
|
|
679
|
+
|
|
680
|
+
API 124 adds the turn-continuation pieces of the conversation surface: timeline rows of kind `continuation-check` (`pluginIds`), `ConversationTurnStatus.continuationCheck` and `ConversationRowsDeriveInput.continuationCheck`, and `ConversationComposerStatus.continuationChecking`, so the stop button can read Cancel check.
|
|
681
|
+
|
|
682
|
+
API 124 adds `heldActivityId` to `ctx.communication.wakeLoops` pairs with a plugin peer, and `resume({ threadId, peerPluginId, heldActivityId })` must name that pause; a pause already continued is refused.
|
|
683
|
+
|
|
684
|
+
API 124 adds `ctx.continuation.register({ name, maxRounds, timeoutMs?, check })`: after a turn ends normally the host asks `check(turn, { signal })` whether the agent should keep going. `{ continue }` starts the next turn (labelled with your plugin and round), `{ done }` leaves a one-line note, `null` does nothing. Rounds count against the wake-loop limit and reset when a person speaks; at `maxRounds` the host pauses with a Continue button instead. No permission is needed. Also adds `signal` to `ctx.process.run`, so a cancelled check kills the process it started, and the plugin page lists the `continuation` contribution.
|
|
685
|
+
|
|
686
|
+
API 123 removes `scripts` from the `ctx.projects.update` input. Actions are the `actions` section of `ctx.projects.config.update`; `project.scripts` now reflects that configuration on every machine.
|
|
687
|
+
|
|
688
|
+
API 122 Add before-send hooks for human messages
|
|
689
|
+
|
|
690
|
+
API 122 Expose message rewrite metadata to conversation views and queues
|
|
691
|
+
|
|
692
|
+
API 122 Remove web-only composer actions in favor of prompt slash commands
|
|
693
|
+
|
|
694
|
+
API 122 Expose the source plugin of conversation skills
|
|
695
|
+
|
|
696
|
+
API 122 Expose plugin slash command menus and optional composer bindings to conversation views
|
|
697
|
+
|
|
698
|
+
API 122 Register prompt and action slash commands; command invocations expose verified thread and cancellation
|
|
699
|
+
|
|
700
|
+
API 122 Adds communication.posts.list and communication.posts.get data ports and UI reads under communication.read permission.
|
|
701
|
+
|
|
702
|
+
API 121 adds `ctx.projects.config.get/update` with integer revisions, home/copy views and secret key names. Updates replace supplied sections on the home machine; copies return `ProjectConfigNotHomeError`.
|
|
703
|
+
|
|
704
|
+
API 121 removes `ctx.plugins.projectConfig.get/update` and their file revision contract.
|
|
705
|
+
|
|
706
|
+
API 120 adds the typed port `ctx.communication.posts.markRead({ projectId, items, requestId? })`. It always refuses plugins (not-for-plugins): its reader is the caller, which a plugin is not.
|
|
519
707
|
|
|
520
708
|
API 119 adds optional archive, message-time and pagination filters to `ctx.threads.search`, with match message identifiers, thread and project names, archive status and a filtersApplied receipt
|
|
521
709
|
|
package/css/ui.css
CHANGED
|
@@ -62,7 +62,10 @@
|
|
|
62
62
|
--animate-ghost-pulse: ghost-pulse 2.4s infinite;
|
|
63
63
|
--animate-status-ping: status-ping 2s infinite;
|
|
64
64
|
--animate-status-spin: status-spin 0.9s infinite steps(3);
|
|
65
|
-
|
|
65
|
+
/* 会话状态图形的三种节奏:越紧急越快。要你处理 0.7s、在跑 1.5s、监视中 3.6s。 */
|
|
66
|
+
--animate-tab-attention-breathe: tab-status-breathe 0.7s ease-in-out infinite;
|
|
67
|
+
--animate-tab-run-chase: tab-run-chase 1.5s ease-in-out infinite;
|
|
68
|
+
--animate-tab-monitor-breathe: tab-monitor-breathe 3.6s ease-in-out infinite;
|
|
66
69
|
|
|
67
70
|
--color-warning-foreground: var(--warning-foreground);
|
|
68
71
|
--color-warning: var(--warning);
|
|
@@ -193,11 +196,12 @@
|
|
|
193
196
|
transform: rotate(45deg);
|
|
194
197
|
}
|
|
195
198
|
}
|
|
196
|
-
/*
|
|
199
|
+
/* 会话状态图形的动画。**只动 opacity**,别加 `transform: scale`——实测在 DPR 1.5
|
|
197
200
|
的屏幕上 Blink 不把 transform 动画交给合成器,每帧回主线程做一次全局样式
|
|
198
201
|
重算:5 秒 810 次(无动画时 27 次)。rotate 与 scale 都一样,跟元素大小无关,
|
|
199
|
-
4px 的点加了 scale 照样 810 次。只淡入淡出是 80
|
|
200
|
-
|
|
202
|
+
4px 的点加了 scale 照样 810 次。只淡入淡出是 80 次。动画元素须是 HTML 元素:
|
|
203
|
+
SVG 内部节点的 opacity 动画不走合成器。 */
|
|
204
|
+
@keyframes tab-status-breathe {
|
|
201
205
|
0%,
|
|
202
206
|
100% {
|
|
203
207
|
opacity: 1;
|
|
@@ -206,6 +210,26 @@
|
|
|
206
210
|
opacity: 0.35;
|
|
207
211
|
}
|
|
208
212
|
}
|
|
213
|
+
/* 三点依次亮起:三个点同一条关键帧,起点各错开三分之一周期。 */
|
|
214
|
+
@keyframes tab-run-chase {
|
|
215
|
+
0%,
|
|
216
|
+
66%,
|
|
217
|
+
100% {
|
|
218
|
+
opacity: 0.25;
|
|
219
|
+
}
|
|
220
|
+
33% {
|
|
221
|
+
opacity: 1;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
@keyframes tab-monitor-breathe {
|
|
225
|
+
0%,
|
|
226
|
+
100% {
|
|
227
|
+
opacity: 1;
|
|
228
|
+
}
|
|
229
|
+
50% {
|
|
230
|
+
opacity: 0.5;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
209
233
|
@keyframes status-ping {
|
|
210
234
|
/* Burst first (immediate feedback for click ripples), then hold
|
|
211
235
|
invisible for the rest of the cycle. Mirrors animate-ping's
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PluginMessages } from "./messages.ts";
|
|
1
2
|
/**
|
|
2
3
|
* ADR-0036 能力口的类型。
|
|
3
4
|
*
|
|
@@ -79,18 +80,64 @@ export type PluginToolGuardDecision = {
|
|
|
79
80
|
} | {
|
|
80
81
|
readonly decision: "deny";
|
|
81
82
|
readonly reason: string;
|
|
83
|
+
} | {
|
|
84
|
+
readonly decision: "ask";
|
|
85
|
+
readonly reason?: string;
|
|
82
86
|
};
|
|
83
87
|
export interface PluginToolGuardInput {
|
|
84
88
|
readonly name: string;
|
|
85
89
|
readonly args: PluginJson;
|
|
86
90
|
readonly threadId: string | null;
|
|
87
91
|
}
|
|
92
|
+
/** 同一次调用的只读快照;守卫和观察者共用身份。 */
|
|
93
|
+
export interface PluginToolCall extends PluginToolGuardInput {
|
|
94
|
+
readonly invocationId: string;
|
|
95
|
+
}
|
|
96
|
+
/** 文字段按原顺序;改写后非文字段原样附在文字段之后。 */
|
|
97
|
+
export interface PluginToolResultText {
|
|
98
|
+
readonly isError: boolean;
|
|
99
|
+
readonly text: readonly string[];
|
|
100
|
+
}
|
|
101
|
+
export interface PluginToolRewriteInput extends PluginToolCall {
|
|
102
|
+
readonly result: PluginToolResultText;
|
|
103
|
+
}
|
|
104
|
+
export type PluginToolRewrite = null | {
|
|
105
|
+
readonly text: readonly string[];
|
|
106
|
+
readonly isError?: boolean;
|
|
107
|
+
};
|
|
108
|
+
/** 已落盘的一次工具调用终态;全文通过 threads.toolCall.get 按窗口读取。 */
|
|
109
|
+
export interface PluginToolCallEnded {
|
|
110
|
+
readonly threadId: string;
|
|
111
|
+
readonly turnId: string | null;
|
|
112
|
+
readonly toolCallId: string;
|
|
113
|
+
readonly status: "completed" | "failed" | "declined" | "stopped" | "unknown";
|
|
114
|
+
readonly source: "native" | "ycodium" | "plugin" | "mcp" | "unknown";
|
|
115
|
+
readonly toolName?: string;
|
|
116
|
+
readonly pluginId?: string;
|
|
117
|
+
readonly mcpServer?: string;
|
|
118
|
+
readonly agentId?: string;
|
|
119
|
+
readonly durationMs?: number;
|
|
120
|
+
readonly input?: string | undefined;
|
|
121
|
+
readonly inputTruncated?: boolean | undefined;
|
|
122
|
+
readonly output?: string | undefined;
|
|
123
|
+
readonly outputTruncated?: boolean | undefined;
|
|
124
|
+
readonly exitCode?: number | undefined;
|
|
125
|
+
readonly invocationId?: string;
|
|
126
|
+
readonly rewrittenBy?: readonly string[];
|
|
127
|
+
}
|
|
88
128
|
/**
|
|
89
129
|
* 需要 `tools.guard`。没有 `register`。守卫不替换实现,也不改参数。
|
|
90
130
|
* 宿主按注册顺序在工具执行前调用,拒绝优先。
|
|
91
131
|
*/
|
|
92
132
|
export interface PluginTools {
|
|
93
|
-
|
|
133
|
+
/** 需要 tools.guard;按注册顺序链式改写文字结果,先落盘再返回。null 表示不改。 */
|
|
134
|
+
rewrite(rewrite: (input: PluginToolRewriteInput) => PluginToolRewrite | Promise<PluginToolRewrite>): PluginDisposer;
|
|
135
|
+
/** 不需要权限;在宿主的串行 worker 上投递,不阻塞工具返回。重启不补投。 */
|
|
136
|
+
observe(observer: {
|
|
137
|
+
readonly before?: (call: PluginToolCall) => void | Promise<void>;
|
|
138
|
+
readonly after?: (call: PluginToolCallEnded) => void | Promise<void>;
|
|
139
|
+
}): PluginDisposer;
|
|
140
|
+
guard(guard: (input: PluginToolCall) => PluginToolGuardDecision | Promise<PluginToolGuardDecision>): PluginDisposer;
|
|
94
141
|
}
|
|
95
142
|
export interface PluginSessionProjectionName {
|
|
96
143
|
readonly name: string;
|
|
@@ -117,8 +164,54 @@ export interface PluginAgentPresetRegistration {
|
|
|
117
164
|
export interface PluginAgentPresets {
|
|
118
165
|
register(input: PluginAgentPresetRegistration): PluginDisposer;
|
|
119
166
|
}
|
|
167
|
+
/** 续跑检查拿到的那一轮。 */
|
|
168
|
+
export interface PluginContinuationTurn {
|
|
169
|
+
readonly threadId: string;
|
|
170
|
+
readonly projectId: string | null;
|
|
171
|
+
/** 这条会话的工作目录;没有工作区时为 null。 */
|
|
172
|
+
readonly cwd: string | null;
|
|
173
|
+
/** 刚正常结束的那一轮。 */
|
|
174
|
+
readonly turnId: string;
|
|
175
|
+
/** 这个插件在当前这段链里已经续过几次;人说过话后从 0 起。下一次续起的轮是第 `continued + 1` 次。 */
|
|
176
|
+
readonly continued: number;
|
|
177
|
+
readonly maxRounds: number;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 检查的答复。null:不用接着干,什么都不留;`continue`:发给 agent 的话,宿主起下一轮;
|
|
181
|
+
* `done`:不用接着干,留一行给人看的收尾说明(截到 300 字)。
|
|
182
|
+
*/
|
|
183
|
+
export type PluginContinuationAnswer = null | {
|
|
184
|
+
readonly continue: string;
|
|
185
|
+
} | {
|
|
186
|
+
readonly done: string;
|
|
187
|
+
};
|
|
188
|
+
export interface PluginContinuationRegistration {
|
|
189
|
+
/** 用于日志与插件页的贡献列表。 */
|
|
190
|
+
readonly name: string;
|
|
191
|
+
/** 1–8。超过 8 按 8,与防空转同一上限。到上限时不起轮,改出暂停提示,人点「继续」才再发。 */
|
|
192
|
+
readonly maxRounds: number;
|
|
193
|
+
/** 检查最长等多久,缺省 120 000,上限 1 800 000。超时按检查失败,不起轮。 */
|
|
194
|
+
readonly timeoutMs?: number;
|
|
195
|
+
/**
|
|
196
|
+
* 一轮正常结束、会话里没有排着的消息、没有在等人、没归档、没被手动停止时调用。检查期间会话按「在跑」显示;
|
|
197
|
+
* 人按停止、发了新消息或插件被停用时 `signal` 中止,答复作废。抛错按检查失败,不起轮。
|
|
198
|
+
*/
|
|
199
|
+
readonly check: (turn: PluginContinuationTurn, options: {
|
|
200
|
+
readonly signal: AbortSignal;
|
|
201
|
+
}) => PluginContinuationAnswer | Promise<PluginContinuationAnswer>;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* 轮次续跑:一轮结束后看结果,决定要不要让 agent 接着干。不需要声明权限。每个插件一处登记,
|
|
205
|
+
* 再登记一处抛错。对这台机器上的会话生效;会话级挂载(selfdev)只对它挂的那条会话生效。
|
|
206
|
+
* 几个插件同时要接着干时合成一轮,各自计次。
|
|
207
|
+
*/
|
|
208
|
+
export interface PluginContinuation {
|
|
209
|
+
register(input: PluginContinuationRegistration): PluginDisposer;
|
|
210
|
+
}
|
|
120
211
|
/** `PluginContext` 在 Phase 1 增加的成员。字段名必须出现在插件 API 参考里。 */
|
|
121
212
|
export interface PluginCapabilityContext {
|
|
213
|
+
readonly continuation: PluginContinuation;
|
|
214
|
+
readonly messages: PluginMessages;
|
|
122
215
|
readonly systemPrompt: PluginSystemPrompt;
|
|
123
216
|
readonly tools: PluginTools;
|
|
124
217
|
readonly sessionProjections: PluginSessionProjections;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilityPorts.d.ts","sourceRoot":"","sources":["../src/capabilityPorts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,2CAA2C;AAC3C,eAAO,MAAM,kCAAkC,QAAc,CAAC;AAE9D,uBAAuB;AACvB,eAAO,MAAM,mCAAmC,QAAc,CAAC;AAE/D,uBAAuB;AACvB,eAAO,MAAM,gCAAgC,QAAmB,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,qCAAqC,QAAc,CAAC;AACjE,eAAO,MAAM,sCAAsC,QAAkB,CAAC;AAEtE,8CAA8C;AAC9C,MAAM,MAAM,UAAU,GAClB,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,UAAU,EAAE,GACrB;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAA;CAAE,CAAC;AAEvD,uCAAuC;AACvC,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,KAAG,MAMrD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GAAI,OAAO,OAAO,KAAG,UAAU,GAAG,IAc1E,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CACd,IAAI,EAAE,sBAAsB,EAC5B,OAAO,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;KAAE,KACtC,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACnE;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,8BAA8B,GAAG,cAAc,CAAC;CACjE;AAED,0DAA0D;AAC1D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;IACtD,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;CAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilityPorts.js","sourceRoot":"","sources":["../src/capabilityPorts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"capabilityPorts.js","sourceRoot":"","sources":["../src/capabilityPorts.ts"],"names":[],"mappings":"AAaA,2CAA2C;AAC3C,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9D,uBAAuB;AACvB,MAAM,CAAC,MAAM,mCAAmC,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/D,uBAAuB;AACvB,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,IAAI,GAAG,IAAI,CAAC;AACjE,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAWtE,uCAAuC;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAc,EAAU,EAAE;IAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,mBAAmB,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;AACtD,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAc,EAAqB,EAAE;IAChF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC1C,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,GAAG,kCAAkC,EAAE,CAAC;QACtF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAe,CAAC;AAC3C,CAAC,CAAC"}
|
package/dist/commands.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ export type PluginViewer = PluginViewerPorts;
|
|
|
16
16
|
* 推迟),所以这里只有调用方的粗粒度信息;字段只增不改。
|
|
17
17
|
*/
|
|
18
18
|
export interface PluginCommandInvocation {
|
|
19
|
+
/** 宿主核实的发起会话;没有会话的界面调用缺席。 */
|
|
20
|
+
readonly thread?: {
|
|
21
|
+
readonly threadId: string;
|
|
22
|
+
readonly projectId: string;
|
|
23
|
+
};
|
|
24
|
+
/** 单次调用结束或取消时中止。 */
|
|
25
|
+
readonly signal?: AbortSignal;
|
|
19
26
|
/** 调用方凭据已通过的 scope("read" 或 "operate")。 */
|
|
20
27
|
readonly scope: "read" | "operate";
|
|
21
28
|
/** 宿主验证的人发起的操作调用,且插件声明 work.writeAsPerson 时才有。调用结束即失效。 */
|
|
@@ -111,6 +118,15 @@ export interface PluginCommand {
|
|
|
111
118
|
readonly resultSchema?: PluginJsonSchema | undefined;
|
|
112
119
|
/** 仅第一方插件:按名引用宿主注册表里的 contracts schema,替代 `resultSchema`。 */
|
|
113
120
|
readonly resultContract?: PluginContractName | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* 声明这条命令只在目标项目的家机器上运行。目标项目取自 payload 里明写的 `projectId`;没有就取发起会话所属的项目
|
|
123
|
+
* (`invocation.thread`)。调用方取消会中断查家,取消后不进 `handle`。
|
|
124
|
+
* 项目的家在别的机器时,宿主在进入 `handle` 之前拒绝,过线错误的 `pluginCode` 为 `not-project-home`,`pluginData`
|
|
125
|
+
* 为 `{ reason, projectId, homeEnvironmentId?, homeName? }`;暂时读不出项目的家时 `pluginCode` 为
|
|
126
|
+
* `project-home-unconfirmed`,稍后重试即可。家为空、家就是本机、单机部署、取不到目标项目的调用都照常放行。
|
|
127
|
+
* 缺省或 false 不设闸。读取或维护这个插件按项目记下的自有状态的命令应当声明它;只经数据端口读写账本的不需要。
|
|
128
|
+
*/
|
|
129
|
+
readonly homeOnly?: boolean | undefined;
|
|
114
130
|
/** 返回值必须可 JSON 序列化;形状由插件与自己的 UI/调用方约定。 */
|
|
115
131
|
readonly handle: (payload: Record<string, unknown>, invocation: PluginCommandInvocation) => Promise<unknown> | unknown;
|
|
116
132
|
}
|
|
@@ -159,6 +175,11 @@ export interface PluginStreamCommand {
|
|
|
159
175
|
readonly buffer?: {
|
|
160
176
|
readonly latest: number;
|
|
161
177
|
} | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* 同 `PluginCommand.homeOnly`:目标项目的家在别的机器时,订阅在进入 `handle` 之前以同样的错误结束。订阅信封不带发起会话,
|
|
180
|
+
* 所以流**必须**在 payload 里写 `projectId`;没写,订阅以说明原因的错误结束,宿主不猜项目、也不放行。
|
|
181
|
+
*/
|
|
182
|
+
readonly homeOnly?: boolean | undefined;
|
|
162
183
|
readonly handle: (payload: Record<string, unknown>, emit: (value: unknown) => void, signal: AbortSignal, invocation: PluginCommandInvocation) => Promise<void>;
|
|
163
184
|
}
|
|
164
185
|
//# sourceMappingURL=commands.d.ts.map
|
package/dist/commands.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAE5B,sDAAsD;AACtD,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD,kEAAkE;AAClE,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD,mCAAmC;AACnC,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IACnC,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,M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C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACtD,8DAA8D;IAC9D,QAAQ,CAAC,eAAe,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC1D;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACnD,2DAA2D;IAC3D,QAAQ,CAAC,YAAY,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACvD;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAC1D;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,CACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,EAC9B,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB"}
|
package/dist/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAgJA;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 宿主 UI 原语 `ComposerControl` 一族:会话输入框底栏的控件样式,宿主的模型选择器与插件的选手格、档位、
|
|
3
|
+
* 权限格画成同一个样子。插件经 `bridge.ui` 取用。`ComposerControl` 收宿主 `Button` 的 props,
|
|
4
|
+
* `ComposerSelectControl` 收宿主 `SelectTrigger` 的 props(自带下拉箭头),两者缺省 `size="sm"`、
|
|
5
|
+
* `variant="ghost"`;`ComposerControlChevron` 是控件尾部的下拉箭头,不收 props。
|
|
6
|
+
*
|
|
7
|
+
* @module @ycodium-ai/plugin-api/ui
|
|
8
|
+
*/
|
|
9
|
+
/** 控件里的图标。`Icon` 是图标组件的类型(如 lucide 图标),本包因此不依赖 React。 */
|
|
10
|
+
export interface ComposerControlIconProps<Icon = unknown> {
|
|
11
|
+
readonly icon: Icon;
|
|
12
|
+
readonly className?: string | undefined;
|
|
13
|
+
/** `large` 大半号。缺省 `default`。 */
|
|
14
|
+
readonly opticalSize?: "default" | "large" | undefined;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=composer-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composer-control.d.ts","sourceRoot":"","sources":["../src/composer-control.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,yDAAyD;AACzD,MAAM,WAAW,wBAAwB,CAAC,IAAI,GAAG,OAAO;IACtD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,gCAAgC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;CACxD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 宿主 UI 原语 `ComposerControl` 一族:会话输入框底栏的控件样式,宿主的模型选择器与插件的选手格、档位、
|
|
3
|
+
* 权限格画成同一个样子。插件经 `bridge.ui` 取用。`ComposerControl` 收宿主 `Button` 的 props,
|
|
4
|
+
* `ComposerSelectControl` 收宿主 `SelectTrigger` 的 props(自带下拉箭头),两者缺省 `size="sm"`、
|
|
5
|
+
* `variant="ghost"`;`ComposerControlChevron` 是控件尾部的下拉箭头,不收 props。
|
|
6
|
+
*
|
|
7
|
+
* @module @ycodium-ai/plugin-api/ui
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=composer-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composer-control.js","sourceRoot":"","sources":["../src/composer-control.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -32,6 +32,12 @@ export type ConversationQueueEntrySource = {
|
|
|
32
32
|
} | {
|
|
33
33
|
readonly kind: "scheduled-wake";
|
|
34
34
|
readonly dueAt: string;
|
|
35
|
+
readonly pluginId?: string;
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: "schedule";
|
|
38
|
+
readonly scheduleId: string;
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly pluginId?: string;
|
|
35
41
|
} | {
|
|
36
42
|
readonly kind: "record";
|
|
37
43
|
readonly recordId: string;
|
|
@@ -69,6 +75,15 @@ export type ConversationQueueEntrySource = {
|
|
|
69
75
|
readonly kind: "restart-resume";
|
|
70
76
|
};
|
|
71
77
|
export interface ConversationQueueEntry {
|
|
78
|
+
readonly rewrite?: {
|
|
79
|
+
readonly original: string;
|
|
80
|
+
readonly steps: readonly {
|
|
81
|
+
readonly pluginId: string;
|
|
82
|
+
readonly via: "before-send" | "slash-command";
|
|
83
|
+
readonly command?: string | undefined;
|
|
84
|
+
}[];
|
|
85
|
+
} | undefined;
|
|
86
|
+
readonly rewrittenText?: string | undefined;
|
|
72
87
|
readonly intentId: string;
|
|
73
88
|
readonly status: string;
|
|
74
89
|
readonly deliveryCertainty: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-queue.d.ts","sourceRoot":"","sources":["../src/conversation-queue.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,4DAA4D;AAC5D,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CA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