@intentic/extension-ui 1.310.0 → 1.311.0

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 CHANGED
@@ -1,58 +1,36 @@
1
- # @intentic/extension-ui
1
+ # extension-ui
2
2
 
3
- The UI kit an extension renders with, so its views look like the app rather than like a website.
3
+ The UI kit extensions render with: a curated slice of the editor's design system that the host supplies at runtime, so extension views use the shell's own component instances.
4
4
 
5
- A curated slice of the app design system ([`@intentic/ui`](../../_editor/ui)) plus the PrimeVue primitives extension views
6
- actually use. One of the two packages an extension may depend on (with
7
- [`@intentic/extension-api`](../../_shared/extension-api)).
8
-
9
- ## Host-provided at runtime
10
-
11
- This package's [`src/index.ts`](src/index.ts) is its one public surface (the repo's re-export exception). The
12
- kit is **host-provided**: the web app maps this module into its import map
13
- ([extension-host/hostModules.ts](../../_editor/web/src/extension-host/hostModules.ts)), so a third-party bundle
14
- that marks it external resolves to the **shell's own** component instances and theming: one Vue, one
15
- PrimeVue, one theme across the host and every extension. In-repo builtin extensions bundle this same module
16
- and land on the same instances.
17
-
18
- The scope reads oddly (an `@intentic/*` package depending on the app-side `@intentic/ui`) but it is
19
- deliberate: the dependency is build-time-only (for in-repo builtins); at runtime the import map supplies the
20
- shell's instances, so no second copy is shipped.
21
-
22
- ## Drift assertion
5
+ ```mermaid
6
+ flowchart LR
7
+ ui["_editor/ui<br/>design system"] -- "re-exported by src/" --> kit(["extension-ui"])
8
+ kit -- "compiled into" --> host["Editor<br/>hostModules.ts"]
9
+ bundle["Extension bundle"] -- "import map" --> shim["/ext-shims/extension-ui.js"]
10
+ shim -- "globalThis.__intenticHost" --> host
11
+ ```
23
12
 
24
- Export names are mirrored in [`names.mjs`](names.mjs), which drives shim generation and a drift assertion:
25
- keep the two in sync when adding or removing an export. Publishing a typed npm artifact for out-of-repo
26
- authors is a marketplace-phase task.
13
+ - `src/index.ts` re-exports chosen components and helpers from `@intentic/ui` (`_editor/ui`) plus the PrimeVue
14
+ primitives extension views use. Nothing is reimplemented, so an extension view looks and behaves like the shell
15
+ around it. This dependency on `_editor/ui` is a recorded exception to the [`_shared/` boundary](../README.md).
16
+ - At runtime the host supplies the kit: `hostModules.ts` publishes the editor's own module instances on
17
+ `globalThis.__intenticHost`, and the import map in the editor's `index.html` resolves `@intentic/extension-ui` to a
18
+ shim that reads them. A second copy would render unthemed, outside the app's reactivity and its query cache.
19
+ - `scripts/build.mjs` compiles the published package from `_editor/ui`'s sources: declarations pruned to what the kit
20
+ re-exports, and a `dist/index.js` bridge that throws when loaded outside an intentic host.
21
+ - `names.mjs` lists the runtime export names by hand, because the `.vue` graph cannot load in Node. The editor's shim
22
+ generator reads it, and a dev-time assertion in `hostModules.ts` catches drift.
23
+ - `./diff`, `./format` and `./i18n` skip the component barrel, for extension tests that run without a Vue compiler.
27
24
 
28
25
  ## Key files
29
26
 
30
- - [src/index.ts](src/index.ts), the whole surface: which components and helpers an extension may render with.
31
- - [src/format.ts](src/format.ts): the shared formatters, so two extensions render a duration the same way.
32
- - [src/i18n.ts](src/i18n.ts): the extension's words. `extensionI18n(id, base, load)` is the one call every in-repo
33
- extension's `src/i18n.ts` now makes, returning the catalog the host mounts and the translator its components read;
34
- `extensionT(id)` is that translator alone, bound to its own slice of the host's one message tree, and
35
- `registerExtensionMessages` mounts a catalog, which is what the host does before `activate` and what a test
36
- calling `activate` itself has to do instead.
37
-
38
- ## The one control worth calling out
39
-
40
- `AgentRunButton` and `useAgentRunPick` are re-exported because five extensions start an agent for the user:
41
- pipelines, deployments, maintenance, documentation, acceptance: and each had reached its own answer about how
42
- you choose what that costs. Press the primary half and the run opens on the sandbox's standing model for the job
43
- the caller named; use the caret and a panel opens on that run, ending in a bar that carries the button's own
44
- label. Both halves emit the same `run`, because both are the same act: the press that finishes configuring the
45
- run is the press that starts it.
46
-
47
- The choice covers more than the model — the account, the harness, the tier, extended thinking and speed
48
- (`AgentRunChoice`) — and every one of them is a different price. Send them on the turn you start beside `model`:
49
- the sandbox fills a pinned entry's knobs in only for a run that named no model, so dropping them runs the model
50
- you chose on the provider's defaults for everything else. `runPickOf(choice)` (from `@intentic/sandbox-contract`)
51
- translates the whole thing into the turn's own field names in one call.
27
+ - [src/index.ts](src/index.ts) — the kit: every name an extension may import, with usage notes.
28
+ - [scripts/build.mjs](scripts/build.mjs) — builds the published types and the host bridge from `_editor/ui`.
29
+ - [names.mjs](names.mjs) — the runtime export names the shims and the host check read.
30
+ - [../../_editor/web/src/extension-host/hostModules.ts](../../_editor/web/src/extension-host/hostModules.ts) — where the shell publishes its instances to extension bundles.
52
31
 
