@hanzo/dev 4.0.1 → 4.2.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 +59 -0
- package/dist/builder/api/git.js +117 -0
- package/dist/builder/api/github.d.ts +230 -0
- package/dist/builder/api/github.js +373 -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 +639 -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/github-sync.d.ts +70 -0
- package/dist/builder/github-sync.js +435 -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 +604 -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 +187 -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,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The choice New starts from, kept in this browser so a codebase or an issue
|
|
3
|
+
* opened from its own screen is what the composer is holding when it mounts.
|
|
4
|
+
*
|
|
5
|
+
* The key is the one `useKept` in New writes. A merge keeps the mode, the
|
|
6
|
+
* model and the machine; it only replaces the fields the caller names.
|
|
7
|
+
*/
|
|
8
|
+
import { type Codebase, type ForgeRepo } from './api/codebases.ts';
|
|
9
|
+
import type { Project } from './merge.ts';
|
|
10
|
+
export interface Choice {
|
|
11
|
+
repo: ForgeRepo | null;
|
|
12
|
+
branch: string;
|
|
13
|
+
place: string;
|
|
14
|
+
mode: string;
|
|
15
|
+
model: string;
|
|
16
|
+
effort: string;
|
|
17
|
+
/** A draft handed over by another screen. New copies it once and clears it. */
|
|
18
|
+
ask: string;
|
|
19
|
+
/** The issue that draft is, by the number the run's pull request closes; 0 for none. Handed over with it. */
|
|
20
|
+
issue: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const boardKey: (org: string | null) => string;
|
|
23
|
+
/**
|
|
24
|
+
* The choice New opens on, field by field: the last layer that says something
|
|
25
|
+
* wins. What was kept here, over the person's coding defaults, over the first
|
|
26
|
+
* run's. A field kept as '' stays '' (the default branch, the sandbox): only a
|
|
27
|
+
* field that is absent falls through, so a codebase or an issue handed over from
|
|
28
|
+
* its own screen — which keeps the codebase and the words alone — still opens on
|
|
29
|
+
* a model, a mode and an effort.
|
|
30
|
+
*/
|
|
31
|
+
export declare function settle<T extends object>(first: T, ...layers: (Partial<T> | null | undefined)[]): T;
|
|
32
|
+
/** Point New at a forge codebase, and optionally a first draft. */
|
|
33
|
+
export declare function pinCodebase(org: string | null, c: Codebase, ask?: string): void;
|
|
34
|
+
/** Which board Issues is showing. '' is every board. */
|
|
35
|
+
export declare function pinBoard(org: string | null, key: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Point New at a project, and optionally a first draft (an issue's ask) and the
|
|
38
|
+
* issue it closes. `where` is where the run works (merge.ts `home`): on the forge
|
|
39
|
+
* it is chosen by its forge name, which is what a run and its environment
|
|
40
|
+
* address; on GitHub by GitHub's address, so the run clones and proposes there.
|
|
41
|
+
* Left out, the forge when the project is there. A project that is neither
|
|
42
|
+
* cannot be worked on, and is refused here rather than handed to the platform.
|
|
43
|
+
*/
|
|
44
|
+
export declare function pinRepo(org: string | null, p: Project, ask?: string, issue?: number, where?: 'github' | 'forge' | null): void;
|
|
45
|
+
/**
|
|
46
|
+
* Point New at a repository on GitHub, by GitHub's address: the one Sync just
|
|
47
|
+
* brought in (sync.tsx), so the next run works on it and not on whatever was
|
|
48
|
+
* chosen before. It is GitHub's address and not its forge copy's, because the
|
|
49
|
+
* copy is still on its way there. A draft or an issue handed over with the
|
|
50
|
+
* last choice was that repository's, and goes with it.
|
|
51
|
+
*/
|
|
52
|
+
export declare function pinHub(org: string | null, r: {
|
|
53
|
+
owner: string;
|
|
54
|
+
name: string;
|
|
55
|
+
private: boolean;
|
|
56
|
+
branch: string;
|
|
57
|
+
}): void;
|
|
58
|
+
/**
|
|
59
|
+
* A repository on GitHub, chosen from the org's installation: the run works there.
|
|
60
|
+
* Its `full_name` is GitHub's address, `github.com/owner/name` — what the list
|
|
61
|
+
* shows, so a forge codebase of the same name is never mistaken for it, and what
|
|
62
|
+
* a coding run takes to clone, push and propose on GitHub.
|
|
63
|
+
*/
|
|
64
|
+
export interface HubRepo {
|
|
65
|
+
owner: string;
|
|
66
|
+
name: string;
|
|
67
|
+
full_name: string;
|
|
68
|
+
private: boolean;
|
|
69
|
+
default_branch: string;
|
|
70
|
+
pushed_at: string;
|
|
71
|
+
installation_id: number;
|
|
72
|
+
github: true;
|
|
73
|
+
/**
|
|
74
|
+
* Given by its address (address.ts), not chosen from a list. It is the
|
|
75
|
+
* person's word for where the run works, so no list is asked whether it is
|
|
76
|
+
* still there: a public repository is on no list, and GitHub admits a run on
|
|
77
|
+
* it all the same.
|
|
78
|
+
*/
|
|
79
|
+
given?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export declare const isHub: (repo: {
|
|
82
|
+
github?: boolean;
|
|
83
|
+
full_name?: string;
|
|
84
|
+
} | null) => repo is HubRepo;
|
|
85
|
+
/** A GitHub listing row as the composer offers it. */
|
|
86
|
+
export declare const asHub: (r: Omit<HubRepo, 'github'>) => HubRepo;
|
|
87
|
+
export declare const isForge: (repo: {
|
|
88
|
+
forge?: boolean;
|
|
89
|
+
name?: string;
|
|
90
|
+
} | null) => repo is ForgeRepo;
|
|
91
|
+
/**
|
|
92
|
+
* What New can offer now, read to judge the repository it kept. Each is null
|
|
93
|
+
* when it was not read — refused, let go, or still being read — and null
|
|
94
|
+
* judges nothing.
|
|
95
|
+
*/
|
|
96
|
+
export interface Offered {
|
|
97
|
+
/** Every name a run can address on the forge: the forge's own repositories (GET /v1/git/repos) and every linked copy (GET /v1/sync). */
|
|
98
|
+
forge: readonly string[] | null;
|
|
99
|
+
/** A page of GitHub's listing (GET /v1/provider/github/repos), with what it says stands behind it. */
|
|
100
|
+
github: {
|
|
101
|
+
repos: readonly {
|
|
102
|
+
owner: string;
|
|
103
|
+
name: string;
|
|
104
|
+
}[];
|
|
105
|
+
next: string;
|
|
106
|
+
unread: readonly string[];
|
|
107
|
+
} | null;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Whether the repository New kept is gone from what it can offer: a GitHub
|
|
111
|
+
* repository GitHub no longer lists — let go there, or GitHub disconnected,
|
|
112
|
+
* which lists nothing — or a codebase the forge no longer holds. Left kept, it
|
|
113
|
+
* is where every next run would go, whatever was linked or synced since.
|
|
114
|
+
*
|
|
115
|
+
* Only a WHOLE answer says a repository is missing. A GitHub page with another
|
|
116
|
+
* after it, or with an installation it could not read, is not the whole list,
|
|
117
|
+
* and a list that was not read is no list, so a refused or slow read never
|
|
118
|
+
* loses a good choice. An address the person gave is theirs, and no list is
|
|
119
|
+
* asked about it.
|
|
120
|
+
*/
|
|
121
|
+
export declare function gone(repo: {
|
|
122
|
+
forge?: boolean;
|
|
123
|
+
github?: boolean;
|
|
124
|
+
name?: string;
|
|
125
|
+
full_name?: string;
|
|
126
|
+
given?: boolean;
|
|
127
|
+
} | null, now: Offered): boolean;
|
|
128
|
+
/** A repository queued onto the forge and not reported landed yet. */
|
|
129
|
+
export interface Pending {
|
|
130
|
+
fullName: string;
|
|
131
|
+
name: string;
|
|
132
|
+
}
|
|
133
|
+
export declare function readPending(org: string | null): Pending[];
|
|
134
|
+
export declare function writePending(org: string | null, rows: Pending[]): void;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The choice New starts from, kept in this browser so a codebase or an issue
|
|
3
|
+
* opened from its own screen is what the composer is holding when it mounts.
|
|
4
|
+
*
|
|
5
|
+
* The key is the one `useKept` in New writes. A merge keeps the mode, the
|
|
6
|
+
* model and the machine; it only replaces the fields the caller names.
|
|
7
|
+
*/
|
|
8
|
+
import { asRepo } from './api/codebases.js';
|
|
9
|
+
const KEY = (org) => `hanzo.build.new.${org ?? 'none'}`;
|
|
10
|
+
export const boardKey = (org) => `hanzo.build.board.${org ?? 'none'}`;
|
|
11
|
+
function read(org) {
|
|
12
|
+
try {
|
|
13
|
+
const raw = window.localStorage.getItem(KEY(org));
|
|
14
|
+
const v = raw ? JSON.parse(raw) : null;
|
|
15
|
+
return v && typeof v === 'object' ? v : {};
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function write(org, value) {
|
|
22
|
+
try {
|
|
23
|
+
window.localStorage.setItem(KEY(org), JSON.stringify(value));
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
/* the next New starts empty */
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The choice New opens on, field by field: the last layer that says something
|
|
31
|
+
* wins. What was kept here, over the person's coding defaults, over the first
|
|
32
|
+
* run's. A field kept as '' stays '' (the default branch, the sandbox): only a
|
|
33
|
+
* field that is absent falls through, so a codebase or an issue handed over from
|
|
34
|
+
* its own screen — which keeps the codebase and the words alone — still opens on
|
|
35
|
+
* a model, a mode and an effort.
|
|
36
|
+
*/
|
|
37
|
+
export function settle(first, ...layers) {
|
|
38
|
+
let out = { ...first };
|
|
39
|
+
for (const layer of layers) {
|
|
40
|
+
if (!layer || typeof layer !== 'object' || Array.isArray(layer))
|
|
41
|
+
continue;
|
|
42
|
+
out = { ...out, ...Object.fromEntries(Object.entries(layer).filter(([, v]) => v !== undefined && v !== null)) };
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
/** Point New at a forge codebase, and optionally a first draft. */
|
|
47
|
+
export function pinCodebase(org, c, ask = '') {
|
|
48
|
+
const repo = asRepo(c);
|
|
49
|
+
write(org, { ...read(org), repo, branch: repo.default_branch, ask, issue: 0 });
|
|
50
|
+
}
|
|
51
|
+
/** Which board Issues is showing. '' is every board. */
|
|
52
|
+
export function pinBoard(org, key) {
|
|
53
|
+
try {
|
|
54
|
+
window.localStorage.setItem(boardKey(org), JSON.stringify(key));
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
/* Issues then shows every board */
|
|
58
|
+
}
|
|
59
|
+
window.dispatchEvent(new CustomEvent('hanzo-board', { detail: key }));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Point New at a project, and optionally a first draft (an issue's ask) and the
|
|
63
|
+
* issue it closes. `where` is where the run works (merge.ts `home`): on the forge
|
|
64
|
+
* it is chosen by its forge name, which is what a run and its environment
|
|
65
|
+
* address; on GitHub by GitHub's address, so the run clones and proposes there.
|
|
66
|
+
* Left out, the forge when the project is there. A project that is neither
|
|
67
|
+
* cannot be worked on, and is refused here rather than handed to the platform.
|
|
68
|
+
*/
|
|
69
|
+
export function pinRepo(org, p, ask = '', issue = 0, where = p.forge ? 'forge' : p.linked ? 'github' : null) {
|
|
70
|
+
const branch = p.branch || 'main';
|
|
71
|
+
let repo;
|
|
72
|
+
if (where === 'forge' && p.forge) {
|
|
73
|
+
repo = { owner: org ?? '', name: p.forge, full_name: org ? `${org}/${p.forge}` : p.forge, private: p.private ?? true, default_branch: branch, pushed_at: '', installation_id: 0, forge: true, clone: '' };
|
|
74
|
+
}
|
|
75
|
+
else if (where === 'github' && p.linked) {
|
|
76
|
+
repo = asHub({ owner: p.owner, name: p.name, full_name: `${p.owner}/${p.name}`, private: p.private ?? true, default_branch: branch, pushed_at: '', installation_id: 0 });
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
throw new Error(`${p.owner}/${p.name} is neither on the forge nor linked from GitHub`);
|
|
80
|
+
}
|
|
81
|
+
write(org, { ...read(org), repo, branch, ask, issue });
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Point New at a repository on GitHub, by GitHub's address: the one Sync just
|
|
85
|
+
* brought in (sync.tsx), so the next run works on it and not on whatever was
|
|
86
|
+
* chosen before. It is GitHub's address and not its forge copy's, because the
|
|
87
|
+
* copy is still on its way there. A draft or an issue handed over with the
|
|
88
|
+
* last choice was that repository's, and goes with it.
|
|
89
|
+
*/
|
|
90
|
+
export function pinHub(org, r) {
|
|
91
|
+
const repo = asHub({ owner: r.owner, name: r.name, full_name: `${r.owner}/${r.name}`, private: r.private, default_branch: r.branch, pushed_at: '', installation_id: 0 });
|
|
92
|
+
write(org, { ...read(org), repo, branch: repo.default_branch, ask: '', issue: 0 });
|
|
93
|
+
}
|
|
94
|
+
export const isHub = (repo) => Boolean(repo && repo.github === true && repo.full_name?.startsWith('github.com/'));
|
|
95
|
+
/** A GitHub listing row as the composer offers it. */
|
|
96
|
+
export const asHub = (r) => ({ ...r, full_name: `github.com/${r.owner}/${r.name}`, github: true });
|
|
97
|
+
export const isForge = (repo) => Boolean(repo && repo.forge === true && repo.name);
|
|
98
|
+
/**
|
|
99
|
+
* Whether the repository New kept is gone from what it can offer: a GitHub
|
|
100
|
+
* repository GitHub no longer lists — let go there, or GitHub disconnected,
|
|
101
|
+
* which lists nothing — or a codebase the forge no longer holds. Left kept, it
|
|
102
|
+
* is where every next run would go, whatever was linked or synced since.
|
|
103
|
+
*
|
|
104
|
+
* Only a WHOLE answer says a repository is missing. A GitHub page with another
|
|
105
|
+
* after it, or with an installation it could not read, is not the whole list,
|
|
106
|
+
* and a list that was not read is no list, so a refused or slow read never
|
|
107
|
+
* loses a good choice. An address the person gave is theirs, and no list is
|
|
108
|
+
* asked about it.
|
|
109
|
+
*/
|
|
110
|
+
export function gone(repo, now) {
|
|
111
|
+
if (!repo || repo.given)
|
|
112
|
+
return false;
|
|
113
|
+
if (isHub(repo)) {
|
|
114
|
+
const listed = now.github;
|
|
115
|
+
if (!listed || listed.next || listed.unread.length)
|
|
116
|
+
return false;
|
|
117
|
+
// Each row by the address `asHub` gives it, which is the one New keeps.
|
|
118
|
+
const want = repo.full_name.toLowerCase();
|
|
119
|
+
return !listed.repos.some((r) => `github.com/${r.owner}/${r.name}`.toLowerCase() === want);
|
|
120
|
+
}
|
|
121
|
+
if (isForge(repo)) {
|
|
122
|
+
if (!now.forge)
|
|
123
|
+
return false;
|
|
124
|
+
const want = repo.name.toLowerCase();
|
|
125
|
+
return !now.forge.some((n) => n.toLowerCase() === want);
|
|
126
|
+
}
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
const syncingKey = (org) => `hanzo.build.sync.${org ?? 'none'}`;
|
|
130
|
+
export function readPending(org) {
|
|
131
|
+
try {
|
|
132
|
+
const raw = window.sessionStorage.getItem(syncingKey(org));
|
|
133
|
+
const v = raw ? JSON.parse(raw) : [];
|
|
134
|
+
if (!Array.isArray(v))
|
|
135
|
+
return [];
|
|
136
|
+
return v.filter((p) => Boolean(p) && typeof p === 'object' && typeof p.fullName === 'string' && p.fullName !== '' && typeof p.name === 'string' && p.name !== '');
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
export function writePending(org, rows) {
|
|
143
|
+
try {
|
|
144
|
+
if (rows.length === 0)
|
|
145
|
+
window.sessionStorage.removeItem(syncingKey(org));
|
|
146
|
+
else
|
|
147
|
+
window.sessionStorage.setItem(syncingKey(org), JSON.stringify(rows));
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
/* the table then omits the in-flight rows */
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a hanzo.id access token says, read without trusting it for anything the
|
|
3
|
+
* platform does not check again.
|
|
4
|
+
*/
|
|
5
|
+
/** The token's claims, or null when it is not a JWT. */
|
|
6
|
+
export declare function claims(token: string | null): Record<string, unknown> | null;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the token says its person administers `org`: owner or admin, read off
|
|
9
|
+
* the token's own `orgs` claim — never the reserved `admin` org, which is
|
|
10
|
+
* platform authority and not what a builder decides anything by. The platform
|
|
11
|
+
* enforces it again; this only decides which controls are offered.
|
|
12
|
+
*/
|
|
13
|
+
export declare function administers(token: string | null, org: string | null): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a hanzo.id access token says, read without trusting it for anything the
|
|
3
|
+
* platform does not check again.
|
|
4
|
+
*/
|
|
5
|
+
/** The token's claims, or null when it is not a JWT. */
|
|
6
|
+
export function claims(token) {
|
|
7
|
+
if (!token)
|
|
8
|
+
return null;
|
|
9
|
+
try {
|
|
10
|
+
const part = token.split('.')[1];
|
|
11
|
+
if (!part)
|
|
12
|
+
return null;
|
|
13
|
+
return JSON.parse(atob(part.replace(/-/g, '+').replace(/_/g, '/')));
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** The coarse IAM roles that administer an org: its owner and its admins. */
|
|
20
|
+
const ADMIN = ['owner', 'admin'];
|
|
21
|
+
/**
|
|
22
|
+
* Whether the token says its person administers `org`: owner or admin, read off
|
|
23
|
+
* the token's own `orgs` claim — never the reserved `admin` org, which is
|
|
24
|
+
* platform authority and not what a builder decides anything by. The platform
|
|
25
|
+
* enforces it again; this only decides which controls are offered.
|
|
26
|
+
*/
|
|
27
|
+
export function administers(token, org) {
|
|
28
|
+
if (!org)
|
|
29
|
+
return false;
|
|
30
|
+
const set = claims(token)?.orgs;
|
|
31
|
+
return (Array.isArray(set) ? set : []).some((r) => {
|
|
32
|
+
const m = r;
|
|
33
|
+
return m?.org === org && ADMIN.includes(m.role);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Copy text; true once it is on the clipboard, false where the browser has none or refuses it (nothing is thrown). */
|
|
2
|
+
export const copy = async (text) => {
|
|
3
|
+
try {
|
|
4
|
+
await navigator.clipboard.writeText(text);
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Cast } from '../api/agents.ts';
|
|
2
|
+
import { type Pane } from './ui.tsx';
|
|
3
|
+
/** Categories as Browse offers them: the default agents' first, as listed, then the rest by how many each holds. */
|
|
4
|
+
export declare function kinds(first: readonly Cast[], rest: readonly Cast[]): string[];
|
|
5
|
+
export declare function Agents({ view, q, adding, onAdding, onView, onCount, mode }: Pane & {
|
|
6
|
+
mode?: 'agents' | 'bots';
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
/** One agent's page: who it is, what it runs on and reads, what it may call and spend, and what it has done. */
|
|
9
|
+
export declare function Profile({ name }: {
|
|
10
|
+
name: string;
|
|
11
|
+
}): import("react").JSX.Element;
|