@hanzo/dev 4.0.1 → 4.1.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/LICENSE +21 -0
- package/dist/{BinaryViewer-qn8xfPZp.js → BinaryViewer-CmFUK4zZ.js} +2 -2
- package/dist/{ChatMarkdown-Cyujn3JJ.js → ChatMarkdown-nvEI7iCv.js} +4 -4
- package/dist/{DiffCommentAnnotation-BZu1TP6E.js → DiffCommentAnnotation-BPTN_2a6.js} +1 -1
- package/dist/{DiffFileTree-CcJ91zOM.js → DiffFileTree-B_br90vY.js} +2 -2
- package/dist/{DiffPanel-BXC88NMs.js → DiffPanel-V5R5TPuK.js} +5 -5
- package/dist/{ExpandedImageDialog-BZnGRBJR.js → ExpandedImageDialog-CAorLacL.js} +1 -1
- package/dist/{FileExplorerPane-vBJS6V75.js → FileExplorerPane-CeHulcPz.js} +1 -1
- package/dist/{FilePreviewPanel-jJHWsMzm.js → FilePreviewPanel-BVNLvWOc.js} +8 -8
- package/dist/{MermaidDiagram-paNwQY33.js → MermaidDiagram-CTolIzQD.js} +1 -1
- package/dist/{MermaidFilePreview-B9KxfnIN.js → MermaidFilePreview-CP2zP4FU.js} +1 -1
- package/dist/{MermaidViewer-CAEGpLyD.js → MermaidViewer-BDfYkS9E.js} +2 -2
- package/dist/{NotebookPreview-D01mMCpR.js → NotebookPreview-Cybs5uM0.js} +1 -1
- package/dist/{OfficeFilePreview-DWaRgfQU.js → OfficeFilePreview-7JsmSoKU.js} +1 -1
- package/dist/{OfficeViewer-BudrZbBA.js → OfficeViewer-CJoojlJK.js} +1 -1
- package/dist/{OpenInPicker-Dd3ifHa1.js → OpenInPicker-BIMWUxBP.js} +7 -7
- package/dist/{OpenXmlOfficeViewer-CXcKdq7k.js → OpenXmlOfficeViewer-C24Kj8DM.js} +1 -1
- package/dist/{PreviewImage-C4Ku4z7v.js → PreviewImage-oY5YnuTr.js} +1 -1
- package/dist/{PreviewImageContent-BwOB9Lyd.js → PreviewImageContent-n6eLzY99.js} +1 -1
- package/dist/{PullRequestCodeTab-BcwyMk7d.js → PullRequestCodeTab-Dv_0kVad.js} +7 -7
- package/dist/{PullRequestReviewAnnotation-BU5t_1fC.js → PullRequestReviewAnnotation-LeuwO-iH.js} +4 -4
- package/dist/builder/activity.d.ts +16 -0
- package/dist/builder/activity.js +51 -0
- package/dist/builder/address.d.ts +11 -0
- package/dist/builder/address.js +50 -0
- package/dist/builder/ago.d.ts +2 -0
- package/dist/builder/ago.js +18 -0
- package/dist/builder/api/agents.d.ts +139 -0
- package/dist/builder/api/agents.js +253 -0
- package/dist/builder/api/auto.d.ts +166 -0
- package/dist/builder/api/auto.js +300 -0
- package/dist/builder/api/billing.d.ts +263 -0
- package/dist/builder/api/billing.js +401 -0
- package/dist/builder/api/call.d.ts +53 -0
- package/dist/builder/api/call.js +123 -0
- package/dist/builder/api/capabilities.d.ts +14 -0
- package/dist/builder/api/capabilities.js +41 -0
- package/dist/builder/api/changes.d.ts +74 -0
- package/dist/builder/api/changes.js +75 -0
- package/dist/builder/api/chat.d.ts +12 -0
- package/dist/builder/api/chat.js +28 -0
- package/dist/builder/api/cli.d.ts +59 -0
- package/dist/builder/api/cli.js +133 -0
- package/dist/builder/api/codebases.d.ts +46 -0
- package/dist/builder/api/codebases.js +100 -0
- package/dist/builder/api/coding.d.ts +117 -0
- package/dist/builder/api/coding.js +222 -0
- package/dist/builder/api/connectors.d.ts +76 -0
- package/dist/builder/api/connectors.js +111 -0
- package/dist/builder/api/consent.d.ts +22 -0
- package/dist/builder/api/consent.js +28 -0
- package/dist/builder/api/conversations.d.ts +20 -0
- package/dist/builder/api/conversations.js +23 -0
- package/dist/builder/api/draft.d.ts +38 -0
- package/dist/builder/api/draft.js +87 -0
- package/dist/builder/api/environment.d.ts +55 -0
- package/dist/builder/api/environment.js +126 -0
- package/dist/builder/api/gallery.d.ts +32 -0
- package/dist/builder/api/gallery.js +85 -0
- package/dist/builder/api/git.d.ts +31 -0
- package/dist/builder/api/git.js +47 -0
- package/dist/builder/api/github.d.ts +176 -0
- package/dist/builder/api/github.js +271 -0
- package/dist/builder/api/keys.d.ts +35 -0
- package/dist/builder/api/keys.js +72 -0
- package/dist/builder/api/library.d.ts +116 -0
- package/dist/builder/api/library.js +214 -0
- package/dist/builder/api/limits.d.ts +69 -0
- package/dist/builder/api/limits.js +86 -0
- package/dist/builder/api/links.d.ts +51 -0
- package/dist/builder/api/links.js +75 -0
- package/dist/builder/api/machines.d.ts +122 -0
- package/dist/builder/api/machines.js +238 -0
- package/dist/builder/api/mcp.d.ts +10 -0
- package/dist/builder/api/mcp.js +47 -0
- package/dist/builder/api/members.d.ts +35 -0
- package/dist/builder/api/members.js +95 -0
- package/dist/builder/api/memory.d.ts +14 -0
- package/dist/builder/api/memory.js +35 -0
- package/dist/builder/api/models.d.ts +17 -0
- package/dist/builder/api/models.js +20 -0
- package/dist/builder/api/places.d.ts +32 -0
- package/dist/builder/api/places.js +29 -0
- package/dist/builder/api/platform.d.ts +68 -0
- package/dist/builder/api/platform.js +87 -0
- package/dist/builder/api/plugins.d.ts +42 -0
- package/dist/builder/api/plugins.js +175 -0
- package/dist/builder/api/pref.d.ts +77 -0
- package/dist/builder/api/pref.js +93 -0
- package/dist/builder/api/profile.d.ts +11 -0
- package/dist/builder/api/profile.js +41 -0
- package/dist/builder/api/projects.d.ts +99 -0
- package/dist/builder/api/projects.js +166 -0
- package/dist/builder/api/provider.d.ts +49 -0
- package/dist/builder/api/provider.js +96 -0
- package/dist/builder/api/sandbox.d.ts +90 -0
- package/dist/builder/api/sandbox.js +223 -0
- package/dist/builder/api/sessions.d.ts +123 -0
- package/dist/builder/api/sessions.js +255 -0
- package/dist/builder/api/skills.d.ts +82 -0
- package/dist/builder/api/skills.js +117 -0
- package/dist/builder/api/sse.d.ts +24 -0
- package/dist/builder/api/sse.js +68 -0
- package/dist/builder/api/studio.d.ts +59 -0
- package/dist/builder/api/studio.js +91 -0
- package/dist/builder/api/talk.d.ts +48 -0
- package/dist/builder/api/talk.js +81 -0
- package/dist/builder/api/tools.d.ts +34 -0
- package/dist/builder/api/tools.js +37 -0
- package/dist/builder/api/turn.d.ts +202 -0
- package/dist/builder/api/turn.js +772 -0
- package/dist/builder/api/verdict.d.ts +3 -0
- package/dist/builder/api/verdict.js +21 -0
- package/dist/builder/api/webhooks.d.ts +47 -0
- package/dist/builder/api/webhooks.js +82 -0
- package/dist/builder/api/work.d.ts +110 -0
- package/dist/builder/api/work.js +218 -0
- package/dist/builder/ask.d.ts +51 -0
- package/dist/builder/ask.js +147 -0
- package/dist/builder/automations.d.ts +33 -0
- package/dist/builder/automations.js +453 -0
- package/dist/builder/awake.d.ts +24 -0
- package/dist/builder/awake.js +68 -0
- package/dist/builder/back.d.ts +30 -0
- package/dist/builder/back.js +105 -0
- package/dist/builder/builder.d.ts +12 -0
- package/dist/builder/builder.js +162 -0
- package/dist/builder/carry.d.ts +48 -0
- package/dist/builder/carry.js +278 -0
- package/dist/builder/choice.d.ts +134 -0
- package/dist/builder/choice.js +152 -0
- package/dist/builder/claims.d.ts +13 -0
- package/dist/builder/claims.js +35 -0
- package/dist/builder/clipboard.d.ts +2 -0
- package/dist/builder/clipboard.js +10 -0
- package/dist/builder/customize/agents.d.ts +11 -0
- package/dist/builder/customize/agents.js +513 -0
- package/dist/builder/customize/connectors.d.ts +2 -0
- package/dist/builder/customize/connectors.js +319 -0
- package/dist/builder/customize/drafted.d.ts +4 -0
- package/dist/builder/customize/drafted.js +92 -0
- package/dist/builder/customize/index.d.ts +8 -0
- package/dist/builder/customize/index.js +127 -0
- package/dist/builder/customize/inventory.d.ts +14 -0
- package/dist/builder/customize/inventory.js +127 -0
- package/dist/builder/customize/load.d.ts +9 -0
- package/dist/builder/customize/load.js +22 -0
- package/dist/builder/customize/ocean.d.ts +41 -0
- package/dist/builder/customize/ocean.js +332 -0
- package/dist/builder/customize/plugins.d.ts +2 -0
- package/dist/builder/customize/plugins.js +136 -0
- package/dist/builder/customize/roles.d.ts +4 -0
- package/dist/builder/customize/roles.js +105 -0
- package/dist/builder/customize/say.d.ts +13 -0
- package/dist/builder/customize/say.js +32 -0
- package/dist/builder/customize/skills.d.ts +2 -0
- package/dist/builder/customize/skills.js +208 -0
- package/dist/builder/customize/ui.d.ts +152 -0
- package/dist/builder/customize/ui.js +208 -0
- package/dist/builder/data.d.ts +57 -0
- package/dist/builder/data.js +322 -0
- package/dist/builder/design.d.ts +140 -0
- package/dist/builder/design.js +175 -0
- package/dist/builder/desk.d.ts +48 -0
- package/dist/builder/desk.js +449 -0
- package/dist/builder/dev-mode.d.ts +43 -0
- package/dist/builder/dev-mode.js +120 -0
- package/dist/builder/door.d.ts +11 -0
- package/dist/builder/door.js +126 -0
- package/dist/builder/environment.d.ts +23 -0
- package/dist/builder/environment.js +193 -0
- package/dist/builder/files.d.ts +23 -0
- package/dist/builder/files.js +175 -0
- package/dist/builder/find.d.ts +7 -0
- package/dist/builder/find.js +80 -0
- package/dist/builder/foot.d.ts +30 -0
- package/dist/builder/foot.js +79 -0
- package/dist/builder/forge.d.ts +4 -0
- package/dist/builder/forge.js +570 -0
- package/dist/builder/gear.d.ts +60 -0
- package/dist/builder/gear.js +180 -0
- package/dist/builder/git.d.ts +21 -0
- package/dist/builder/git.js +118 -0
- package/dist/builder/gutter.d.ts +17 -0
- package/dist/builder/gutter.js +25 -0
- package/dist/builder/handoff.d.ts +8 -0
- package/dist/builder/handoff.js +22 -0
- package/dist/builder/host.d.ts +189 -0
- package/dist/builder/host.js +46 -0
- package/dist/builder/index.d.ts +108 -0
- package/dist/builder/index.js +99 -0
- package/dist/builder/landing.d.ts +34 -0
- package/dist/builder/landing.js +725 -0
- package/dist/builder/library.d.ts +21 -0
- package/dist/builder/library.js +526 -0
- package/dist/builder/local.d.ts +80 -0
- package/dist/builder/local.js +124 -0
- package/dist/builder/make.d.ts +10 -0
- package/dist/builder/make.js +120 -0
- package/dist/builder/markdown.d.ts +49 -0
- package/dist/builder/markdown.js +125 -0
- package/dist/builder/marks.d.ts +15 -0
- package/dist/builder/marks.js +18 -0
- package/dist/builder/merge.d.ts +223 -0
- package/dist/builder/merge.js +380 -0
- package/dist/builder/meter.d.ts +31 -0
- package/dist/builder/meter.js +54 -0
- package/dist/builder/mind.d.ts +107 -0
- package/dist/builder/mind.js +335 -0
- package/dist/builder/names.d.ts +40 -0
- package/dist/builder/names.js +189 -0
- package/dist/builder/nav.d.ts +28 -0
- package/dist/builder/nav.js +218 -0
- package/dist/builder/out.d.ts +16 -0
- package/dist/builder/out.js +24 -0
- package/dist/builder/page.d.ts +55 -0
- package/dist/builder/page.js +217 -0
- package/dist/builder/pane.d.ts +30 -0
- package/dist/builder/pane.js +21 -0
- package/dist/builder/panel.d.ts +101 -0
- package/dist/builder/panel.js +408 -0
- package/dist/builder/pdf.d.ts +139 -0
- package/dist/builder/pdf.js +847 -0
- package/dist/builder/pick.d.ts +10 -0
- package/dist/builder/pick.js +38 -0
- package/dist/builder/plain.d.ts +59 -0
- package/dist/builder/plain.js +209 -0
- package/dist/builder/plan.d.ts +63 -0
- package/dist/builder/plan.js +155 -0
- package/dist/builder/plans.d.ts +1 -0
- package/dist/builder/plans.js +157 -0
- package/dist/builder/plugin.d.ts +60 -0
- package/dist/builder/plugin.js +1 -0
- package/dist/builder/plugins/design.d.ts +8 -0
- package/dist/builder/plugins/design.js +71 -0
- package/dist/builder/plugins/index.d.ts +46 -0
- package/dist/builder/plugins/index.js +117 -0
- package/dist/builder/plugins/pdf.d.ts +18 -0
- package/dist/builder/plugins/pdf.js +83 -0
- package/dist/builder/plugins/project.d.ts +5 -0
- package/dist/builder/plugins/project.js +68 -0
- package/dist/builder/plugins/research.d.ts +24 -0
- package/dist/builder/plugins/research.js +147 -0
- package/dist/builder/plugins/sketch.d.ts +9 -0
- package/dist/builder/plugins/sketch.js +101 -0
- package/dist/builder/plugins/slides.d.ts +14 -0
- package/dist/builder/plugins/slides.js +55 -0
- package/dist/builder/plugins/template.d.ts +13 -0
- package/dist/builder/plugins/template.js +95 -0
- package/dist/builder/prefs.d.ts +29 -0
- package/dist/builder/prefs.js +91 -0
- package/dist/builder/preview-url.d.ts +47 -0
- package/dist/builder/preview-url.js +107 -0
- package/dist/builder/project.d.ts +18 -0
- package/dist/builder/project.js +591 -0
- package/dist/builder/prose.d.ts +4 -0
- package/dist/builder/prose.js +57 -0
- package/dist/builder/publish.d.ts +18 -0
- package/dist/builder/publish.js +141 -0
- package/dist/builder/question.d.ts +33 -0
- package/dist/builder/question.js +64 -0
- package/dist/builder/redesign.d.ts +32 -0
- package/dist/builder/redesign.js +117 -0
- package/dist/builder/removal.d.ts +71 -0
- package/dist/builder/removal.js +73 -0
- package/dist/builder/reply.d.ts +50 -0
- package/dist/builder/reply.js +196 -0
- package/dist/builder/roles.d.ts +10 -0
- package/dist/builder/roles.js +28 -0
- package/dist/builder/route.d.ts +85 -0
- package/dist/builder/route.js +126 -0
- package/dist/builder/run.d.ts +4 -0
- package/dist/builder/run.js +804 -0
- package/dist/builder/runmeta.d.ts +16 -0
- package/dist/builder/runmeta.js +69 -0
- package/dist/builder/say.d.ts +2 -0
- package/dist/builder/say.js +7 -0
- package/dist/builder/scheduled.d.ts +3 -0
- package/dist/builder/scheduled.js +328 -0
- package/dist/builder/section.d.ts +27 -0
- package/dist/builder/section.js +60 -0
- package/dist/builder/settings/account.d.ts +1 -0
- package/dist/builder/settings/account.js +111 -0
- package/dist/builder/settings/billing.d.ts +1 -0
- package/dist/builder/settings/billing.js +210 -0
- package/dist/builder/settings/capabilities.d.ts +1 -0
- package/dist/builder/settings/capabilities.js +66 -0
- package/dist/builder/settings/card.d.ts +31 -0
- package/dist/builder/settings/card.js +140 -0
- package/dist/builder/settings/code.d.ts +1 -0
- package/dist/builder/settings/code.js +70 -0
- package/dist/builder/settings/credits.d.ts +10 -0
- package/dist/builder/settings/credits.js +123 -0
- package/dist/builder/settings/environments.d.ts +1 -0
- package/dist/builder/settings/environments.js +60 -0
- package/dist/builder/settings/general.d.ts +1 -0
- package/dist/builder/settings/general.js +58 -0
- package/dist/builder/settings/index.d.ts +4 -0
- package/dist/builder/settings/index.js +25 -0
- package/dist/builder/settings/integrations.d.ts +8 -0
- package/dist/builder/settings/integrations.js +138 -0
- package/dist/builder/settings/keys.d.ts +1 -0
- package/dist/builder/settings/keys.js +114 -0
- package/dist/builder/settings/list.d.ts +10 -0
- package/dist/builder/settings/list.js +28 -0
- package/dist/builder/settings/machines.d.ts +4 -0
- package/dist/builder/settings/machines.js +243 -0
- package/dist/builder/settings/members.d.ts +1 -0
- package/dist/builder/settings/members.js +77 -0
- package/dist/builder/settings/memory.d.ts +1 -0
- package/dist/builder/settings/memory.js +62 -0
- package/dist/builder/settings/notifications.d.ts +1 -0
- package/dist/builder/settings/notifications.js +111 -0
- package/dist/builder/settings/plan.d.ts +17 -0
- package/dist/builder/settings/plan.js +131 -0
- package/dist/builder/settings/privacy.d.ts +1 -0
- package/dist/builder/settings/privacy.js +76 -0
- package/dist/builder/settings/sections.d.ts +16 -0
- package/dist/builder/settings/sections.js +34 -0
- package/dist/builder/settings/shared.d.ts +6 -0
- package/dist/builder/settings/shared.js +58 -0
- package/dist/builder/settings/ui.d.ts +50 -0
- package/dist/builder/settings/ui.js +53 -0
- package/dist/builder/settings/usage.d.ts +1 -0
- package/dist/builder/settings/usage.js +24 -0
- package/dist/builder/shared.d.ts +26 -0
- package/dist/builder/shared.js +15 -0
- package/dist/builder/shelf.d.ts +16 -0
- package/dist/builder/shelf.js +219 -0
- package/dist/builder/side.d.ts +40 -0
- package/dist/builder/side.js +208 -0
- package/dist/builder/site.d.ts +75 -0
- package/dist/builder/site.js +138 -0
- package/dist/builder/spend.d.ts +21 -0
- package/dist/builder/spend.js +80 -0
- package/dist/builder/standing.d.ts +36 -0
- package/dist/builder/standing.js +66 -0
- package/dist/builder/suggest.d.ts +238 -0
- package/dist/builder/suggest.js +463 -0
- package/dist/builder/suggestions.d.ts +49 -0
- package/dist/builder/suggestions.js +260 -0
- package/dist/builder/summary.d.ts +60 -0
- package/dist/builder/summary.js +81 -0
- package/dist/builder/sync.d.ts +1 -0
- package/dist/builder/sync.js +164 -0
- package/dist/builder/tabs.d.ts +85 -0
- package/dist/builder/tabs.js +288 -0
- package/dist/builder/talk.d.ts +5 -0
- package/dist/builder/talk.js +108 -0
- package/dist/builder/thread.d.ts +60 -0
- package/dist/builder/thread.js +302 -0
- package/dist/builder/tools.d.ts +22 -0
- package/dist/builder/tools.js +52 -0
- package/dist/builder/transcript.d.ts +47 -0
- package/dist/builder/transcript.js +108 -0
- package/dist/builder/voice.d.ts +8 -0
- package/dist/builder/voice.js +24 -0
- package/dist/{changedFileKind-DqgCCDUs.js → changedFileKind-D6QYvIez.js} +1 -1
- package/dist/core.js +1 -0
- package/dist/{decodeImagePreview-CesVZYP4.js → decodeImagePreview-DnfFEjhw.js} +1 -1
- package/dist/{embed-DYP-OUlb.js → embed-c030vUqM.js} +11 -11
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/{micromark-util-decode-string-NQjVkmZH.js → micromark-util-decode-string-C-5AXkOV.js} +5 -3
- package/dist/{readBinaryPreview-D2X4Uahu.js → readBinaryPreview-BAQ4fFjm.js} +1 -1
- package/dist/{useTextFieldSpeech-CyOZZPrV.js → useTextFieldSpeech-COa9XcRx.js} +1 -1
- package/package.json +101 -11
- /package/{index.d.ts → dist/core.d.ts} +0 -0
- /package/{keymap.d.ts → dist/keymap.d.ts} +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type Target } from './call.ts';
|
|
2
|
+
import { type Item } from './library.ts';
|
|
3
|
+
export interface Run {
|
|
4
|
+
id: string;
|
|
5
|
+
/** queued, running, succeeded, failed or cancelled. */
|
|
6
|
+
status: string;
|
|
7
|
+
title: string;
|
|
8
|
+
/** What the run's writing step said, when its product is words. */
|
|
9
|
+
text: string;
|
|
10
|
+
outputs: Item[];
|
|
11
|
+
/** Why it failed, in the platform's words, or ''. */
|
|
12
|
+
error: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Start {
|
|
15
|
+
template: string;
|
|
16
|
+
input: Record<string, unknown>;
|
|
17
|
+
title?: string;
|
|
18
|
+
parent?: string;
|
|
19
|
+
/** A brand (design system) the run reads as brand.* — its palette, type and voice. */
|
|
20
|
+
brand?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A design system: one of Studio's brands, the one store for them. Its tokens
|
|
24
|
+
* are CSS custom properties (--background, --primary, --font-sans, --radius-md,
|
|
25
|
+
* …, the form Studio's renderer reads), with `--component-*` and `--voice-*` as
|
|
26
|
+
* quoted lines a model follows (design.ts `tokensOf`).
|
|
27
|
+
*
|
|
28
|
+
* GET /v1/studio/brands {data: [brand]} the ones you may read
|
|
29
|
+
* GET /v1/studio/brands/{id} one
|
|
30
|
+
* POST /v1/studio/brands {name, tokens, shared?} → brand
|
|
31
|
+
*/
|
|
32
|
+
export interface Brand {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
tokens: Record<string, unknown>;
|
|
36
|
+
}
|
|
37
|
+
export declare function brandOf(raw: unknown): Brand;
|
|
38
|
+
export declare function brands(t: Target, init?: {
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
}): Promise<Brand[]>;
|
|
41
|
+
export declare function brand(t: Target, id: string, init?: {
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
}): Promise<Brand>;
|
|
44
|
+
export declare function keepBrand(t: Target, b: {
|
|
45
|
+
name: string;
|
|
46
|
+
tokens: Record<string, unknown>;
|
|
47
|
+
}, signal?: AbortSignal): Promise<Brand>;
|
|
48
|
+
export declare function run(raw: unknown): Run;
|
|
49
|
+
/** A run that has ended, one way or the other. */
|
|
50
|
+
export declare const ended: (r: Run) => boolean;
|
|
51
|
+
/** The ids of the templates this org may run. */
|
|
52
|
+
export declare function templates(t: Target, init?: {
|
|
53
|
+
signal?: AbortSignal;
|
|
54
|
+
}): Promise<string[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Start a run and wait for it to end. Aborted, the run is cancelled so its
|
|
57
|
+
* reservation is released; a run that fails is thrown with its reason.
|
|
58
|
+
*/
|
|
59
|
+
export declare function make(t: Target, s: Start, signal?: AbortSignal): Promise<Run>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hanzo Studio: a creation is a run of a template, its files kept in the Library.
|
|
3
|
+
*
|
|
4
|
+
* GET /v1/studio/templates {data: [template]} the public catalog, then the org's own
|
|
5
|
+
* POST /v1/studio/runs {template, input, title?, parent?} → 201 run, queued
|
|
6
|
+
* GET /v1/studio/runs/{id} the run: status, text, outputs
|
|
7
|
+
* POST /v1/studio/runs/{id}/cancel stop it; what it reserved is released
|
|
8
|
+
*
|
|
9
|
+
* A run is priced and its estimate reserved against the org's wallet before it
|
|
10
|
+
* is queued (402 when the wallet cannot cover it). `parent` makes the run the
|
|
11
|
+
* next version of that one. Its outputs are Library items: their `url` is
|
|
12
|
+
* signed and expires, their `origin` is the app path that opens the run in
|
|
13
|
+
* Studio and does not.
|
|
14
|
+
*/
|
|
15
|
+
import { phrase } from '@hanzo/i18n';
|
|
16
|
+
import { call, Refusal, seg, Sentence } from './call.js';
|
|
17
|
+
import { item } from './library.js';
|
|
18
|
+
export function brandOf(raw) {
|
|
19
|
+
const o = obj(raw);
|
|
20
|
+
return { id: str(o.id), name: str(o.name), tokens: obj(o.tokens) };
|
|
21
|
+
}
|
|
22
|
+
export async function brands(t, init) {
|
|
23
|
+
const raw = obj(await call(t, 'GET', '/v1/studio/brands', undefined, init));
|
|
24
|
+
return (Array.isArray(raw.data) ? raw.data : []).map(brandOf).filter((b) => b.id);
|
|
25
|
+
}
|
|
26
|
+
export async function brand(t, id, init) {
|
|
27
|
+
return brandOf(await call(t, 'GET', `/v1/studio/brands/${seg(id)}`, undefined, init));
|
|
28
|
+
}
|
|
29
|
+
export async function keepBrand(t, b, signal) {
|
|
30
|
+
return brandOf(await call(t, 'POST', '/v1/studio/brands', { name: b.name, tokens: b.tokens }, { signal }));
|
|
31
|
+
}
|
|
32
|
+
const str = (v) => (typeof v === 'string' ? v : '');
|
|
33
|
+
const obj = (v) => (v && typeof v === 'object' ? v : {});
|
|
34
|
+
export function run(raw) {
|
|
35
|
+
const o = obj(raw);
|
|
36
|
+
const e = obj(o.error);
|
|
37
|
+
return {
|
|
38
|
+
id: str(o.id),
|
|
39
|
+
status: str(o.status),
|
|
40
|
+
title: str(o.title),
|
|
41
|
+
text: str(o.text),
|
|
42
|
+
outputs: (Array.isArray(o.outputs) ? o.outputs : []).map(item).filter((x) => x !== null),
|
|
43
|
+
error: str(e.detail) || str(e.title),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** A run that has ended, one way or the other. */
|
|
47
|
+
export const ended = (r) => r.status !== 'queued' && r.status !== 'running' && r.status !== '';
|
|
48
|
+
/** The ids of the templates this org may run. */
|
|
49
|
+
export async function templates(t, init) {
|
|
50
|
+
const raw = obj(await call(t, 'GET', '/v1/studio/templates', undefined, init));
|
|
51
|
+
return (Array.isArray(raw.data) ? raw.data : []).map((x) => str(obj(x).id)).filter(Boolean);
|
|
52
|
+
}
|
|
53
|
+
/** How often a run is read while it works, and the longest it is waited for. */
|
|
54
|
+
const EVERY = 2_000;
|
|
55
|
+
const LONGEST = 5 * 60_000;
|
|
56
|
+
const pause = (ms, signal) => new Promise((done, fail) => {
|
|
57
|
+
const id = setTimeout(done, ms);
|
|
58
|
+
signal?.addEventListener('abort', () => {
|
|
59
|
+
clearTimeout(id);
|
|
60
|
+
fail(signal.reason);
|
|
61
|
+
}, { once: true });
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Start a run and wait for it to end. Aborted, the run is cancelled so its
|
|
65
|
+
* reservation is released; a run that fails is thrown with its reason.
|
|
66
|
+
*/
|
|
67
|
+
export async function make(t, s, signal) {
|
|
68
|
+
let r = run(await call(t, 'POST', '/v1/studio/runs', s, { signal }).catch((e) => {
|
|
69
|
+
throw e instanceof Refusal && e.status === 402 ? new Error(phrase('Your balance does not cover it. Add credit in Settings › Billing.')) : e;
|
|
70
|
+
}));
|
|
71
|
+
if (!r.id)
|
|
72
|
+
throw new Error(phrase('Studio started the run and named no id'));
|
|
73
|
+
const id = r.id;
|
|
74
|
+
const stop = () => void call(t, 'POST', `/v1/studio/runs/${seg(id)}/cancel`, {}).catch(() => undefined);
|
|
75
|
+
signal?.addEventListener('abort', stop, { once: true });
|
|
76
|
+
try {
|
|
77
|
+
const until = Date.now() + LONGEST;
|
|
78
|
+
while (!ended(r)) {
|
|
79
|
+
if (Date.now() > until)
|
|
80
|
+
throw new Error(phrase('Studio is still making it. It will be in your Library when it is done.'));
|
|
81
|
+
await pause(EVERY, signal);
|
|
82
|
+
r = run(await call(t, 'GET', `/v1/studio/runs/${seg(id)}`, undefined, { signal }));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
signal?.removeEventListener('abort', stop);
|
|
87
|
+
}
|
|
88
|
+
if (r.status !== 'succeeded')
|
|
89
|
+
throw r.error ? new Error(r.error) : new Sentence(phrase('Studio could not make it ({status})'), { status: r.status });
|
|
90
|
+
return r;
|
|
91
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type Target } from './call.ts';
|
|
2
|
+
import type { Event, Session } from './sessions.ts';
|
|
3
|
+
/** The channel a conversation's session is on. */
|
|
4
|
+
export declare const TALK = "app";
|
|
5
|
+
/**
|
|
6
|
+
* Whether a session is a conversation, rather than one run. A conversation's runs
|
|
7
|
+
* are on its channel too — born in its tree, its person's alone — and are told
|
|
8
|
+
* from it by having a parent: the conversation is the root.
|
|
9
|
+
*/
|
|
10
|
+
export declare const talks: (s: Pick<Session, 'channel' | 'parent'> | null | undefined) => boolean;
|
|
11
|
+
export interface Say {
|
|
12
|
+
/** The conversation to continue. Absent starts one. */
|
|
13
|
+
session?: string;
|
|
14
|
+
/** What the person said. */
|
|
15
|
+
input: string;
|
|
16
|
+
/** The model, by the id GET /v1/models lists. */
|
|
17
|
+
model?: string;
|
|
18
|
+
/** The repository: its name in the org, or owner/name on GitHub. */
|
|
19
|
+
repo?: string;
|
|
20
|
+
/** The branch a coding run starts from. */
|
|
21
|
+
base?: string;
|
|
22
|
+
/** One of the org's machines. Absent is the sandbox. */
|
|
23
|
+
target?: string;
|
|
24
|
+
/** How the conversation's coding runs go: on their own, asked for first, or plans only. */
|
|
25
|
+
mode?: 'auto' | 'manual' | 'plan';
|
|
26
|
+
/** How hard a coding run thinks: low, medium or high. */
|
|
27
|
+
effort?: string;
|
|
28
|
+
/** The issue on `repo` a coding run resolves. */
|
|
29
|
+
issue?: number;
|
|
30
|
+
/** Out-of-band instructions (skills, memories) kept separate from `input`. */
|
|
31
|
+
instructions?: string;
|
|
32
|
+
/** Explicit alias for `instructions` forwarded to turns and coding runs. */
|
|
33
|
+
developerInstructions?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface Said {
|
|
36
|
+
/** The conversation: the same id on every turn. */
|
|
37
|
+
session: string;
|
|
38
|
+
/** This turn's run within it. */
|
|
39
|
+
run: string;
|
|
40
|
+
}
|
|
41
|
+
/** The request body: only what was said, with no empty values sent. */
|
|
42
|
+
export declare function body(s: Say): Record<string, string | number | boolean>;
|
|
43
|
+
/** Say one thing in a conversation: a new one without `session`, that one with it. */
|
|
44
|
+
export declare function say(t: Target, s: Say): Promise<Said>;
|
|
45
|
+
/** What a conversation's turn is doing now: its latest progress line, or ''. */
|
|
46
|
+
export declare function now(events: Pick<Event, 'kind' | 'payload' | 'seq'>[]): string;
|
|
47
|
+
/** Answer a question a session's run asked: an option pressed, or the person's own words. */
|
|
48
|
+
export declare function answer(t: Target, session: string, question: string, text: string, chosen: boolean): Promise<void>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev's conversation, as the platform keeps it (apps/agents talk.go): one
|
|
3
|
+
* session, every turn.
|
|
4
|
+
*
|
|
5
|
+
* POST /v1/agent/turns {session?, input, model?, effort?, repo?, base?, target?, mode?, issue?}
|
|
6
|
+
* → {sessionId, runId}
|
|
7
|
+
* POST /v1/agent/sessions/{id}/answer {question, text, chosen} answer what a turn asked
|
|
8
|
+
*
|
|
9
|
+
* The first thing said opens the conversation; everything said after continues
|
|
10
|
+
* the SAME session under a new run, once its last turn has answered — what is said
|
|
11
|
+
* while a turn still works is that turn's next input (sessions.ts `message`). The
|
|
12
|
+
* agent answers, and decides for itself when a turn needs a sandbox (leased on its
|
|
13
|
+
* first use, kept for the conversation) or a coding run (which carries on the
|
|
14
|
+
* conversation's last, in its sandbox and on its branch). A turn that only talks
|
|
15
|
+
* uses neither, and a turn ends when its answer does: a build it started is
|
|
16
|
+
* followed after, and its outcome is said into the conversation when it ends.
|
|
17
|
+
*
|
|
18
|
+
* The repository, branch, machine and mode are kept on the conversation from the
|
|
19
|
+
* first message: every coding run its turns start works on them, auto starts it,
|
|
20
|
+
* manual asks first (a question answered here), plan only reads and plans. The
|
|
21
|
+
* model and effort ride each turn. Between turns the session rests `paused`.
|
|
22
|
+
*/
|
|
23
|
+
import { phrase } from '@hanzo/i18n';
|
|
24
|
+
import { call, Refusal, seg } from './call.js';
|
|
25
|
+
import { decode } from './turn.js';
|
|
26
|
+
/** The channel a conversation's session is on. */
|
|
27
|
+
export const TALK = 'app';
|
|
28
|
+
/**
|
|
29
|
+
* Whether a session is a conversation, rather than one run. A conversation's runs
|
|
30
|
+
* are on its channel too — born in its tree, its person's alone — and are told
|
|
31
|
+
* from it by having a parent: the conversation is the root.
|
|
32
|
+
*/
|
|
33
|
+
export const talks = (s) => s?.channel === TALK && !s.parent;
|
|
34
|
+
/** The request body: only what was said, with no empty values sent. */
|
|
35
|
+
export function body(s) {
|
|
36
|
+
const out = { input: s.input.trim() };
|
|
37
|
+
for (const k of [
|
|
38
|
+
'session',
|
|
39
|
+
'model',
|
|
40
|
+
'effort',
|
|
41
|
+
'repo',
|
|
42
|
+
'base',
|
|
43
|
+
'target',
|
|
44
|
+
'mode',
|
|
45
|
+
'instructions',
|
|
46
|
+
'developerInstructions',
|
|
47
|
+
]) {
|
|
48
|
+
const v = s[k]?.trim();
|
|
49
|
+
if (v)
|
|
50
|
+
out[k] = v;
|
|
51
|
+
}
|
|
52
|
+
if (s.issue && Number.isInteger(s.issue) && s.issue > 0)
|
|
53
|
+
out.issue = s.issue;
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
/** Say one thing in a conversation: a new one without `session`, that one with it. */
|
|
57
|
+
export async function say(t, s) {
|
|
58
|
+
if (!s.input.trim())
|
|
59
|
+
throw new Refusal(400, phrase('Say something'));
|
|
60
|
+
const r = await call(t, 'POST', '/v1/agent/turns', body(s));
|
|
61
|
+
const session = typeof r?.sessionId === 'string' ? r.sessionId : '';
|
|
62
|
+
if (!session)
|
|
63
|
+
throw new Refusal(502, phrase('The conversation answered with no session'));
|
|
64
|
+
return { session, run: typeof r?.runId === 'string' ? r.runId : '' };
|
|
65
|
+
}
|
|
66
|
+
/** What a conversation's turn is doing now: its latest progress line, or ''. */
|
|
67
|
+
export function now(events) {
|
|
68
|
+
let doing = '';
|
|
69
|
+
for (const e of [...events].sort((a, b) => a.seq - b.seq)) {
|
|
70
|
+
const b = decode(e.payload);
|
|
71
|
+
if (e.kind === 'progress' && b && typeof b !== 'string' && typeof b.activity === 'string')
|
|
72
|
+
doing = b.activity;
|
|
73
|
+
}
|
|
74
|
+
return doing;
|
|
75
|
+
}
|
|
76
|
+
/** Answer a question a session's run asked: an option pressed, or the person's own words. */
|
|
77
|
+
export async function answer(t, session, question, text, chosen) {
|
|
78
|
+
if (!text.trim())
|
|
79
|
+
throw new Refusal(400, phrase('Say an answer'));
|
|
80
|
+
await call(t, 'POST', `/v1/agent/sessions/${seg(session)}/answer`, { question, text: text.trim(), chosen });
|
|
81
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The org's tool plane: every tool it can reach, and which of them are on.
|
|
3
|
+
*
|
|
4
|
+
* GET /v1/tool?source=&activated=true {tools: [{name, source, description, activated, dispatchable}]}
|
|
5
|
+
* GET /v1/tool/activation {enabled: [name]}
|
|
6
|
+
* PUT /v1/tool/activation {activate: [name], deactivate: [name]} → {enabled: [name]}
|
|
7
|
+
*
|
|
8
|
+
* A tool is on per org. On is what puts a skill's SKILL.md in an agent's prompt
|
|
9
|
+
* and what lets an MCP server's tool be called; a tool that is off is listed and
|
|
10
|
+
* refused at call time. Any member of the org may switch one — the handler asks
|
|
11
|
+
* for the org and nothing more.
|
|
12
|
+
*/
|
|
13
|
+
import { type Target } from './call.ts';
|
|
14
|
+
export interface Tool {
|
|
15
|
+
/** The flat, fleet-wide name: `skill_<name>`, `<server id>_<tool>`, `agent_<name>`… */
|
|
16
|
+
name: string;
|
|
17
|
+
/** connector, function, zap-service, agent, skill or mcp. */
|
|
18
|
+
source: string;
|
|
19
|
+
description: string;
|
|
20
|
+
activated: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const names: (v: unknown) => string[];
|
|
23
|
+
export declare function tool(raw: unknown): Tool;
|
|
24
|
+
/** The tools in one listing, whichever of the plane's two envelopes it came in. */
|
|
25
|
+
export declare function toolsOf(raw: unknown): Tool[];
|
|
26
|
+
/** Every tool the org reaches, narrowed to one source and to the ones that are on when asked. */
|
|
27
|
+
export declare function tools(t: Target, q?: {
|
|
28
|
+
source?: string;
|
|
29
|
+
activated?: boolean;
|
|
30
|
+
}): Promise<Tool[]>;
|
|
31
|
+
/** The names that are on. */
|
|
32
|
+
export declare function enabled(t: Target): Promise<string[]>;
|
|
33
|
+
/** Switch names on and off; answers every name that is on afterwards. */
|
|
34
|
+
export declare function toggle(t: Target, on: string[], off?: string[]): Promise<string[]>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The org's tool plane: every tool it can reach, and which of them are on.
|
|
3
|
+
*
|
|
4
|
+
* GET /v1/tool?source=&activated=true {tools: [{name, source, description, activated, dispatchable}]}
|
|
5
|
+
* GET /v1/tool/activation {enabled: [name]}
|
|
6
|
+
* PUT /v1/tool/activation {activate: [name], deactivate: [name]} → {enabled: [name]}
|
|
7
|
+
*
|
|
8
|
+
* A tool is on per org. On is what puts a skill's SKILL.md in an agent's prompt
|
|
9
|
+
* and what lets an MCP server's tool be called; a tool that is off is listed and
|
|
10
|
+
* refused at call time. Any member of the org may switch one — the handler asks
|
|
11
|
+
* for the org and nothing more.
|
|
12
|
+
*/
|
|
13
|
+
import { call, query } from './call.js';
|
|
14
|
+
const str = (v) => (typeof v === 'string' ? v : '');
|
|
15
|
+
const obj = (v) => (v && typeof v === 'object' ? v : {});
|
|
16
|
+
export const names = (v) => (Array.isArray(v) ? v.filter((n) => typeof n === 'string' && n !== '') : []);
|
|
17
|
+
export function tool(raw) {
|
|
18
|
+
const o = obj(raw);
|
|
19
|
+
return { name: str(o.name), source: str(o.source), description: str(o.description), activated: o.activated === true };
|
|
20
|
+
}
|
|
21
|
+
/** The tools in one listing, whichever of the plane's two envelopes it came in. */
|
|
22
|
+
export function toolsOf(raw) {
|
|
23
|
+
const list = obj(raw).tools;
|
|
24
|
+
return (Array.isArray(list) ? list : []).map(tool).filter((x) => x.name);
|
|
25
|
+
}
|
|
26
|
+
/** Every tool the org reaches, narrowed to one source and to the ones that are on when asked. */
|
|
27
|
+
export async function tools(t, q = {}) {
|
|
28
|
+
return toolsOf(await call(t, 'GET', `/v1/tool${query({ source: q.source, activated: q.activated ? 'true' : undefined })}`));
|
|
29
|
+
}
|
|
30
|
+
/** The names that are on. */
|
|
31
|
+
export async function enabled(t) {
|
|
32
|
+
return names(obj(await call(t, 'GET', '/v1/tool/activation')).enabled);
|
|
33
|
+
}
|
|
34
|
+
/** Switch names on and off; answers every name that is on afterwards. */
|
|
35
|
+
export async function toggle(t, on, off = []) {
|
|
36
|
+
return names(obj(await call(t, 'PUT', '/v1/tool/activation', { activate: on, deactivate: off })).enabled);
|
|
37
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { Say } from '@hanzo/i18n/react';
|
|
2
|
+
import { type Changed, type Explore } from './cli.ts';
|
|
3
|
+
import type { Event } from './sessions.ts';
|
|
4
|
+
/** The payload as an object. A live frame may carry it as a JSON string. */
|
|
5
|
+
export declare function decode(payload: unknown): Record<string, unknown> | string | null;
|
|
6
|
+
/**
|
|
7
|
+
* Whether an error is a model vendor's own words: a provider's name, its rate
|
|
8
|
+
* headers, a key, or the JSON body it answers with. Those never reach the run
|
|
9
|
+
* page — they say whose model it was and nothing a person can act on — so the
|
|
10
|
+
* run says its plain line alone.
|
|
11
|
+
*/
|
|
12
|
+
export declare function vendor(error: string): boolean;
|
|
13
|
+
/** An error as the run page may show it: its own words, or the plain line when they are a vendor's. */
|
|
14
|
+
export declare const scrub: (error: string, t?: Say) => string;
|
|
15
|
+
/** Whether an error message indicates insufficient balance / credit / free-sandbox exhaustion (#363/#364). */
|
|
16
|
+
export declare function needsFunds(error: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* A run's error as one plain line with what to do, never the log it came from:
|
|
19
|
+
* that goes in the Error step beside it (cards), unless it is a vendor's.
|
|
20
|
+
*/
|
|
21
|
+
export declare function plain(error: string, t?: Say): string;
|
|
22
|
+
/**
|
|
23
|
+
* One event's sentence, or '' when it says nothing a person needs. `mode` is
|
|
24
|
+
* the run's, from its record: a plan run's final status says the plan.
|
|
25
|
+
*/
|
|
26
|
+
export declare function said(e: Pick<Event, 'kind' | 'payload'>, mode?: string, t?: Say): string;
|
|
27
|
+
/** One line of the shell: a command the run started, or output that followed it. */
|
|
28
|
+
export interface ShellLine {
|
|
29
|
+
role: 'cmd' | 'out';
|
|
30
|
+
text: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The shell beside the transcript. A tool call is the command; a log line, and
|
|
34
|
+
* any stdout or stderr the payload carried, is the output. Status stays in the
|
|
35
|
+
* transcript. Each line is capped so a payload that carried a file body cannot
|
|
36
|
+
* fill the pane.
|
|
37
|
+
*/
|
|
38
|
+
export declare function shell(events: Pick<Event, 'kind' | 'payload' | 'seq'>[]): ShellLine[];
|
|
39
|
+
/** A step the run named. Done is a step whose status has settled. */
|
|
40
|
+
export interface StepLine {
|
|
41
|
+
name: string;
|
|
42
|
+
done: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Tool calls, in the order they were first named. A later status for the same
|
|
46
|
+
* step wins, and a run's steps follow one another, so a step another has
|
|
47
|
+
* followed is over. `exit` is not a step: it is how the sandbox says one command
|
|
48
|
+
* in it ended (apps/sandbox work.go).
|
|
49
|
+
*/
|
|
50
|
+
export declare function steps(events: Pick<Event, 'kind' | 'payload' | 'seq'>[]): StepLine[];
|
|
51
|
+
export interface Outcome {
|
|
52
|
+
/** The last lifecycle status the run narrated, or ''. */
|
|
53
|
+
status: string;
|
|
54
|
+
/**
|
|
55
|
+
* That the pull request could not be opened, as narrated, or ''. Shown as a
|
|
56
|
+
* fact only — its text comes from an event any member can write, so it is
|
|
57
|
+
* never put on screen as the reason.
|
|
58
|
+
*/
|
|
59
|
+
problem: string;
|
|
60
|
+
/**
|
|
61
|
+
* The place in the run (its `seq`) of the latest status that said its work
|
|
62
|
+
* went live on its project's site, or 0. It is the cue to read the project
|
|
63
|
+
* again; the address shown is the project's own, never one an event names.
|
|
64
|
+
*/
|
|
65
|
+
published: number;
|
|
66
|
+
}
|
|
67
|
+
export declare function outcome(events: Pick<Event, 'kind' | 'payload' | 'seq'>[]): Outcome;
|
|
68
|
+
/** Why the run failed, as its last status or error log says it, or '' when that status is not a failure. */
|
|
69
|
+
export declare function failure(events: Pick<Event, 'kind' | 'payload' | 'seq'>[], t?: Say): string;
|
|
70
|
+
/** The turns, ordered and deduped: a recorded read and the live feed overlap. */
|
|
71
|
+
export declare function merge<T extends Pick<Event, 'id' | 'seq'>>(...lists: T[][]): T[];
|
|
72
|
+
/** The actor, short enough to label a block: `hanzo/2d4d67ab`, not the whole subject. */
|
|
73
|
+
export declare function who(actor: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* A pull request address the builder will draw as a link: https, on GitHub or
|
|
76
|
+
* the platform's own git, shaped like a pull request, and IN THE RUN'S OWN
|
|
77
|
+
* REPOSITORY (`repo`, `owner/name`). Anything else is ''. Read from the run's
|
|
78
|
+
* record, which the coding service writes — never from an event, which any
|
|
79
|
+
* member of the org can append — and bound to the repository, because a record
|
|
80
|
+
* can be moved into a project it did not work on.
|
|
81
|
+
*/
|
|
82
|
+
export declare function pull(url: string, repo: string): {
|
|
83
|
+
href: string;
|
|
84
|
+
label: string;
|
|
85
|
+
};
|
|
86
|
+
/** How a card's work went. One still running once the run has ended was cut off. */
|
|
87
|
+
export type Ran = 'running' | 'done' | 'error' | 'cancelled';
|
|
88
|
+
/**
|
|
89
|
+
* One piece of the transcript, drawn by what it is.
|
|
90
|
+
*
|
|
91
|
+
* said prose: the agent's messages (markdown), or a person's steering words
|
|
92
|
+
* think the agent's reasoning, folded until opened
|
|
93
|
+
* shell a command the agent ran, and what it printed: the CLI's "Ran"
|
|
94
|
+
* explore reads, listings and searches, consecutive ones together: the CLI's "Explored"
|
|
95
|
+
* edit files the agent changed, with the lines each adds and removes; the diff is the run's Git tab
|
|
96
|
+
* step a step of the run itself (lease, clone, install, push), or a tool the agent called
|
|
97
|
+
* todo the agent's plan, as a checklist it ticks
|
|
98
|
+
* note a lifecycle line: started, pushed, stopped
|
|
99
|
+
* plan a plan run's answer, which can be approved into a build
|
|
100
|
+
* run a coding run a conversation's turn started (talk.ts), opened on its own page
|
|
101
|
+
* ask a question the run asked its person, with its options, and the answer once given
|
|
102
|
+
*/
|
|
103
|
+
export type Card = {
|
|
104
|
+
kind: 'said';
|
|
105
|
+
key: string;
|
|
106
|
+
who: 'person' | 'agent';
|
|
107
|
+
text: string;
|
|
108
|
+
} | {
|
|
109
|
+
kind: 'think';
|
|
110
|
+
key: string;
|
|
111
|
+
text: string;
|
|
112
|
+
} | {
|
|
113
|
+
kind: 'shell';
|
|
114
|
+
key: string;
|
|
115
|
+
command: string;
|
|
116
|
+
output: string;
|
|
117
|
+
ran: Ran;
|
|
118
|
+
} | {
|
|
119
|
+
kind: 'explore';
|
|
120
|
+
key: string;
|
|
121
|
+
calls: Explore[];
|
|
122
|
+
ran: Ran;
|
|
123
|
+
} | {
|
|
124
|
+
kind: 'edit';
|
|
125
|
+
key: string;
|
|
126
|
+
files: Changed[];
|
|
127
|
+
ran: Ran;
|
|
128
|
+
} | {
|
|
129
|
+
kind: 'step';
|
|
130
|
+
key: string;
|
|
131
|
+
name: string;
|
|
132
|
+
detail: string;
|
|
133
|
+
output: string;
|
|
134
|
+
ran: Ran;
|
|
135
|
+
} | {
|
|
136
|
+
kind: 'todo';
|
|
137
|
+
key: string;
|
|
138
|
+
items: {
|
|
139
|
+
text: string;
|
|
140
|
+
done: boolean;
|
|
141
|
+
}[];
|
|
142
|
+
}
|
|
143
|
+
/** `step`: a line about the run getting going (started, sent to a machine), the process rather than its end. */
|
|
144
|
+
| {
|
|
145
|
+
kind: 'note';
|
|
146
|
+
key: string;
|
|
147
|
+
text: string;
|
|
148
|
+
step?: true;
|
|
149
|
+
funds?: true;
|
|
150
|
+
} | {
|
|
151
|
+
kind: 'plan';
|
|
152
|
+
key: string;
|
|
153
|
+
text: string;
|
|
154
|
+
} | {
|
|
155
|
+
kind: 'run';
|
|
156
|
+
key: string;
|
|
157
|
+
session: string;
|
|
158
|
+
} | {
|
|
159
|
+
kind: 'ask';
|
|
160
|
+
key: string;
|
|
161
|
+
question: string;
|
|
162
|
+
text: string;
|
|
163
|
+
options: string[];
|
|
164
|
+
answer: string;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* A run's events, as the cards its transcript draws. `mode` is the run's, from
|
|
168
|
+
* its record: a plan's final status is its plan, and nothing else draws a plan.
|
|
169
|
+
*
|
|
170
|
+
* The run's own steps arrive as `tool-call` {step, message, status}. The agent
|
|
171
|
+
* narrates itself as `event` lines: an item is started, updated and completed
|
|
172
|
+
* under one id, and its card is drawn once and kept current. Ids count from zero
|
|
173
|
+
* in each agent process, so an id is the agent's within the thread it started. A
|
|
174
|
+
* turn that fails is one plain line with the detail folded beneath it, drawn once
|
|
175
|
+
* however many times it is said; an `error` on its own is the agent retrying and
|
|
176
|
+
* is drawn only if the turn then fails. The final status carries the agent's
|
|
177
|
+
* answer, drawn once. `log` is never drawn here.
|
|
178
|
+
*/
|
|
179
|
+
export declare function cards(events: Pick<Event, 'kind' | 'payload' | 'seq'>[], mode?: string, t?: Say): Card[];
|
|
180
|
+
/**
|
|
181
|
+
* Cards as the CLI prints them, line for line: what a run's transcript reads as in
|
|
182
|
+
* `dev`'s terminal. The transcript draws the same words (transcript.tsx); this is
|
|
183
|
+
* them as text, which the parity tests hold to the CLI's own.
|
|
184
|
+
*/
|
|
185
|
+
export declare function printed(cards: Card[], live?: boolean): string;
|
|
186
|
+
/** The plan a plan run answered with, from its final status, or ''. */
|
|
187
|
+
export declare function answer(events: Pick<Event, 'kind' | 'payload' | 'seq'>[]): string;
|
|
188
|
+
export interface Settled {
|
|
189
|
+
/** The run has said how it ended, or that it paused: its work is where it will stay. */
|
|
190
|
+
settled: boolean;
|
|
191
|
+
/** That work is on the run's own branch, which a follow-up can start from. */
|
|
192
|
+
pushed: boolean;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Whether the run has kept its work yet, and whether that work is on its
|
|
196
|
+
* branch. A stop or a pause commits and pushes AFTER it is asked, and says so
|
|
197
|
+
* in its status (apps/coding coding.go interrupted): until then a follow-up
|
|
198
|
+
* would clone a branch the push has not reached.
|
|
199
|
+
*/
|
|
200
|
+
export declare function settled(events: Pick<Event, 'kind' | 'payload' | 'seq'>[]): Settled;
|
|
201
|
+
/** The session of the run that carried this one on (its `followed` status), or ''. */
|
|
202
|
+
export declare function followed(events: Pick<Event, 'kind' | 'payload' | 'seq'>[]): string;
|