53
- `useAgentRunPick` takes `api.models` as an argument rather than importing it, which is what lets the control
54
- live in a kit that knows nothing about the extension API. Pass the extension's own host handle:
32
+ ## Commands
55
33
 
56
- ```ts
57
- const runModel = useAgentRunPick(() => host().models);
34
+ ```sh
35
+ pnpm --filter @intentic/extension-ui build
58
36
  ```
@@ -8,6 +8,7 @@ type __VLS_Props = {
8
8
  clampLines?: number;
9
9
  scrollLines?: number;
10
10
  scrollBottom?: boolean;
11
+ tail?: boolean;
11
12
  };
12
13
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
14
  copied: () => any;
@@ -5,4 +5,4 @@ export { createMarkdownHistory, type DocumentState, type EditKind, type Markdown
5
5
  export { blockBody, buildBlockElement, caretAtOffset, offsetOfCaret } from "./sourceDom.js";
6
6
  export { type BarsFigure, type BarsFigureItem, type DagFigure, type DagFigureEdge, type DagFigureNode, type Figure, FIGURE_ACCENTS, type FigureAccent, FIGURE_LANGS, JSON_FIGURE_LANGS, type MarkdownSegment, MERMAID_LANG, type MermaidFigure, parseFigure, splitFigureSegments, type StatsFigure, type StatsFigureItem, } from "./figures.js";
7
7
  export { type Frontmatter, type FrontmatterField, frontmatterHtml, splitFrontmatter } from "./frontmatter.js";
8
- export { createStreamingMarkdown, lexBlocks, lexInline, type MarkdownDecorator, type MarkdownPart, markdownParseCount, type MarkdownToken, renderMarkdown, renderMarkdownParts, type RenderedMarkdown, settledEnd, type StreamingMarkdown, } from "./render.js";
8
+ export { createStreamingMarkdown, lexBlocks, lexInline, type MarkdownDecorator, type MarkdownPart, markdownParseCount, type MarkdownToken, parseMarkdownParts, type ParsedMarkdown, renderMarkdown, renderMarkdownParts, renderParsedMarkdown, type RenderedMarkdown, settledEnd, type StreamingMarkdown, } from "./render.js";
@@ -1,3 +1,4 @@
1
+ import { type CodeBlock } from "./code.js";
1
2
  import { type Figure } from "./figures.js";
2
3
  export interface MarkdownToken {
3
4
  readonly type: string;
@@ -7,6 +8,10 @@ export interface MarkdownToken {
7
8
  export declare const lexBlocks: (source: string) => readonly MarkdownToken[] | undefined;
8
9
  export declare const lexInline: (source: string) => readonly MarkdownToken[] | undefined;
9
10
  export type MarkdownDecorator = (fragment: DocumentFragment) => void;
11
+ interface MarkdownParts {
12
+ readonly html: string;
13
+ readonly blocks: readonly CodeBlock[];
14
+ }
10
15
  export declare const markdownParseCount: () => number;
11
16
  export declare const renderMarkdown: (source: string, decorate?: MarkdownDecorator) => string;
12
17
  export type MarkdownPart = {
@@ -17,9 +22,20 @@ export type MarkdownPart = {
17
22
  readonly figure: Figure;
18
23
  };
19
24
  export type RenderedMarkdown = readonly MarkdownPart[];
25
+ type ParsedPart = {
26
+ readonly kind: "prose";
27
+ readonly parts: MarkdownParts;
28
+ } | {
29
+ readonly kind: "figure";
30
+ readonly figure: Figure;
31
+ };
32
+ export type ParsedMarkdown = readonly ParsedPart[];
33
+ export declare const parseMarkdownParts: (source: string, decorate?: MarkdownDecorator) => ParsedMarkdown;
34
+ export declare const renderParsedMarkdown: (parsed: ParsedMarkdown) => RenderedMarkdown;
20
35
  export declare const renderMarkdownParts: (source: string, decorate?: MarkdownDecorator) => RenderedMarkdown;
21
36
  export declare const settledEnd: (text: string, from: number) => number;
22
37
  export interface StreamingMarkdown {
23
38
  readonly render: (source: string) => RenderedMarkdown;
24
39
  }
25
40
  export declare const createStreamingMarkdown: (decorate?: MarkdownDecorator) => StreamingMarkdown;
41
+ export {};
@@ -1,4 +1,5 @@
1
1
  export declare const blockBody: (element: Element) => string;
2
+ export declare const FIGURE_HOLDER = "md-code-figure";
2
3
  export declare const buildBlockElement: (source: string) => HTMLElement;
3
4
  export declare const offsetOfCaret: (element: HTMLElement, node: Node, offset: number) => number;
4
5
  export declare const caretAtOffset: (element: HTMLElement, offset: number) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentic/extension-ui",
3
- "version": "1.310.0",
3
+ "version": "1.311.0",
4
4
  "description": "The UI kit intentic extensions render with, host-provided at runtime (the app's own components via the import map), so extension UI is always native to the shell",
5
5
  "license": "MIT",
6
6
  "type": "module",