@schlenkr/ragents 0.1.11 → 0.1.13
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 +1 -1
- package/apps/server/src/access-projection.ts +2 -2
- package/apps/server/src/plugin-build/build.ts +7 -7
- package/apps/server/src/profile/bundle-manifest.ts +11 -11
- package/apps/server/src/profile/plugin-discovery.ts +2 -2
- package/apps/server/src/provider.ts +1 -1
- package/apps/web/dist/assets/{highlighted-body-KPVGNVTW-BfNSGxjB.js → highlighted-body-KPVGNVTW-CpPi6QLr.js} +1 -1
- package/apps/web/dist/assets/{main-D6bsKcIK.js → main-DJmCHGzM.js} +1 -1
- package/apps/web/dist/assets/{mermaid-HWGCJPDP-DROEqEeg.js → mermaid-HWGCJPDP-q-mf1kLN.js} +2 -2
- package/apps/web/dist/assets/{runPanel-Dumuuqry.js → runPanel-nk_aMxSn.js} +1 -1
- package/apps/web/dist/host-web.json +1 -1
- package/apps/web/dist/index.html +2 -2
- package/apps/web/dist/run-panel.html +2 -2
- package/apps/web/src/chat/QuasselHost.tsx +1 -1
- package/bundles/ragents.activity/ragents-bundle.json +3 -3
- package/bundles/ragents.actor-programs/ragents-bundle.json +3 -3
- package/bundles/ragents.ask/ragents-bundle.json +3 -3
- package/bundles/ragents.browser/ragents-bundle.json +3 -3
- package/bundles/ragents.documents/ragents-bundle.json +3 -3
- package/bundles/ragents.lsp-fsharp/ragents-bundle.json +3 -3
- package/bundles/ragents.lsp-roslyn/ragents-bundle.json +3 -3
- package/bundles/ragents.lsp-typescript/ragents-bundle.json +3 -3
- package/bundles/ragents.model-relay/ragents-bundle.json +3 -3
- package/bundles/ragents.orchestration/ragents-bundle.json +3 -3
- package/bundles/ragents.orchestration/web/classes.json +1 -1
- package/bundles/ragents.orchestration/web/index.js +1 -1
- package/bundles/ragents.orchestration/web/index.js.map +2 -2
- package/bundles/ragents.overseer/ragents-bundle.json +3 -3
- package/bundles/ragents.processes/ragents-bundle.json +3 -3
- package/bundles/ragents.product/ragents-bundle.json +3 -3
- package/bundles/ragents.profile-distribution/ragents-bundle.json +3 -3
- package/bundles/ragents.reference/ragents-bundle.json +3 -3
- package/bundles/ragents.todo/ragents-bundle.json +3 -3
- package/bundles/ragents.todo/server/index.js +0 -3
- package/bundles/ragents.todo/server/index.js.map +2 -2
- package/bundles/ragents.todo/web/classes.json +1 -1
- package/bundles/ragents.todo/web/index.js +1 -1
- package/bundles/ragents.todo/web/index.js.map +2 -2
- package/bundles/ragents.transcript/ragents-bundle.json +3 -3
- package/bundles/ragents.watch/ragents-bundle.json +3 -3
- package/bundles/ragents.workspace/ragents-bundle.json +3 -3
- package/bundles/ragents.workspace/server/index.js +4 -4
- package/bundles/ragents.workspace/server/index.js.map +2 -2
- package/bundles/ragents.workspace/web/classes.json +1 -1
- package/bundles/ragents.workspace/web/index.js +1 -1
- package/bundles/ragents.workspace/web/index.js.map +2 -2
- package/package.json +2 -2
- package/packages/ai/src/providers/openrouter.models.ts +2 -2
- package/packages/ragents/src/runtime/journal-storage.ts +1 -1
- package/packages/workspace-executor/src/contributions.ts +10 -10
- package/packages/workspace-executor/src/executor.ts +1 -1
- package/packages/workspace-executor/src/files.ts +1 -1
- package/packages/workspace-executor/src/index.ts +1 -1
- package/packages/workspace-executor/src/language-server/host.ts +1 -1
- package/packages/workspace-executor/src/language-server/workspace-solutions.ts +1 -1
- package/plugins/ragents.orchestration/web/ActorChat.tsx +1 -1
- package/plugins/ragents.orchestration/web/ActorChatControls.tsx +0 -1
- package/plugins/ragents.todo/contract.ts +0 -3
- package/plugins/ragents.workspace/client/workspace-client.ts +9 -9
- package/plugins/ragents.workspace/contract.ts +1 -1
- package/plugins/ragents.workspace/server/clients.ts +9 -9
- package/scripts/package/build-package.ts +3 -3
- package/scripts/package/ragents.mjs +1 -1
- package/scripts/remote/connect.ts +4 -4
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npm install -g @schlenkr/ragents
|
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
- `start <profile|path>` - start a profile shipped with the package (`core`, `developer`,
|
|
27
|
-
`showcase`), your own `ragents.config.<name>.ts` anywhere on disk, or a
|
|
27
|
+
`showcase`), your own `ragents.config.<name>.ts` anywhere on disk, or a revision that `connect`
|
|
28
28
|
already fetched, without asking the server. The web interface comes finished with the package,
|
|
29
29
|
the same for every profile; the web halves of the plugins load from their bundles.
|
|
30
30
|
|
|
@@ -17,10 +17,10 @@ export const accessibleRunView = (view: RunView, access: AccessContext, projecti
|
|
|
17
17
|
toolNames: [],
|
|
18
18
|
openedToolNames: [],
|
|
19
19
|
usage: emptyUsage(),
|
|
20
|
-
lifecycle: actor.lifecycle.kind === "stopped" ? { ...actor.lifecycle, reason: "
|
|
20
|
+
lifecycle: actor.lifecycle.kind === "stopped" ? { ...actor.lifecycle, reason: "Stopped" } : actor.lifecycle,
|
|
21
21
|
}),
|
|
22
22
|
inputs: view.inputs.map((input) => ({ ...input, content: input.enqueuedBy === view.ownerId && input.presentation !== "background" ? input.content : "",
|
|
23
|
-
lifecycle: input.lifecycle.kind === "discarded" ? { ...input.lifecycle, reason: "
|
|
23
|
+
lifecycle: input.lifecycle.kind === "discarded" ? { ...input.lifecycle, reason: "Discarded" } : input.lifecycle,
|
|
24
24
|
})),
|
|
25
25
|
turns: view.turns.map((turn) => ({ ...turn, usage: emptyUsage(), toolCalls: [], reason: turn.reason ? "Processing was stopped." : null })),
|
|
26
26
|
subscriptions: [],
|
|
@@ -12,8 +12,8 @@ import { checkedHostApiRecord, hostRoot, type HostApiRecord } from "../host-vers
|
|
|
12
12
|
import {
|
|
13
13
|
BUNDLE_FORMAT,
|
|
14
14
|
BUNDLE_MANIFEST_FILE,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
bundleRevision,
|
|
16
|
+
sourceRevisionOf,
|
|
17
17
|
type BundleManifest,
|
|
18
18
|
type HostNames,
|
|
19
19
|
} from "../profile/bundle-manifest.js";
|
|
@@ -537,8 +537,8 @@ const buildPlugin = async (folder: string, environment: BuildEnvironment, typeEr
|
|
|
537
537
|
server: hostNamesOf(serverImports.flatMap((imports) => imports.names)),
|
|
538
538
|
web: hostNamesOf(web ? webHostNames(web.metafile) : []),
|
|
539
539
|
},
|
|
540
|
-
|
|
541
|
-
|
|
540
|
+
revision: bundleRevision(staging),
|
|
541
|
+
sourceRevision: sourceRevisionOf(source.folder, [realpathSync.native(environment.out)], environment.root),
|
|
542
542
|
server: "server/index.js",
|
|
543
543
|
...(webEntry ? {
|
|
544
544
|
web: {
|
|
@@ -589,8 +589,8 @@ const bundleIsCurrent = (folder: string, out: string, root = hostRoot()): boolea
|
|
|
589
589
|
if (!existsSync(file)) return false;
|
|
590
590
|
const manifest = JSON.parse(readFileSync(file, "utf8")) as Partial<BundleManifest>;
|
|
591
591
|
return manifest.format === BUNDLE_FORMAT && manifest.api === HOST_API_VERSION
|
|
592
|
-
&& manifest.
|
|
593
|
-
&& manifest.
|
|
592
|
+
&& manifest.sourceRevision === sourceRevisionOf(folder, [realpathSync.native(out)], root)
|
|
593
|
+
&& manifest.revision === bundleRevision(bundle);
|
|
594
594
|
};
|
|
595
595
|
|
|
596
596
|
/** Builds each plugin folder into <out>/<id>; a failing plugin does not stop the others, and parallel builds into the same folder wait for each other. */
|
|
@@ -603,7 +603,7 @@ export const buildPlugins = async (folders: readonly string[], options: PluginBu
|
|
|
603
603
|
const typeProblems = options.typecheck ? typecheckPlugins(chosen, context.root) : new Map<string, readonly string[]>();
|
|
604
604
|
const outcomes: PluginBuildOutcome[] = [];
|
|
605
605
|
for (const source of chosen) {
|
|
606
|
-
const typeErrors = (typeProblems.get(source.description.id) ?? []).map((problem) => `
|
|
606
|
+
const typeErrors = (typeProblems.get(source.description.id) ?? []).map((problem) => `Types: ${problem}`);
|
|
607
607
|
outcomes.push(await buildPlugin(source.folder, environmentOf(context, folders), typeErrors));
|
|
608
608
|
}
|
|
609
609
|
return outcomes;
|
|
@@ -10,7 +10,7 @@ import { isCheckout } from "../host-web.js";
|
|
|
10
10
|
import { bundlesRoot, pluginIdOf } from "../plugin-support/plugins-root.js";
|
|
11
11
|
|
|
12
12
|
export const BUNDLE_MANIFEST_FILE = "ragents-bundle.json";
|
|
13
|
-
export const BUNDLE_FORMAT =
|
|
13
|
+
export const BUNDLE_FORMAT = 5;
|
|
14
14
|
|
|
15
15
|
/** The value names a half imports from each module of the host API. */
|
|
16
16
|
export type HostNames = Readonly<Record<string, readonly string[]>>;
|
|
@@ -23,9 +23,9 @@ export interface BundleManifest {
|
|
|
23
23
|
/** The names of the host API the bundle uses, per half; a host that lacks one refuses the bundle. */
|
|
24
24
|
readonly hostNames: Readonly<Record<HostApiHalf, HostNames>>;
|
|
25
25
|
/** A hash over every file of the bundle; copies and the build tool check it. */
|
|
26
|
-
readonly
|
|
26
|
+
readonly revision: string;
|
|
27
27
|
/** A hash over the source folder and the host inputs of the build; a checkout compares it with its built-in plugins. */
|
|
28
|
-
readonly
|
|
28
|
+
readonly sourceRevision: string;
|
|
29
29
|
readonly server: string;
|
|
30
30
|
readonly web?: { readonly entry: string; readonly css?: string; readonly classes: string };
|
|
31
31
|
/** The contribution to every executor, a self-contained file that any Node process loads. */
|
|
@@ -35,7 +35,7 @@ export interface BundleManifest {
|
|
|
35
35
|
readonly assets: readonly string[];
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const MANIFEST_KEYS = new Set(["format", "id", "api", "hostNames", "
|
|
38
|
+
const MANIFEST_KEYS = new Set(["format", "id", "api", "hostNames", "revision", "sourceRevision", "server", "web", "executor", "exports", "uses", "assets"]);
|
|
39
39
|
const SOURCE_MARKERS = ["ragents-plugin.json", "server/index.ts", "server/index.tsx"];
|
|
40
40
|
|
|
41
41
|
const isRecord = (value: unknown): value is Record<string, unknown> =>
|
|
@@ -98,7 +98,7 @@ const buildInputsOf = (root: string): readonly string[] => [
|
|
|
98
98
|
];
|
|
99
99
|
|
|
100
100
|
/** A hash over every file of a plugin source folder except dependencies and the given output folders, together with the build inputs of the host. */
|
|
101
|
-
export const
|
|
101
|
+
export const sourceRevisionOf = (folder: string, skipped: readonly string[] = [], root = hostRoot()): string => {
|
|
102
102
|
const hash = createHash("sha256");
|
|
103
103
|
for (const relative of sourceFiles(folder, new Set(skipped))) hash.update(`${relative}\0${fileDigest(path.join(folder, relative))}\n`);
|
|
104
104
|
for (const input of buildInputsOf(root)) hash.update(`host:${input}\0${fileDigest(path.join(root, input))}\n`);
|
|
@@ -106,7 +106,7 @@ export const sourceStandOf = (folder: string, skipped: readonly string[] = [], r
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
/** A hash over every file of the bundle except its manifest and what Finder leaves behind, stable across machines. */
|
|
109
|
-
export const
|
|
109
|
+
export const bundleRevision = (folder: string): string => {
|
|
110
110
|
const hash = createHash("sha256");
|
|
111
111
|
const files = filesBelow(folder).filter((name) => name !== BUNDLE_MANIFEST_FILE && path.posix.basename(name) !== ".DS_Store");
|
|
112
112
|
for (const relative of files) hash.update(`${relative}\0${fileDigest(path.join(folder, relative))}\n`);
|
|
@@ -114,9 +114,9 @@ export const bundleStand = (folder: string): string => {
|
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
/** A copy of a bundle, from a package or an archive, must carry exactly the files it was built with. */
|
|
117
|
-
export const
|
|
118
|
-
if (
|
|
119
|
-
throw new Error(`The bundle ${manifest.id} in ${folder} no longer has the files it was built with (
|
|
117
|
+
export const assertBundleRevision = (folder: string, manifest: Pick<BundleManifest, "id" | "revision">): void => {
|
|
118
|
+
if (bundleRevision(folder) !== manifest.revision) {
|
|
119
|
+
throw new Error(`The bundle ${manifest.id} in ${folder} no longer has the files it was built with (revision); ${rebuildHint(folder)}`);
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
|
|
@@ -166,8 +166,8 @@ export const readBundleManifest = (folder: string): BundleManifest => {
|
|
|
166
166
|
if (unknown.length > 0) throw new Error(`${file}: unknown fields ${unknown.join(", ")}; ${rebuildHint(folder)}`);
|
|
167
167
|
const malformed = [
|
|
168
168
|
...(isHostNames(raw.hostNames) ? [] : ["hostNames"]),
|
|
169
|
-
...(typeof raw.
|
|
170
|
-
...(typeof raw.
|
|
169
|
+
...(typeof raw.revision === "string" ? [] : ["revision"]),
|
|
170
|
+
...(typeof raw.sourceRevision === "string" ? [] : ["sourceRevision"]),
|
|
171
171
|
...(typeof raw.server === "string" ? [] : ["server"]),
|
|
172
172
|
...(isWeb(raw.web) ? [] : ["web"]),
|
|
173
173
|
...(raw.executor === undefined || raw.executor === EXECUTOR_CONTRIBUTION_FILE ? [] : ["executor"]),
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
pluginsRoot,
|
|
15
15
|
registerPluginFolder,
|
|
16
16
|
} from "../plugin-support/plugins-root.js";
|
|
17
|
-
import { assertHostNames, BUNDLE_MANIFEST_FILE, isBuiltInBundle, readBundleManifest,
|
|
17
|
+
import { assertHostNames, BUNDLE_MANIFEST_FILE, isBuiltInBundle, readBundleManifest, sourceRevisionOf, type BundleManifest } from "./bundle-manifest.js";
|
|
18
18
|
|
|
19
19
|
/** The built-in bundles; build folders of the build tool start with a dot and do not count. */
|
|
20
20
|
export const discoverPluginIds = (root = bundlesRoot): readonly string[] => {
|
|
@@ -77,7 +77,7 @@ export const webAddressesOf = (plugin: ResolvedPlugin): PluginWebAddresses | und
|
|
|
77
77
|
export const staleBuiltInBundles = (plugins: readonly ResolvedPlugin[], sources = pluginsRoot, root = bundlesRoot): readonly string[] =>
|
|
78
78
|
plugins.filter((plugin) => isBuiltInBundle(plugin.folder, root)
|
|
79
79
|
&& existsSync(path.join(sources, plugin.id, "ragents-plugin.json"))
|
|
80
|
-
&&
|
|
80
|
+
&& sourceRevisionOf(path.join(sources, plugin.id)) !== plugin.manifest.sourceRevision)
|
|
81
81
|
.map((plugin) => plugin.id);
|
|
82
82
|
|
|
83
83
|
const assertUsesInProfile = (plugins: readonly ResolvedPlugin[]): void => {
|
|
@@ -797,7 +797,7 @@ export class RunSessionProvider implements ChatSessionProvider {
|
|
|
797
797
|
const ids: string[] = [];
|
|
798
798
|
|
|
799
799
|
for (const entry of entries) {
|
|
800
|
-
if (!entry.isDirectory()
|
|
800
|
+
if (!entry.isDirectory()) continue;
|
|
801
801
|
if (!isRunId(entry.name)) throw new Error(`Invalid run archive: ${entry.name}`);
|
|
802
802
|
ids.push(entry.name);
|
|
803
803
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,S as d,E as p,j as E,c as f}from"./mermaid-HWGCJPDP-
|
|
1
|
+
import{r,S as d,E as p,j as E,c as f}from"./mermaid-HWGCJPDP-q-mf1kLN.js";var j=({code:i,language:e,maxHeight:o,raw:a,className:u,startLine:m,lineNumbers:n,...h})=>{let{shikiTheme:l}=r.useContext(d),t=p(),[c,s]=r.useState(a);return r.useEffect(()=>{if(!t){s(a);return}let g=t.highlight({code:i,language:e,themes:l},x=>{s(x)});g&&s(g)},[i,e,l,t,a]),E.jsx(f,{className:u,language:e,lineNumbers:n,maxHeight:o,result:c,startLine:m,...h})};export{j as HighlightedCodeBlockBody};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as le,r as t,j as e,D as ce,b as de,d as G,B as b,X as Me,M as Pe,C as ue,e as Le,f as Ie,g as _e,h as He,u as Be,i as Ue,k as Fe,l as qe,m as Te,A as Ke,n as $e,o as We,U as Qe,P as Ve,W as Ge,R as Xe,p as re,q as V,s as Ye,t as Je,v as Ze,w as et,x as tt,y as st,z as nt,Q as at,F as rt,G as ot}from"./mermaid-HWGCJPDP-
|
|
1
|
+
import{a as le,r as t,j as e,D as ce,b as de,d as G,B as b,X as Me,M as Pe,C as ue,e as Le,f as Ie,g as _e,h as He,u as Be,i as Ue,k as Fe,l as qe,m as Te,A as Ke,n as $e,o as We,U as Qe,P as Ve,W as Ge,R as Xe,p as re,q as V,s as Ye,t as Je,v as Ze,w as et,x as tt,y as st,z as nt,Q as at,F as rt,G as ot}from"./mermaid-HWGCJPDP-q-mf1kLN.js";/**
|
|
2
2
|
* @license lucide-react v1.46.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -356,7 +356,7 @@ ${e}</tr>
|
|
|
356
356
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${mo(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=VD(e);if(i===null)return r;e=i;let a='<a href="'+e+'"';return t&&(a+=' title="'+mo(t)+'"'),a+=">"+r+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=VD(e);if(i===null)return mo(n);e=i;let a=`<img src="${e}" alt="${mo(n)}"`;return t&&(a+=` title="${mo(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:mo(e.text)}},rk=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},qs=class Pw{constructor(t){pt(this,"options");pt(this,"renderer");pt(this,"textRenderer");this.options=t||Ad,this.options.renderer=this.options.renderer||new A1,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new rk}static parse(t,n){return new Pw(n).parse(t)}static parseInline(t,n){return new Pw(n).parseInline(t)}parse(t){var r,i;this.renderer.parser=this;let n="";for(let a=0;a<t.length;a++){let o=t[a];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[o.type]){let u=o,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){n+=d||"";continue}}let c=o;switch(c.type){case"space":{n+=this.renderer.space(c);break}case"hr":{n+=this.renderer.hr(c);break}case"heading":{n+=this.renderer.heading(c);break}case"code":{n+=this.renderer.code(c);break}case"table":{n+=this.renderer.table(c);break}case"blockquote":{n+=this.renderer.blockquote(c);break}case"list":{n+=this.renderer.list(c);break}case"checkbox":{n+=this.renderer.checkbox(c);break}case"html":{n+=this.renderer.html(c);break}case"def":{n+=this.renderer.def(c);break}case"paragraph":{n+=this.renderer.paragraph(c);break}case"text":{n+=this.renderer.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(t,n=this.renderer){var i,a;this.renderer.parser=this;let r="";for(let o=0;o<t.length;o++){let c=t[o];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[c.type]){let d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=d||"";continue}}let u=c;switch(u.type){case"escape":{r+=n.text(u);break}case"html":{r+=n.html(u);break}case"link":{r+=n.link(u);break}case"image":{r+=n.image(u);break}case"checkbox":{r+=n.checkbox(u);break}case"strong":{r+=n.strong(u);break}case"em":{r+=n.em(u);break}case"codespan":{r+=n.codespan(u);break}case"br":{r+=n.br(u);break}case"del":{r+=n.del(u);break}case"text":{r+=n.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return r}},yb,Dh=(yb=class{constructor(e){pt(this,"options");pt(this,"block");this.options=e||Ad}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Ss.lex:Ss.lexInline}provideParser(e=this.block){return e?qs.parse:qs.parseInline}},pt(yb,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),pt(yb,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),yb),YSe=class{constructor(...t){pt(this,"defaults",WC());pt(this,"options",this.setOptions);pt(this,"parse",this.parseMarkdown(!0));pt(this,"parseInline",this.parseMarkdown(!1));pt(this,"Parser",qs);pt(this,"Renderer",A1);pt(this,"TextRenderer",rk);pt(this,"Lexer",Ss);pt(this,"Tokenizer",S1);pt(this,"Hooks",Dh);this.use(...t)}walkTokens(t,n){var i,a;let r=[];for(let o of t)switch(r=r.concat(n.call(this,o)),o.type){case"table":{let c=o;for(let u of c.header)r=r.concat(this.walkTokens(u.tokens,n));for(let u of c.rows)for(let d of u)r=r.concat(this.walkTokens(d.tokens,n));break}case"list":{let c=o;r=r.concat(this.walkTokens(c.items,n));break}default:{let c=o;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);r=r.concat(this.walkTokens(d,n))}):c.tokens&&(r=r.concat(this.walkTokens(c.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let o=n.renderers[a.name];o?n.renderers[a.name]=function(...c){let u=a.renderer.apply(this,c);return u===!1&&(u=o.apply(this,c)),u}:n.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[a.level];o?o.unshift(a.tokenizer):n[a.level]=[a.tokenizer],a.start&&(a.level==="block"?n.startBlock?n.startBlock.push(a.start):n.startBlock=[a.start]:a.level==="inline"&&(n.startInline?n.startInline.push(a.start):n.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(n.childTokens[a.name]=a.childTokens)}),i.extensions=n),r.renderer){let a=this.defaults.renderer||new A1(this.defaults);for(let o in r.renderer){if(!(o in a))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let c=o,u=r.renderer[c],d=a[c];a[c]=(...p)=>{let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h||""}}i.renderer=a}if(r.tokenizer){let a=this.defaults.tokenizer||new S1(this.defaults);for(let o in r.tokenizer){if(!(o in a))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let c=o,u=r.tokenizer[c],d=a[c];a[c]=(...p)=>{let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.tokenizer=a}if(r.hooks){let a=this.defaults.hooks||new Dh;for(let o in r.hooks){if(!(o in a))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let c=o,u=r.hooks[c],d=a[c];Dh.passThroughHooks.has(o)?a[c]=p=>{if(this.defaults.async&&Dh.passThroughHooksRespectAsync.has(o))return(async()=>{let y=await u.call(a,p);return d.call(a,y)})();let h=u.call(a,p);return d.call(a,h)}:a[c]=(...p)=>{if(this.defaults.async)return(async()=>{let y=await u.apply(a,p);return y===!1&&(y=await d.apply(a,p)),y})();let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.hooks=a}if(r.walkTokens){let a=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(c){let u=[];return u.push(o.call(this,c)),a&&(u=u.concat(a.call(this,c))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Ss.lex(t,n??this.defaults)}parser(t,n){return qs.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},a={...this.defaults,...i},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let c=a.hooks?await a.hooks.preprocess(n):n,u=await(a.hooks?await a.hooks.provideLexer(t):t?Ss.lex:Ss.lexInline)(c,a),d=a.hooks?await a.hooks.processAllTokens(u):u;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let p=await(a.hooks?await a.hooks.provideParser(t):t?qs.parse:qs.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(p):p})().catch(o);try{a.hooks&&(n=a.hooks.preprocess(n));let c=(a.hooks?a.hooks.provideLexer(t):t?Ss.lex:Ss.lexInline)(n,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let u=(a.hooks?a.hooks.provideParser(t):t?qs.parse:qs.parseInline)(c,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(c){return o(c)}}}onError(t,n){return r=>{if(r.message+=`
|
|
357
357
|
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+mo(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},dd=new YSe;function vr(e,t){return dd.parse(e,t)}vr.options=vr.setOptions=function(e){return dd.setOptions(e),vr.defaults=dd.defaults,oU(vr.defaults),vr};vr.getDefaults=WC;vr.defaults=Ad;vr.use=function(...e){return dd.use(...e),vr.defaults=dd.defaults,oU(vr.defaults),vr};vr.walkTokens=function(e,t){return dd.walkTokens(e,t)};vr.parseInline=dd.parseInline;vr.Parser=qs;vr.parser=qs.parse;vr.Renderer=A1;vr.TextRenderer=rk;vr.Lexer=Ss;vr.lexer=Ss.lex;vr.Tokenizer=S1;vr.Hooks=Dh;vr.parse=vr;vr.options;vr.setOptions;vr.use;vr.walkTokens;vr.parseInline;qs.parse;Ss.lex;var WSe=300,XSe="300px",QSe=500;function ZSe(e={}){let{immediate:t=!1,debounceDelay:n=WSe,rootMargin:r=XSe,idleTimeout:i=QSe}=e,[a,o]=x.useState(!1),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),p=x.useMemo(()=>b=>{let v=Date.now();return window.setTimeout(()=>{b({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),h=x.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(b,v)=>window.requestIdleCallback(b,v):p,[p]),y=x.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?b=>window.cancelIdleCallback(b):b=>{clearTimeout(b)},[]);return x.useEffect(()=>{if(t){o(!0);return}let b=c.current;if(!b)return;u.current&&(clearTimeout(u.current),u.current=null),d.current&&(y(d.current),d.current=null);let v=()=>{u.current&&(clearTimeout(u.current),u.current=null),d.current&&(y(d.current),d.current=null)},T=C=>{d.current=h(R=>{R.timeRemaining()>0||R.didTimeout?(o(!0),C.disconnect()):d.current=h(()=>{o(!0),C.disconnect()},{timeout:i/2})},{timeout:i})},A=C=>{v(),u.current=window.setTimeout(()=>{var R,O;let N=C.takeRecords();(N.length===0||(O=(R=N.at(-1))==null?void 0:R.isIntersecting)!=null&&O)&&T(C)},n)},w=(C,R)=>{C.isIntersecting?A(R):v()},k=new IntersectionObserver(C=>{for(let R of C)w(R,k)},{rootMargin:r,threshold:0});return k.observe(b),()=>{u.current&&clearTimeout(u.current),d.current&&y(d.current),k.disconnect()}},[t,n,r,i,y,h]),{shouldRender:a,containerRef:c}}var JSe=320,eAe=4,bU=()=>typeof performance>"u"?Date.now():performance.now();function YD(e){var t,n;let r=(t=e==null?void 0:e.now)!=null?t:bU,i=(n=e==null?void 0:e.maxBacklogMs)!=null?n:JSe,a=0,o=0;return{now:r,beginPass(c){o=Math.min(Math.max(a,c),c+i)},mark(){return o},rewind(c){o=c},take(c,u,d){if(c<=0)return{baseDelay:0,step:Math.max(0,u)};let p=Math.max(0,u),h=p===0?0:Math.min(p,eAe),y=Math.max(o,d),b=d+i,v=y+Math.max(0,c-1)*p,T=p;if(v>b&&c>1)if(y<b){let w=b-y;T=Math.max(h,w/(c-1))}else T=h;let A=Math.max(0,Math.round(y-d));return o=y+c*T,{baseDelay:A,step:T}},commitPass(){a=o}}}var yU=/\s/,ik=/^\s+$/,tAe=new Set(["pre","svg","math","annotation"]),nAe=new Set(["img","hr"]),Sg=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",ak=e=>e.some(t=>Sg(t)&&tAe.has(t.tagName)),rAe=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(Sg(n)&&n.tagName==="li")return n}},iAe=(e,t,n,r)=>{e.properties!=null||(e.properties={}),e.properties["data-sd-animate-marker"]=!0;let i=typeof e.properties.style=="string"?`${e.properties.style};`:"";e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(n)}ms;--sd-marker-easing:${r}`},aAe=new Set(["ul","ol","li"]),xU=e=>{for(let t of e.children)if(Sg(t)){if(t.tagName==="input")return t;if(aAe.has(t.tagName))continue;let n=xU(t);if(n)return n}},vU=(e,t,n,r)=>{e.properties!=null||(e.properties={}),e.properties["data-sd-animate"]=!0;let i=typeof e.properties.style=="string"?`${e.properties.style};`:"";e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${n}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(r)}ms`},sAe=(e,t,n,r)=>{let i=xU(e);i&&vU(i,t,n,r)},oAe=(e,t,n,r,i,a)=>{if(ak(t))return;let o=r.prevContentLength,c=i.count;i.count+=1;let u=o>0&&c<o,d=u?0:a.baseDelay+i.newIndex++*a.step;vU(e,n,u?0:n.duration,d)},lAe=e=>{var t;for(let n=e.length-1;n>=0;n-=1){let r=e[n];if(Sg(r)){if((t=r.properties)!=null&&t["data-sd-animated"])break;r.properties={...r.properties,"data-sd-animated":!0}}}},EU=e=>{let t=[],n="",r=!1;for(let i of e){let a=yU.test(i);if(a!==r&&n){if(a){n+=i,r=!0;continue}t.push(n),n=""}n+=i,r=a}return n&&t.push(n),t},TU=e=>{let t=[],n="";for(let r of e)yU.test(r)?t.length>0&&!ik.test(t.at(-1))?t[t.length-1]+=r:n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&(t.length>0?t[t.length-1]+=n:t.push(n)),t},cAe=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${Math.round(a)}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:o},children:[{type:"text",value:e}]}},WD=(e,t)=>!(e>0&&t<e),jw=e=>Sg(e)&&nAe.has(e.tagName),uAe=(e,t,n)=>{let r=0,i=0;return yx(e,a=>a.type==="text"||jw(a),(a,o)=>{if(ak(o))return Bu;if(jw(a)){WD(n,i)&&(r+=1),i+=1;return}let c=a.value;if(!c.trim()){i+=c.length;return}let u=t.sep==="char"?TU(c):EU(c);for(let d of u){let p=i;i+=d.length,!ik.test(d)&&WD(n,p)&&(r+=1)}}),r},dAe=(e,t,n,r,i,a)=>{var o;let c=t.at(-1);if(!(c&&"children"in c))return;if(ak(t))return Bu;let u=c,d=u.children.indexOf(e);if(d===-1)return;let p=e.value;if(!p.trim()){i.count+=p.length;return}let h=n.sep==="char"?TU(p):EU(p),y=r.prevContentLength,b=!1,v=rAe(t),T=!!(v&&!((o=v.properties)!=null&&o["data-sd-animate-marker"])),A=!1,w=h.map(k=>{let C=i.count;if(i.count+=k.length,ik.test(k))return{type:"text",value:k};let R=y>0&&C<y,O=R?0:a.baseDelay+i.newIndex++*a.step;if(b=!0,v&&T&&!A){let N=R?0:n.duration;iAe(v,N,O,n.easing),sAe(v,n,N,O),A=!0}return cAe(k,n.animation,n.duration,n.easing,R,O)});return b&&lAe(t),u.children.splice(d,1,...w),d+w.length},fAe=0;function wU(e){var t,n,r,i,a;let o={animation:(t=e==null?void 0:e.animation)!=null?t:"fadeIn",duration:(n=e==null?void 0:e.duration)!=null?n:150,easing:(r=e==null?void 0:e.easing)!=null?r:"ease",sep:(i=e==null?void 0:e.sep)!=null?i:"word",stagger:(a=e==null?void 0:e.stagger)!=null?a:40,timeline:e==null?void 0:e.timeline},c={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},u=fAe++,d=()=>p=>{var h;let y={count:0,newIndex:0};c.prevContentLength=c.committedCharCount;let b=o.timeline,v=(h=b==null?void 0:b.now())!=null?h:bU();b&&(c.pendingMark===null?c.pendingMark=b.mark():b.rewind(c.pendingMark));let T=b?b.take(uAe(p,o,c.prevContentLength),o.stagger,v):{baseDelay:0,step:o.stagger};yx(p,A=>A.type==="text"||jw(A),(A,w)=>{if(A.type==="text")return dAe(A,w,o,c,y,T);oAe(A,w,o,c,y,T)}),c.lastRenderCharCount=y.count,c.prevContentLength=0};return Object.defineProperty(d,"name",{value:`rehypeAnimate$${u}`}),{name:"animate",type:"animate",rehypePlugin:d,setPrevContentLength(p){c.committedCharCount=p,c.prevContentLength=p},getLastRenderCharCount(){return c.lastRenderCharCount},commit(){c.committedCharCount=c.lastRenderCharCount,c.pendingMark=null}}}wU();var SU=x.createContext(!1),pAe=()=>x.useContext(SU),Ox=(...e)=>Xz(mS(e)),hAe=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},mAe=e=>e?(...t)=>hAe(e,Xz(mS(t))):Ox,Rf=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",i=typeof t=="string"?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement("a");o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},$w=x.createContext(Ox),wn=()=>x.useContext($w),gAe=8,AU=e=>{if(!(e===void 0||e===0||e===Number.POSITIVE_INFINITY)){if(typeof e=="number")return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(!(e==="0"||e==="none"||e==="Infinity"))return e}},_U=(e,t,n)=>{let r=x.useRef(null),i=x.useRef(!0),a=x.useRef(!1);return x.useEffect(()=>{let o=r.current;if(!(o&&t))return;let c=()=>{let u=o.scrollHeight-o.scrollTop-o.clientHeight<gAe;i.current=u};return o.addEventListener("scroll",c,{passive:!0}),()=>o.removeEventListener("scroll",c)},[t]),x.useEffect(()=>{e&&!a.current&&(i.current=!0),e||(i.current=!0),a.current=e},[e]),x.useEffect(()=>{let o=r.current;o&&t&&e&&i.current&&o.scrollTo({top:o.scrollHeight,behavior:"instant"})},[e,t,n]),r},bAe=Ox("block"),yAe=Ox("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),xAe=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let i=n.slice(0,r).trim(),a=n.slice(r+1).trim();i&&a&&(t[i]=a)}}return t},vAe=x.memo(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:o=!0,...c})=>{let u=wn(),{isAnimating:d}=x.useContext(Yi),p=AU(i),h=_U(d,!!p,t),y=x.useMemo(()=>u(yAe),[u]),b=x.useMemo(()=>u(bAe),[u]),v=x.useMemo(()=>{let T={};return t.bg&&(T["--sdm-bg"]=t.bg),t.fg&&(T["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(T,xAe(t.rootStyle)),T},[t.bg,t.fg,t.rootStyle]);return m.jsx("div",{className:u(r,p?"overflow-y-auto":null,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",ref:h,style:p?{maxHeight:p}:void 0,...c,children:m.jsx("pre",{className:u(r,"bg-[var(--sdm-bg,inherit)]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]"),style:v,children:m.jsx("code",{className:o?u("[counter-increment:line_0] [counter-reset:line]"):void 0,style:o&&a&&a>1?{counterReset:`line ${a-1}`}:void 0,children:t.tokens.map((T,A)=>m.jsx("span",{className:o?y:b,children:T.length===0||T.length===1&&T[0].content===""?`
|
|
358
358
|
`:T.map((w,k)=>{let C={},R=!!w.bgColor;if(w.color&&(C["--sdm-c"]=w.color),w.bgColor&&(C["--sdm-tbg"]=w.bgColor),w.htmlStyle)for(let[O,N]of Object.entries(w.htmlStyle))O==="color"?C["--sdm-c"]=N:O==="background-color"?(C["--sdm-tbg"]=N,R=!0):C[O]=N;return m.jsx("span",{className:u("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",R&&"bg-[var(--sdm-tbg)]",R&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:C,...w.htmlAttrs,children:w.content},k)})},A))})})})}),EAe=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=wn();return m.jsx("div",{className:a("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...i})},CU=x.createContext({code:""}),kU=()=>x.useContext(CU),TAe=({language:e})=>{let t=wn();return m.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:m.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},wAe=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
359
|
-
`;)t--;return e.slice(0,t)},SAe=x.lazy(()=>VB(()=>import("./highlighted-body-KPVGNVTW-
|
|
359
|
+
`;)t--;return e.slice(0,t)},SAe=x.lazy(()=>VB(()=>import("./highlighted-body-KPVGNVTW-CpPi6QLr.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),AAe=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...c})=>{let u=wn(),{codeBlockMaxHeight:d}=x.useContext(Yi),p=x.useMemo(()=>wAe(e),[e]),h=x.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:p.split(`
|
|
360
360
|
`).map(y=>[{content:y,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[p]);return m.jsx(CU.Provider,{value:{code:e},children:m.jsxs(EAe,{dir:"ltr",isIncomplete:i,language:t,children:[m.jsx(TAe,{language:t}),r?m.jsx("div",{className:u("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:m.jsx("div",{className:u("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,m.jsx(x.Suspense,{fallback:m.jsx(vAe,{className:n,language:t,lineNumbers:o,maxHeight:d,result:h,startLine:a,...c}),children:m.jsx(SAe,{className:n,code:p,language:t,lineNumbers:o,maxHeight:d,raw:h,startLine:a,...c})})]})})},_Ae=e=>m.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),CAe=e=>m.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),kAe=e=>m.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),NAe=e=>m.jsxs("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[m.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),m.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),RAe=e=>m.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),OAe=e=>m.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),IAe=e=>m.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),MAe=e=>m.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),DAe=e=>m.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),LAe=e=>m.jsx("svg",{"aria-hidden":"true",color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:m.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Lh={CheckIcon:_Ae,CopyIcon:CAe,DownloadIcon:kAe,ExternalLinkIcon:MAe,Loader2Icon:NAe,Maximize2Icon:RAe,RotateCcwIcon:OAe,XIcon:IAe,ZoomInIcon:DAe,ZoomOutIcon:LAe},NU=x.createContext(Lh),PAe=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>e[i]===t[i])},XD=({icons:e,children:t})=>{let n=x.useRef(e),r=x.useRef(e?{...Lh,...e}:Lh);PAe(n.current,e)||(n.current=e,r.current=e?{...Lh,...e}:Lh);let i=r.current;return m.jsx(NU.Provider,{value:i,children:t})},ro=()=>x.useContext(NU),RU={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",zoomIn:"Zoom in",zoomOut:"Zoom out",resetView:"Reset zoom and pan",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},Bw=x.createContext(RU),Uo=()=>x.useContext(Bw),Fw=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let c=wn(),[u,d]=x.useState(!1),p=x.useRef(0),{code:h}=kU(),{isAnimating:y}=x.useContext(Yi),b=Uo(),v=a??h,T=async()=>{var k;if(typeof window>"u"||!((k=navigator==null?void 0:navigator.clipboard)!=null&&k.writeText)){t==null||t(new Error("Clipboard API not available"));return}try{u||(await navigator.clipboard.writeText(v),d(!0),e==null||e(),p.current=window.setTimeout(()=>d(!1),n))}catch(C){t==null||t(C)}};x.useEffect(()=>()=>{window.clearTimeout(p.current)},[]);let A=ro(),w=u?A.CheckIcon:A.CopyIcon;return m.jsxs(m.Fragment,{children:[m.jsx("button",{"aria-label":b.copyCode,className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:y,onClick:T,title:b.copyCode,type:"button",...o,children:r??m.jsx(w,{"aria-hidden":"true",size:14})}),u&&m.jsx("output",{"aria-live":"polite",className:"sr-only",children:b.copied})]})},sk=(e,t,n)=>{if(typeof e=="boolean")return n;let r=e[t];if(typeof r!="object")return n;let i=r.download;return typeof i!="object"?n:i.filename||n},QD={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},jAe=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let c=wn(),{code:u}=kU(),{isAnimating:d,controls:p}=x.useContext(Yi),h=Uo(),y=ro(),b=a??u,v=n&&n in QD?QD[n]:"txt",T=`${sk(p,"code","file")}.${v}`,A="text/plain",w=()=>{try{Rf(T,b,A),e==null||e()}catch(k){t==null||t(k)}};return m.jsx("button",{"aria-label":h.downloadFile,className:c("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:d,onClick:w,title:h.downloadFile,type:"button",...o,children:r??m.jsx(y.DownloadIcon,{size:14})})},ZD=()=>{let{Loader2Icon:e}=ro(),t=wn();return m.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[m.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),m.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:m.jsx(e,{className:t("size-4 animate-spin")})})]})},$Ae=/\.[^/.]+$/,BAe=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:o=!0,showDownloadControl:c=!0,...u})=>{let{DownloadIcon:d}=ro(),p=wn(),h=x.useRef(null),[y,b]=x.useState(!1),[v,T]=x.useState(!1),A=Uo(),w=u.width!=null||u.height!=null,k=(y||w)&&!v&&o&&c,C=v&&!w;x.useEffect(()=>{let I=h.current;if(I!=null&&I.complete){let L=I.naturalWidth>0;b(L),T(!L)}},[]);let R=x.useCallback(I=>{b(!0),T(!1),i==null||i(I)},[i]),O=x.useCallback(I=>{b(!1),T(!0),a==null||a(I)},[a]),N=async()=>{if(n)try{let I=await(await fetch(n)).blob(),L=new URL(n,window.location.origin).pathname.split("/").pop()||"",j=L.split(".").pop(),P=L.includes(".")&&j!==void 0&&j.length<=4,B="";if(P)B=L;else{let U=I.type,q="png";U.includes("jpeg")||U.includes("jpg")?q="jpg":U.includes("png")?q="png":U.includes("svg")?q="svg":U.includes("gif")?q="gif":U.includes("webp")&&(q="webp"),B=`${(r||L||"image").replace($Ae,"")}.${q}`}Rf(B,I,I.type)}catch{window.open(n,"_blank")}};return n?m.jsxs("div",{className:p("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[m.jsx("img",{alt:r,className:p("max-w-full rounded-lg",C&&"hidden",t),"data-streamdown":"image",onError:O,onLoad:R,ref:h,src:n,...u}),C&&m.jsx("span",{className:p("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:A.imageNotAvailable}),o&&m.jsx("div",{className:p("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"),"data-streamdown":"image-overlay"}),k&&m.jsx("button",{className:p("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:N,title:A.downloadImage,type:"button",children:m.jsx(d,{size:14})})]}):null},Xh=0,ok=()=>{Xh+=1,Xh===1&&(document.body.style.overflow="hidden")},lk=()=>{Xh=Math.max(0,Xh-1),Xh===0&&(document.body.style.overflow="")},FAe=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:c}=ro(),u=wn(),[d,p]=x.useState(!1),h=Uo(),y=x.useCallback(async()=>{try{await navigator.clipboard.writeText(e),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},[e]),b=x.useCallback(()=>{r(),n()},[r,n]);if(x.useEffect(()=>{if(t){ok();let T=A=>{A.key==="Escape"&&n()};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T),lk()}}},[t,n]),!t||typeof document>"u")return null;let v=m.jsx("div",{className:u("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:T=>{T.key==="Escape"&&n()},role:"button",tabIndex:0,children:m.jsxs("div",{className:u("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:T=>T.stopPropagation(),onKeyDown:T=>T.stopPropagation(),role:"presentation",children:[m.jsx("button",{className:u("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:h.close,type:"button",children:m.jsx(c,{size:16})}),m.jsxs("div",{className:u("flex flex-col gap-2"),children:[m.jsxs("div",{className:u("flex items-center gap-2 font-semibold text-lg"),children:[m.jsx(o,{size:20}),m.jsx("span",{children:h.openExternalLink})]}),m.jsx("p",{className:u("text-muted-foreground text-sm"),children:h.externalLinkWarning})]}),m.jsx("div",{className:u("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),m.jsxs("div",{className:u("flex gap-2"),children:[m.jsx("button",{className:u("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:y,type:"button",children:d?m.jsxs(m.Fragment,{children:[m.jsx(i,{size:14}),m.jsx("span",{children:h.copied})]}):m.jsxs(m.Fragment,{children:[m.jsx(a,{size:14}),m.jsx("span",{children:h.copyLink})]})}),m.jsxs("button",{className:u("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:b,type:"button",children:[m.jsx(o,{size:14}),m.jsx("span",{children:h.openLink})]})]})]})});return fi.createPortal(v,document.body)},zw=x.createContext(null),ck=()=>x.useContext(zw),GLe=()=>{var e;let t=ck();return(e=t==null?void 0:t.code)!=null?e:null},uk=()=>{var e;let t=ck();return(e=t==null?void 0:t.mermaid)!=null?e:null},zAe=e=>{var t;let n=ck();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},UAe=e=>{if(typeof DOMParser>"u"||typeof XMLSerializer>"u")return e;let t=new DOMParser().parseFromString(e,"text/html").querySelector("svg");return t?new XMLSerializer().serializeToString(t):e},HAe=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,a)=>{let o="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),c=new Image;c.crossOrigin="anonymous",c.onload=()=>{let u=document.createElement("canvas"),d=c.width*r,p=c.height*r;u.width=d,u.height=p;let h=u.getContext("2d");if(!h){a(new Error("Failed to create 2D canvas context for PNG export"));return}h.drawImage(c,0,0,d,p),u.toBlob(y=>{if(!y){a(new Error("Failed to create PNG blob"));return}i(y)},"image/png")},c.onerror=()=>a(new Error("Failed to load SVG image")),c.src=o})},OU=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=wn(),[c,u]=x.useState(!1),d=x.useRef(null),{isAnimating:p,controls:h}=x.useContext(Yi),y=ro(),b=uk(),v=Uo(),T=sk(h,"mermaid","diagram"),A=async w=>{try{if(w==="mmd"){let I=`${T}.mmd`;Rf(I,e,"text/plain"),u(!1),r==null||r(w);return}if(!b){a==null||a(new Error("Mermaid plugin not available"));return}let k=b.getMermaid(i),C=e.split("").reduce((I,L)=>(I<<5)-I+L.charCodeAt(0)|0,0),R=`mermaid-${Math.abs(C)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:O}=await k.render(R,e);if(!O){a==null||a(new Error("SVG not found. Please wait for the diagram to render."));return}let N=UAe(O);if(w==="svg"){let I=`${T}.svg`;Rf(I,N,"image/svg+xml"),u(!1),r==null||r(w);return}if(w==="png"){let I=await HAe(N);Rf(`${T}.png`,I,"image/png"),r==null||r(w),u(!1);return}}catch(k){a==null||a(k)}};return x.useEffect(()=>{let w=k=>{let C=k.composedPath();d.current&&!C.includes(d.current)&&u(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]),m.jsxs("div",{className:o("relative"),ref:d,children:[m.jsx("button",{"aria-label":v.downloadDiagram,className:o("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:p,onClick:()=>u(!c),title:v.downloadDiagram,type:"button",children:t??m.jsx(y.DownloadIcon,{"aria-hidden":"true",size:14})}),c?m.jsxs("div",{className:o("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[m.jsx("button",{"aria-label":v.downloadDiagramAsSvg,className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>A("svg"),title:v.downloadDiagramAsSvg,type:"button",children:v.mermaidFormatSvg}),m.jsx("button",{"aria-label":v.downloadDiagramAsPng,className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>A("png"),title:v.downloadDiagramAsPng,type:"button",children:v.mermaidFormatPng}),m.jsx("button",{"aria-label":v.downloadDiagramAsMmd,className:o("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>A("mmd"),title:v.downloadDiagramAsMmd,type:"button",children:v.mermaidFormatMmd})]}):null]})},qAe=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:c}=ro(),u=wn(),[d,p]=x.useState(!1),{isAnimating:h,controls:y}=x.useContext(Yi),b=Uo(),v=(()=>{if(typeof y=="boolean")return y;let k=y.mermaid;return k===!1?!1:k===!0||k===void 0?!0:k.panZoom!==!1})(),T=(()=>{if(typeof y=="boolean")return y;let k=y.mermaid;return k===!1?!1:k===!0||k===void 0?!0:k.download!==!1})(),A=(()=>{if(typeof y=="boolean")return y;let k=y.mermaid;return k===!1?!1:k===!0||k===void 0?!0:k.copy!==!1})(),w=()=>{p(!d)};return x.useEffect(()=>{if(d){ok();let k=C=>{C.key==="Escape"&&p(!1)};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k),lk()}}},[d]),x.useEffect(()=>{d?n==null||n():r&&r()},[d,n,r]),m.jsxs(m.Fragment,{children:[m.jsx("button",{className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:h,onClick:w,title:b.viewFullscreen,type:"button",...a,"aria-label":b.viewFullscreen,children:m.jsx(o,{"aria-hidden":"true",size:14})}),d?fi.createPortal(m.jsxs("div",{"aria-label":b.viewFullscreen,"aria-modal":"true",className:u("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),"data-streamdown":"mermaid-fullscreen",onClick:w,onKeyDown:k=>{k.key==="Escape"&&w()},role:"dialog",children:[m.jsxs("div",{className:u("absolute top-4 right-4 z-10 flex items-center gap-1"),onClick:k=>k.stopPropagation(),onKeyDown:k=>k.stopPropagation(),role:"presentation",children:[T?m.jsx(OU,{chart:e,config:t}):null,A?m.jsx(Fw,{code:e}):null,m.jsx("button",{"aria-label":b.exitFullscreen,className:u("rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:w,title:b.exitFullscreen,type:"button",children:m.jsx(c,{"aria-hidden":"true",size:20})})]}),m.jsx("div",{className:u("flex size-full items-center justify-center p-4"),onClick:k=>k.stopPropagation(),onKeyDown:k=>k.stopPropagation(),role:"presentation",children:m.jsx(b7,{chart:e,className:u("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})};function Uw(e){var t;if(e.nodeType===Node.TEXT_NODE)return(t=e.textContent)!=null?t:"";if(e.nodeType!==Node.ELEMENT_NODE)return"";let n=e;return n.tagName==="BR"?`
|
|
361
361
|
`:Array.from(n.childNodes).map(Uw).join("")}var IU=e=>{let t=[],n=[],r=e.querySelectorAll("thead th");for(let a of r)t.push(Uw(a).trim());let i=e.querySelectorAll("tbody tr");for(let a of i){let o=[],c=a.querySelectorAll("td");for(let u of c)o.push(Uw(u).trim());n.push(o)}return{headers:t,rows:n}},MU=e=>{var t;if(typeof e!="object")return",";let n=e.table;return typeof n!="object"?",":(t=n.csvSeparator)!=null?t:","},DU=(e,t=",")=>{let n;t==="auto"?Intl.NumberFormat().format(1.1).includes(",")?n=";":n=",":n=t;let{headers:r,rows:i}=e,a=d=>{let p=!1;for(let h of d)if(h===n||h==='"'||h===`
|
|
362
362
|
`||h==="\r"){p=!0;break}return p?`"${d.replace(/"/g,'""')}"`:d},o=r.length>0?i.length+1:i.length,c=new Array(o),u=0;r.length>0&&(c[u]=r.map(a).join(n),u+=1);for(let d of i)c[u]=d.map(a).join(n),u+=1;return c.join(`
|
|
@@ -579,7 +579,7 @@ ${e.frontMatter}
|
|
|
579
579
|
---
|
|
580
580
|
|
|
581
581
|
${e.content??""}`,BOe=e=>{const t=e/1e3;if(t<60)return`${t.toLocaleString("en-US")} s`;const n=t/60;return n<60?`${n.toLocaleString("en-US")} min`:`${(n/60).toLocaleString("en-US")} h`},FOe=e=>/secret|token|password|credential|api.?key|authorization|cookie/i.test(e),rS=(e,t="")=>t&&FOe(t)?"[hidden]":Array.isArray(e)?e.map(n=>rS(n)):typeof e!="object"||e===null?e:Object.fromEntries(Object.entries(e).map(([n,r])=>[n,rS(r,n)])),GL=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ho=e=>typeof e=="string"&&e.length>0,zOe=["id","owner","title","description","order","guide","tags","fixedStartOptions","action"],Na=e=>new Error(`The plugin configuration contains an invalid template: ${e}`),UOe=e=>{if(!GL(e))throw Na("not an object");if(!ho(e.id))throw Na("id is missing");const t=e.id;if(!ho(e.owner)||!ho(e.title)||!ho(e.description))throw Na(`${t}: owner, title and description are required`);if(e.order!==void 0&&typeof e.order!="number")throw Na(`${t}: order is not a number`);if(e.guide!==void 0&&!ho(e.guide))throw Na(`${t}: guide is empty`);if(e.tags!==void 0&&(!Array.isArray(e.tags)||e.tags.some(i=>!ho(i)||i!==i.trim())||new Set(e.tags).size!==e.tags.length))throw Na(`${t}: tags must be unique, non-empty keywords`);if(e.fixedStartOptions!==void 0&&(!GL(e.fixedStartOptions)||Object.keys(e.fixedStartOptions).length===0))throw Na(`${t}: fixedStartOptions must fix at least one start option`);const n={id:t,owner:e.owner,title:e.title,description:e.description,...e.order!==void 0?{order:e.order}:{},...e.guide!==void 0?{guide:e.guide}:{},...e.tags!==void 0?{tags:[...e.tags]}:{},...e.fixedStartOptions!==void 0?{fixedStartOptions:{...e.fixedStartOptions}}:{}},r=i=>{const a=Object.keys(e).filter(o=>!zOe.includes(o)&&!i.includes(o));if(a.length>0)throw Na(`${t}: unknown fields ${a.join(", ")}`)};switch(e.action){case"skill":{if(r(["skill","prompt","category"]),!ho(e.skill))throw Na(`${t}: skill is missing`);if(!ho(e.category)||!e.category.trim()||e.category!==e.category.trim())throw Na(`${t}: category must be a single non-empty text`);if(!ho(e.prompt)||!e.prompt.trim())throw Na(`${t}: prompt is missing or empty`);return{...n,action:"skill",skill:e.skill,category:e.category,prompt:e.prompt}}case"script":if(r(["coordinator","category"]),typeof e.coordinator!="boolean")throw Na(`${t}: coordinator must be true or false`);if(e.category!==void 0&&(!ho(e.category)||e.category!==e.category.trim()))throw Na(`${t}: category must be a single non-empty text`);return{...n,action:"script",coordinator:e.coordinator,...e.category!==void 0?{category:e.category}:{}};default:throw Na(`${t}: unknown action ${String(e.action)}; valid are skill and script`)}},HOe=e=>typeof e=="object"&&e!==null&&typeof e.id=="string",qOe=(e,t)=>{const n=t.webPlugin;if(!HOe(n))throw new Error(`The web entry of plugin ${e} does not export a webPlugin constant with a plugin id`);if(n.id!==e)throw new Error(`The bundle ${e} reports the different id ${n.id}`);return n},KL=(e,t,n)=>n.catch(r=>{throw new Error(`The web half of plugin ${e} does not load from ${t}: ${r instanceof Error?r.message:String(r)}`)}),VOe=async(e,t)=>{const n=e.web;if(!n)return{id:e.id};const[r]=await Promise.all([KL(e.id,n.entry,t.module(n.entry)),...n.css===void 0?[]:[KL(e.id,n.css,t.stylesheet(n.css))]]);return qOe(e.id,r)},GOe=async(e,t)=>{const n=await Promise.allSettled(e.plugins.map(o=>VOe(o,t))),r=n.flatMap((o,c)=>o.status==="rejected"?[{id:e.plugins[c].id,message:o.reason instanceof Error?o.reason.message:String(o.reason)}]:[]),i=n.map((o,c)=>o.status==="fulfilled"?o.value:{id:e.plugins[c].id}),a=new Map(e.plugins.map(o=>[o.id,o.config??{}]));try{const o=new RH({plugins:i,product:e.product,startEntries:e.startEntries,...e.defaultStartEntry===void 0?{}:{defaultStartEntry:e.defaultStartEntry}},a);return{bootstrap:e,registry:o,failures:r}}catch(o){const c=o instanceof Error?o.message:String(o);throw new Error([c,...r.map(u=>u.message)].join(`
|
|
582
|
-
`),{cause:o})}},KOe=e=>_n(e)&&typeof e.entry=="string"&&e.entry.length>0&&(e.css===void 0||typeof e.css=="string"&&e.css.length>0)&&Object.keys(e).every(t=>t==="entry"||t==="css"),YOe=e=>{if(!_n(e)||!_n(e.product)||!Array.isArray(e.plugins)||!Array.isArray(e.startEntries)||e.defaultStartEntry!==void 0&&typeof e.defaultStartEntry!="string"||typeof e.product.id!="string"||!e.product.id||typeof e.product.title!="string"||!e.product.title)throw new Error("The plugin configuration does not match the expected format");const t=e.plugins.map(n=>{if(!_n(n)||typeof n.id!="string"||!n.id||n.web!==void 0&&!KOe(n.web)||n.config!==void 0&&!_n(n.config))throw new Error("The plugin configuration contains an invalid plugin descriptor");return{id:n.id,...n.web===void 0?{}:{web:n.web},config:n.config}});return{product:{id:e.product.id,title:e.product.title},plugins:t,startEntries:e.startEntries.map(UOe),...e.defaultStartEntry===void 0?{}:{defaultStartEntry:e.defaultStartEntry}}};function QLe(){const[e,t]=x.useState({status:"loading"});return x.useEffect(()=>{const n=new AbortController;return QOe(n.signal).then(r=>{n.signal.aborted||t(r)}).catch(r=>{n.signal.aborted||t({status:"failed",error:r instanceof Error?r.message:String(r)})}),()=>n.abort()},[]),e}const YL=new Map,WOe=e=>new Promise((t,n)=>{const r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onload=()=>t(),r.onerror=()=>n(new Error(`the stylesheet ${e} is missing`)),document.head.append(r)}),XOe={module:e=>import(e),stylesheet:e=>{const t=YL.get(e)??WOe(e);return YL.set(e,t),t}},QOe=async e=>{const t=await ZOe(e);return{status:"ready",...await GOe(t,XOe)}},ZOe=async e=>YOe(await ur.call(Li.plugins.bootstrap,{},{signal:e}));function ZLe({failures:e}){return e.length===0?null:m.jsxs(Ju,{className:"flex-none rounded-none border-x-0 border-t-0","data-slot":"plugin-failures",variant:"destructive",children:[m.jsx(X6,{children:e.length===1?`The plugin ${e[0].id} failed to load`:`${e.length} plugins failed to load`}),m.jsx(ed,{children:e.map(t=>m.jsx("p",{children:t.message},t.id))})]})}const Gq="ragents.runReadRevisions:";function Kq(e){if(!e)return{};try{const t=JSON.parse(e);return _n(t)?Object.fromEntries(Object.entries(t).filter(([,n])=>Number.isSafeInteger(n)&&n>=0)):{}}catch{return{}}}const WL=$x({changeEvent:"ragents:run-read-revisions",matchesKey:e=>e.startsWith(Gq),parse:Kq,serialize:JSON.stringify});function JLe(e){const t=`${Gq}${encodeURIComponent(JSON.stringify(e??null))}`,n=WL.useValue(t),r=x.useCallback((i,a)=>{if(!Number.isSafeInteger(a)||a<0)return;const o=Kq(window.localStorage.getItem(t));a<=(o[i]??-1)||WL.save(t,{...o,[i]:a})},[t]);return{revisions:n,markViewed:r}}const JOe={Button:Er,Toggle:tg,Card:Gf,StopButton:bj,Popover:fA,PopoverContent:pA},eIe=e=>/^
|
|
582
|
+
`),{cause:o})}},KOe=e=>_n(e)&&typeof e.entry=="string"&&e.entry.length>0&&(e.css===void 0||typeof e.css=="string"&&e.css.length>0)&&Object.keys(e).every(t=>t==="entry"||t==="css"),YOe=e=>{if(!_n(e)||!_n(e.product)||!Array.isArray(e.plugins)||!Array.isArray(e.startEntries)||e.defaultStartEntry!==void 0&&typeof e.defaultStartEntry!="string"||typeof e.product.id!="string"||!e.product.id||typeof e.product.title!="string"||!e.product.title)throw new Error("The plugin configuration does not match the expected format");const t=e.plugins.map(n=>{if(!_n(n)||typeof n.id!="string"||!n.id||n.web!==void 0&&!KOe(n.web)||n.config!==void 0&&!_n(n.config))throw new Error("The plugin configuration contains an invalid plugin descriptor");return{id:n.id,...n.web===void 0?{}:{web:n.web},config:n.config}});return{product:{id:e.product.id,title:e.product.title},plugins:t,startEntries:e.startEntries.map(UOe),...e.defaultStartEntry===void 0?{}:{defaultStartEntry:e.defaultStartEntry}}};function QLe(){const[e,t]=x.useState({status:"loading"});return x.useEffect(()=>{const n=new AbortController;return QOe(n.signal).then(r=>{n.signal.aborted||t(r)}).catch(r=>{n.signal.aborted||t({status:"failed",error:r instanceof Error?r.message:String(r)})}),()=>n.abort()},[]),e}const YL=new Map,WOe=e=>new Promise((t,n)=>{const r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onload=()=>t(),r.onerror=()=>n(new Error(`the stylesheet ${e} is missing`)),document.head.append(r)}),XOe={module:e=>import(e),stylesheet:e=>{const t=YL.get(e)??WOe(e);return YL.set(e,t),t}},QOe=async e=>{const t=await ZOe(e);return{status:"ready",...await GOe(t,XOe)}},ZOe=async e=>YOe(await ur.call(Li.plugins.bootstrap,{},{signal:e}));function ZLe({failures:e}){return e.length===0?null:m.jsxs(Ju,{className:"flex-none rounded-none border-x-0 border-t-0","data-slot":"plugin-failures",variant:"destructive",children:[m.jsx(X6,{children:e.length===1?`The plugin ${e[0].id} failed to load`:`${e.length} plugins failed to load`}),m.jsx(ed,{children:e.map(t=>m.jsx("p",{children:t.message},t.id))})]})}const Gq="ragents.runReadRevisions:";function Kq(e){if(!e)return{};try{const t=JSON.parse(e);return _n(t)?Object.fromEntries(Object.entries(t).filter(([,n])=>Number.isSafeInteger(n)&&n>=0)):{}}catch{return{}}}const WL=$x({changeEvent:"ragents:run-read-revisions",matchesKey:e=>e.startsWith(Gq),parse:Kq,serialize:JSON.stringify});function JLe(e){const t=`${Gq}${encodeURIComponent(JSON.stringify(e??null))}`,n=WL.useValue(t),r=x.useCallback((i,a)=>{if(!Number.isSafeInteger(a)||a<0)return;const o=Kq(window.localStorage.getItem(t));a<=(o[i]??-1)||WL.save(t,{...o,[i]:a})},[t]);return{revisions:n,markViewed:r}}const JOe={Button:Er,Toggle:tg,Card:Gf,StopButton:bj,Popover:fA,PopoverContent:pA},eIe=e=>/^flow:(actor|input|turn|subscription|action|artifact)\/.+/.test(e);function e6e({children:e}){return m.jsx(G7,{allowUrl:eIe,components:JOe,children:e})}const Yq={"run.created":!0,"run.forked":!0,"run.primary-actor-selected":!0,"run.title-changed":!0,"agent.spawned":!0,"script.created":!0,"actor.input.enqueued":!0,"turn.started":!0,"turn.input-steered":!0,"turn.finished":!0,"turn.interrupted":!0,"model.input.presented":!0,"model.step.completed":!0,"model.tool-result.presented":!0,"context.compacted":!0,"model.output.completed":!0,"model.output.interrupted":!0,"model.reasoning.completed":!0,"runtime.output.recorded":!0,"tool.call.started":!0,"tool.call.source":!0,"tool.call.completed":!0,"tool.call.failed":!0,"actor.tools.opened":!0,"actor.stopped":!0,"actor.restarted":!0,"subscription.created":!0,"subscription.removed":!0,"subscription.failed":!0,"plugin.state-replaced":!0,"plugin.state-patched":!0,"action.proposed":!0,"action.resolved":!0,"artifact.published":!0},tIe=e=>typeof e=="string"&&Object.hasOwn(Yq,e),nIe=Object.freeze(Object.defineProperty({__proto__:null,eventTypeMap:Yq,isEventType:tIe},Symbol.toStringTag,{value:"Module"})),rIe="ragents.actor-programs",iIe="ragents.actor-programs.invocations",aIe="ragents.actor-programs.script",sIe="ragents.actor-state",oIe=(e,t)=>{const n=t.trim().toLowerCase(),r=e.flatMap(c=>c.views.map(u=>({program:c,view:u}))),i=r.filter(({program:c,view:u})=>[u.id,`${c.name}/${u.key}`,`@${c.actorHandle}/${u.key}`].some(d=>d.toLowerCase()===n)),a=i.length>0?i:r.filter(({view:c})=>c.title.toLowerCase()===n),o=c=>c.map(({program:u,view:d})=>`${u.name}/${d.key} (@${u.actorHandle}/${d.key})`).join(", ")||"none";if(a.length===0)throw new Error(`${t} is not an active actor view of this run. Activate the program first. Available: ${o(r)}`);if(a.length>1)throw new Error(`${t} is ambiguous. Use a unique name: ${o(a)}`);return a[0]},lf=Un({pattern:"^[A-Za-z0-9_-]{1,64}$",description:"Identifier of the run"}),p2=Un({pattern:"^[a-z][a-z0-9_-]{0,129}$",description:"Identifier of the actor view or the program"}),XL=Un({pattern:"^[a-z][a-z0-9-]{0,63}$",description:"Handle of the actor without @"}),QL=Un({pattern:"^[a-zA-Z][a-zA-Z0-9_-]{0,63}$",description:"Identifier of the function"}),ZL=Un({pattern:"^[A-Za-z0-9_-]{1,100}$",description:"Identifier of the function call"}),JL=Un({pattern:"^[a-f0-9]{64}$",description:"Revision of the active actor package"}),e6=Un({minLength:1,maxLength:200,description:"The caller's own identifier; repeated calls return the same call"}),t6=ba({description:"Input of the function according to its own schema"}),db=Ar("ActorFunctionInvocation"),lIe={apps:pn({id:"ragents.actor-programs.apps",description:"The actor views of a run with state and calls; the tool list stays empty without runs.inspect.",rights:["runs.read"],input:wt({runId:lf},{additionalProperties:!1}),result:wt({apps:na(Ar("ActorViewListing")),tools:na(Ar("ActorLocalTool"))},{additionalProperties:!1})}),source:pn({id:"ragents.actor-programs.source",description:"Read the source code of an actor program.",rights:["runs.read","runs.inspect"],input:wt({runId:lf,moduleId:p2},{additionalProperties:!1}),result:wt({files:na(wt({path:Un({minLength:1}),content:Un()},{additionalProperties:!1}))},{additionalProperties:!1})}),action:pn({id:"ragents.actor-programs.action",description:"Start a function of an actor view; the response is the queued call.",rights:["runs.read","runs.write"],input:wt({runId:lf,appId:p2,revision:JL,actionId:QL,requestId:e6,input:t6},{additionalProperties:!1}),result:db}),invocation:pn({id:"ragents.actor-programs.invocation",description:"Read the state of a call of an actor view.",rights:["runs.read"],input:wt({runId:lf,appId:p2,invocationId:ZL},{additionalProperties:!1}),result:db}),function:pn({id:"ragents.actor-programs.function",description:"Start a function of an actor independently of its views.",rights:["runs.read","runs.write","runs.inspect"],input:wt({runId:lf,actorHandle:XL,revision:JL,functionId:QL,requestId:e6,input:t6},{additionalProperties:!1}),result:db}),functionInvocation:pn({id:"ragents.actor-programs.function-invocation",description:"Read the state of a call of an actor function.",rights:["runs.read","runs.inspect"],input:wt({runId:lf,actorHandle:XL,invocationId:ZL},{additionalProperties:!1}),result:db})},cIe=Object.freeze(Object.defineProperty({__proto__:null,ACTOR_INVOCATIONS_STATE_ID:iIe,ACTOR_PROGRAMS_STATE_ID:rIe,ACTOR_SCRIPT_STATE_ID:aIe,ACTOR_STATE_ID:sIe,actorProgramContracts:lIe,resolveActorView:oIe},Symbol.toStringTag,{value:"Module"}));function n6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n6(Object(n),!0).forEach((function(r){iS(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n6(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function iS(e,t,n){return(t=(function(r){var i=(function(a,o){if(typeof a!="object"||a===null)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var u=c.call(a,o);if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(a)})(r,"string");return typeof i=="symbol"?i:String(i)})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hc(e,t){if(e==null)return{};var n,r,i=(function(o,c){if(o==null)return{};var u,d,p={},h=Object.keys(o);for(d=0;d<h.length;d++)u=h[d],c.indexOf(u)>=0||(p[u]=o[u]);return p})(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Mn(e,t){return Xq(e)||(function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,o,c,u,d=[],p=!0,h=!1;try{if(c=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;p=!1}else for(;!(p=(a=c.call(i)).done)&&(d.push(a.value),d.length!==r);p=!0);}catch(y){h=!0,o=y}finally{try{if(!p&&i.return!=null&&(u=i.return(),Object(u)!==u))return}finally{if(h)throw o}}return d}})(e,t)||Ux(e,t)||Zq()}function Wq(e){return Xq(e)||Qq(e)||Ux(e)||Zq()}function Qa(e){return(function(t){if(Array.isArray(t))return aS(t)})(e)||Qq(e)||Ux(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
583
583
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Xq(e){if(Array.isArray(e))return e}function Qq(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ux(e,t){if(e){if(typeof e=="string")return aS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aS(e,t):void 0}}function aS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
584
584
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ok(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ux(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
585
585
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){c=!0,a=u},f:function(){try{o||n.return==null||n.return()}finally{if(c)throw a}}}}var fb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _g(e,t){return e(t={exports:{}},t.exports),t.exports}var Xa=_g((function(e){/*!
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as U,H as D,u as G,r as o,j as e,B as k,I as Te,J as Ae,v as _e,l as ze,m as Fe,t as Me,k as Ue,P as De,G as ce,K as He,p as J,q as de,i as $e,L as ue,N as re,O as Be,T as Ve,A as oe,V as qe,Y as Je,Z as Ge,_ as Ke,s as Qe,$ as We,e as Ye,a0 as Ze,a1 as Xe,x as et,y as tt,a2 as nt,a3 as st,a4 as rt,z as ot,Q as at,a5 as it,a6 as lt,F as ct}from"./mermaid-HWGCJPDP-
|
|
1
|
+
import{a as U,H as D,u as G,r as o,j as e,B as k,I as Te,J as Ae,v as _e,l as ze,m as Fe,t as Me,k as Ue,P as De,G as ce,K as He,p as J,q as de,i as $e,L as ue,N as re,O as Be,T as Ve,A as oe,V as qe,Y as Je,Z as Ge,_ as Ke,s as Qe,$ as We,e as Ye,a0 as Ze,a1 as Xe,x as et,y as tt,a2 as nt,a3 as st,a4 as rt,z as ot,Q as at,a5 as it,a6 as lt,F as ct}from"./mermaid-HWGCJPDP-q-mf1kLN.js";/**
|
|
2
2
|
* @license lucide-react v1.46.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"apps/web/src/App.tsx": "c47d5b1c56f2ec5ac479403366d6a27160008f1247c9d85379e97d5066419091",
|
|
20
20
|
"apps/web/src/chat-view-settings.tsx": "8a8bd0a77093c0c657c401efd52143c88825b085c06b34bf37440a115e9b3ad5",
|
|
21
21
|
"apps/web/src/chat/chat-target.ts": "44303252e87f172b93194fe0c0eba84217992cb17a438cb2cd2ba00fefccf012",
|
|
22
|
-
"apps/web/src/chat/QuasselHost.tsx": "
|
|
22
|
+
"apps/web/src/chat/QuasselHost.tsx": "66b3e2f3549537b8daaf955251ae3ef8254229b92953b9583557d46c3515a486",
|
|
23
23
|
"apps/web/src/chat/requests.ts": "6aa557ea92f1dc3ea5f4de84c1adbb9f99618dc9024ea602a3609833a32e42f9",
|
|
24
24
|
"apps/web/src/chat/StoppedActorNotice.tsx": "2b1f9136d2a6a6ea6bed2b929fdae88d88e25acd5ce60ae2d405d8c68813aec3",
|
|
25
25
|
"apps/web/src/chat/useAttachmentCapabilities.ts": "ff825d07e53fe8c7ba795fbafc17d04ef45f24707c4653e28f16ed82902c79b5",
|
package/apps/web/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="stylesheet" href="/ragents.css" />
|
|
7
7
|
<title>RAgents</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/main-
|
|
9
|
-
<link rel="modulepreload" crossorigin href="/assets/mermaid-HWGCJPDP-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-DJmCHGzM.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="/assets/mermaid-HWGCJPDP-q-mf1kLN.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/mermaid-HWGCJPDP-BPn4aV2r.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="stylesheet" href="/ragents.css" />
|
|
7
7
|
<title>RAgents Panel</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/runPanel-
|
|
9
|
-
<link rel="modulepreload" crossorigin href="/assets/mermaid-HWGCJPDP-
|
|
8
|
+
<script type="module" crossorigin src="/assets/runPanel-nk_aMxSn.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="/assets/mermaid-HWGCJPDP-q-mf1kLN.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/mermaid-HWGCJPDP-BPn4aV2r.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
@@ -4,7 +4,7 @@ import { Button, Card, Popover, PopoverContent, StopButton, Toggle } from "../ui
|
|
|
4
4
|
|
|
5
5
|
const components: QuasselComponents = { Button, Toggle, Card, StopButton, Popover, PopoverContent };
|
|
6
6
|
|
|
7
|
-
const allowRunLinks = (url: string): boolean => /^
|
|
7
|
+
const allowRunLinks = (url: string): boolean => /^flow:(actor|input|turn|subscription|action|artifact)\/.+/.test(url);
|
|
8
8
|
|
|
9
9
|
/** Every chat building block below renders with the host's UI primitives and keeps the links into a run. */
|
|
10
10
|
export function QuasselHost({ children }: { children: ReactNode }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"format":
|
|
2
|
+
"format": 5,
|
|
3
3
|
"id": "ragents.activity",
|
|
4
4
|
"api": 7,
|
|
5
5
|
"hostNames": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
]
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"revision": "b7b04d050f5f4bcb0980880167b8e2cdd3ad533ba07f589dd0de471b9e55c0fd",
|
|
26
|
+
"sourceRevision": "d0f96d5406c652a4ed17f8642adfc889bb3be49fc7948f84e0f889ecb910f26e",
|
|
27
27
|
"server": "server/index.js",
|
|
28
28
|
"web": {
|
|
29
29
|
"entry": "web/index.js",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"format":
|
|
2
|
+
"format": 5,
|
|
3
3
|
"id": "ragents.actor-programs",
|
|
4
4
|
"api": 7,
|
|
5
5
|
"hostNames": {
|
|
@@ -192,8 +192,8 @@
|
|
|
192
192
|
]
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
|
-
"
|
|
196
|
-
"
|
|
195
|
+
"revision": "e25685f9ef95c00333e76e28047747da063b0367833419273d936820fbf1078a",
|
|
196
|
+
"sourceRevision": "a90150418157ee1b04b3a4c91d1502f32d2e4b7dde1924b63598df7f9ff7360b",
|
|
197
197
|
"server": "server/index.js",
|
|
198
198
|
"web": {
|
|
199
199
|
"entry": "web/index.js",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"format":
|
|
2
|
+
"format": 5,
|
|
3
3
|
"id": "ragents.ask",
|
|
4
4
|
"api": 7,
|
|
5
5
|
"hostNames": {
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
]
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"
|
|
75
|
-
"
|
|
74
|
+
"revision": "737af8ec1f32b897245fee568d26a224154eaefee949d8b01a42b6e63857a77c",
|
|
75
|
+
"sourceRevision": "baba2d362a5de24c2d31b0e55c16f333028f8547f6c09f2dcc058025ad61a75d",
|
|
76
76
|
"server": "server/index.js",
|
|
77
77
|
"web": {
|
|
78
78
|
"entry": "web/index.js",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"format":
|
|
2
|
+
"format": 5,
|
|
3
3
|
"id": "ragents.browser",
|
|
4
4
|
"api": 7,
|
|
5
5
|
"hostNames": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"web": {}
|
|
33
33
|
},
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"revision": "333c6a9b57576a4ab95556e201da67ed864acdf02787ce5edbd653e7beba6020",
|
|
35
|
+
"sourceRevision": "375fa6c75837bfa8ca23980d1d117e381a64ff823371f84ddb4e02c8c4b879db",
|
|
36
36
|
"server": "server/index.js",
|
|
37
37
|
"executor": "executor/index.mjs",
|
|
38
38
|
"exports": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"format":
|
|
2
|
+
"format": 5,
|
|
3
3
|
"id": "ragents.documents",
|
|
4
4
|
"api": 7,
|
|
5
5
|
"hostNames": {
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
]
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
|
-
"
|
|
104
|
-
"
|
|
103
|
+
"revision": "05ca6d8d04b7d78376a9726d2472099d2150a1a9e62f5999dacf88aa62a336b0",
|
|
104
|
+
"sourceRevision": "938d5980baa92e0c773c6211d146279da316f8805559e96a169292d19c536b8c",
|
|
105
105
|
"server": "server/index.js",
|
|
106
106
|
"web": {
|
|
107
107
|
"entry": "web/index.js",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"format":
|
|
2
|
+
"format": 5,
|
|
3
3
|
"id": "ragents.lsp-fsharp",
|
|
4
4
|
"api": 7,
|
|
5
5
|
"hostNames": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
]
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
31
|
+
"revision": "a39dafc264c6703d9481f358b21e5bf3997dc5d2dc7fe0d969d4905d49c7a1f8",
|
|
32
|
+
"sourceRevision": "9fcf26f814c6cedb6eebf90070ef2167d72bbb9a896f8ff263a2ebe488e50bfa",
|
|
33
33
|
"server": "server/index.js",
|
|
34
34
|
"web": {
|
|
35
35
|
"entry": "web/index.js",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"format":
|
|
2
|
+
"format": 5,
|
|
3
3
|
"id": "ragents.lsp-roslyn",
|
|
4
4
|
"api": 7,
|
|
5
5
|
"hostNames": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
"
|
|
44
|
-
"
|
|
43
|
+
"revision": "cbe81aa88a4ea56476537fabbbb0995d09ccbfa269dd6a003df50a57c8286b02",
|
|
44
|
+
"sourceRevision": "e157d2e34935c7790000759082a4091d1f6e789195f283f6530406f78e30988f",
|
|
45
45
|
"server": "server/index.js",
|
|
46
46
|
"web": {
|
|
47
47
|
"entry": "web/index.js",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"format":
|
|
2
|
+
"format": 5,
|
|
3
3
|
"id": "ragents.lsp-typescript",
|
|
4
4
|
"api": 7,
|
|
5
5
|
"hostNames": {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
]
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"revision": "8387de707a4fe8fdb8c67315346522b331728f8adf51a7fadda8db662681f0c4",
|
|
21
|
+
"sourceRevision": "fe0fb4d49e457200d447d211c6ed9ecfe807a2357701cbc2679026118965de0a",
|
|
22
22
|
"server": "server/index.js",
|
|
23
23
|
"web": {
|
|
24
24
|
"entry": "web/index.js",
|