@fallen-8/studio 0.0.32
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/README.md +93 -0
- package/dist-lib/Canvas3D-C5og4ZIQ.js +62011 -0
- package/dist-lib/F8GraphCanvas-Db7vzDtJ.js +11085 -0
- package/dist-lib/abap-Bs8kvjsq.js +1398 -0
- package/dist-lib/apex-Dspwrl5m.js +326 -0
- package/dist-lib/azcli-k1BiOau1.js +68 -0
- package/dist-lib/bat-BIP72KWc.js +100 -0
- package/dist-lib/bicep-VhQeYhS3.js +102 -0
- package/dist-lib/cameligo-DnuAXtHg.js +174 -0
- package/dist-lib/canvas.js +13 -0
- package/dist-lib/clojure-BAuDPsal.js +761 -0
- package/dist-lib/coffee-BV06qSnj.js +232 -0
- package/dist-lib/cpp-Cz8Jeyrf.js +389 -0
- package/dist-lib/csharp-F6hhlXFb.js +326 -0
- package/dist-lib/csp-KzlEHCyI.js +53 -0
- package/dist-lib/css-e4FKntZ3.js +187 -0
- package/dist-lib/cssMode-Czf2vRA3.js +1571 -0
- package/dist-lib/cypher-CpvDGKRr.js +263 -0
- package/dist-lib/dart-DdHeFWR0.js +281 -0
- package/dist-lib/dockerfile-aoNXDcio.js +130 -0
- package/dist-lib/ecl-C4Q0DYuA.js +456 -0
- package/dist-lib/elixir-C9X42b0T.js +569 -0
- package/dist-lib/f8-studio.css +1 -0
- package/dist-lib/f8-studio.js +16 -0
- package/dist-lib/flow9-Bff42pfB.js +142 -0
- package/dist-lib/freemarker2-BtInkOsd.js +989 -0
- package/dist-lib/fsharp-C6vPAsHG.js +217 -0
- package/dist-lib/go-DEr8zx9f.js +218 -0
- package/dist-lib/graphql-BiNBBRFh.js +151 -0
- package/dist-lib/handlebars-UwZ7mBGA.js +419 -0
- package/dist-lib/hcl-2T9lKuFg.js +183 -0
- package/dist-lib/html-BXX93YIe.js +308 -0
- package/dist-lib/htmlMode-BCqQu1PO.js +1581 -0
- package/dist-lib/index-DFm6T7Un.js +132450 -0
- package/dist-lib/ini-CZGtssYM.js +71 -0
- package/dist-lib/java-B260NeH3.js +232 -0
- package/dist-lib/javascript-CK1z7Ynl.js +70 -0
- package/dist-lib/jsonMode-C4Q3fVvV.js +1996 -0
- package/dist-lib/julia-kuNLM9c5.js +511 -0
- package/dist-lib/kotlin-Bz6kAefA.js +253 -0
- package/dist-lib/less-AZUtS89I.js +162 -0
- package/dist-lib/lexon-BcmgnyRb.js +157 -0
- package/dist-lib/liquid-BnCUERBj.js +240 -0
- package/dist-lib/lua-Dz1RbATg.js +162 -0
- package/dist-lib/m3-CIMooLFn.js +210 -0
- package/dist-lib/markdown-C1BsCK9P.js +229 -0
- package/dist-lib/mdx-D2enmFMs.js +165 -0
- package/dist-lib/mips-BovsnfLQ.js +198 -0
- package/dist-lib/msdax-CiRB2ZB-.js +375 -0
- package/dist-lib/mysql-BwdpPE19.js +878 -0
- package/dist-lib/objective-c-D4nfHfso.js +183 -0
- package/dist-lib/pascal--j5-PYtz.js +251 -0
- package/dist-lib/pascaligo-C7TcJxNL.js +164 -0
- package/dist-lib/perl-BzEWqUb5.js +626 -0
- package/dist-lib/pgsql-B_KZ0mGX.js +851 -0
- package/dist-lib/php-A19QHzQV.js +500 -0
- package/dist-lib/pla-COeKY1hA.js +137 -0
- package/dist-lib/postiats-BfMp7zJL.js +907 -0
- package/dist-lib/powerquery-B0TS_5Gb.js +890 -0
- package/dist-lib/powershell-5jSbKdYB.js +239 -0
- package/dist-lib/protobuf-YgnOutn3.js +420 -0
- package/dist-lib/pug-DLej6kn5.js +402 -0
- package/dist-lib/python-DJvSF53q.js +301 -0
- package/dist-lib/qsharp-AhjqtSHB.js +301 -0
- package/dist-lib/r-D-F4P80w.js +243 -0
- package/dist-lib/razor-RerkagjP.js +550 -0
- package/dist-lib/redis-hwwIlMnV.js +302 -0
- package/dist-lib/redshift-Bcm_kjEG.js +809 -0
- package/dist-lib/restructuredtext-CrdzfPP-.js +174 -0
- package/dist-lib/ruby-QC2UNm1s.js +511 -0
- package/dist-lib/rust-5aqiQ3L5.js +343 -0
- package/dist-lib/sb-B1g1ZfLJ.js +115 -0
- package/dist-lib/scala-C2U4R5Gb.js +370 -0
- package/dist-lib/scheme-DeFRbslr.js +108 -0
- package/dist-lib/scss-RSTCiCmI.js +262 -0
- package/dist-lib/shell-BpF-iNu8.js +221 -0
- package/dist-lib/solidity-C00r2mbQ.js +1367 -0
- package/dist-lib/sophia-DVW5ZKDB.js +199 -0
- package/dist-lib/sparql-B0nmpxeX.js +201 -0
- package/dist-lib/sql-CJwKPERn.js +853 -0
- package/dist-lib/st-DPlKG5DT.js +416 -0
- package/dist-lib/swift-YZBAbVHV.js +309 -0
- package/dist-lib/systemverilog-CDQSaH63.js +576 -0
- package/dist-lib/tcl-Dlu8sp6Q.js +232 -0
- package/dist-lib/tsMode-C-6d-f_-.js +886 -0
- package/dist-lib/twig-C5TO7-kw.js +392 -0
- package/dist-lib/types/api/changefeed.d.ts +113 -0
- package/dist-lib/types/api/client.d.ts +81 -0
- package/dist-lib/types/api/endpoints.d.ts +197 -0
- package/dist-lib/types/api/queries.d.ts +8 -0
- package/dist-lib/types/api/types.d.ts +1032 -0
- package/dist-lib/types/app/AppShell.d.ts +10 -0
- package/dist-lib/types/app/NamespaceScope.d.ts +11 -0
- package/dist-lib/types/app/applyStudioConfig.d.ts +18 -0
- package/dist-lib/types/app/mount.d.ts +19 -0
- package/dist-lib/types/app/nav.d.ts +91 -0
- package/dist-lib/types/app/routes.d.ts +9 -0
- package/dist-lib/types/app/studioConfig.d.ts +106 -0
- package/dist-lib/types/canvas/Canvas2D.d.ts +18 -0
- package/dist-lib/types/canvas/Canvas3D.d.ts +14 -0
- package/dist-lib/types/canvas/ConnectPanel.d.ts +10 -0
- package/dist-lib/types/canvas/FindPanel.d.ts +14 -0
- package/dist-lib/types/canvas/GraphCanvas.d.ts +66 -0
- package/dist-lib/types/canvas/StylePanel.d.ts +7 -0
- package/dist-lib/types/canvas/eclipse.d.ts +136 -0
- package/dist-lib/types/canvas/imageAssets.d.ts +3 -0
- package/dist-lib/types/canvas/styleConfig.d.ts +48 -0
- package/dist-lib/types/canvas/styleEngine.d.ts +125 -0
- package/dist-lib/types/canvas/styling.d.ts +15 -0
- package/dist-lib/types/components/AdjacencyPanel.d.ts +11 -0
- package/dist-lib/types/components/AnalyticsRunner.d.ts +1 -0
- package/dist-lib/types/components/ConfigurationPanel.d.ts +1 -0
- package/dist-lib/types/components/ConfirmDialog.d.ts +18 -0
- package/dist-lib/types/components/DurabilityNotice.d.ts +18 -0
- package/dist-lib/types/components/ElementDetail.d.ts +11 -0
- package/dist-lib/types/components/ElementTable.d.ts +19 -0
- package/dist-lib/types/components/EmbeddingsTab.d.ts +15 -0
- package/dist-lib/types/components/ErrorBox.d.ts +8 -0
- package/dist-lib/types/components/EventFeedBell.d.ts +16 -0
- package/dist-lib/types/components/EventFeedPanel.d.ts +10 -0
- package/dist-lib/types/components/Field.d.ts +14 -0
- package/dist-lib/types/components/GraphShapePanel.d.ts +1 -0
- package/dist-lib/types/components/InspectLink.d.ts +5 -0
- package/dist-lib/types/components/ListCapNote.d.ts +10 -0
- package/dist-lib/types/components/MutationsPanel.d.ts +1 -0
- package/dist-lib/types/components/NamespaceSwitcher.d.ts +22 -0
- package/dist-lib/types/components/NamespacesPanel.d.ts +11 -0
- package/dist-lib/types/components/NeighborhoodPreview.d.ts +10 -0
- package/dist-lib/types/components/PluginsPanel.d.ts +9 -0
- package/dist-lib/types/components/PropertiesTab.d.ts +4 -0
- package/dist-lib/types/components/PropertyListEditor.d.ts +26 -0
- package/dist-lib/types/components/SampleGraphsPanel.d.ts +3 -0
- package/dist-lib/types/components/SectionHelp.d.ts +11 -0
- package/dist-lib/types/components/SemanticBlockEditor.d.ts +29 -0
- package/dist-lib/types/components/SemanticQueryEditor.d.ts +15 -0
- package/dist-lib/types/components/SettingRow.d.ts +15 -0
- package/dist-lib/types/components/Stat.d.ts +10 -0
- package/dist-lib/types/components/StoredQueriesPanel.d.ts +14 -0
- package/dist-lib/types/components/StoredQueryControls.d.ts +29 -0
- package/dist-lib/types/components/Truncated.d.ts +17 -0
- package/dist-lib/types/components/TruncationBadge.d.ts +6 -0
- package/dist-lib/types/components/TypedLiteralEditor.d.ts +13 -0
- package/dist-lib/types/components/VertexFilterSlot.d.ts +25 -0
- package/dist-lib/types/delegate/DelegateEditor.d.ts +10 -0
- package/dist-lib/types/delegate/DelegateSlot.d.ts +18 -0
- package/dist-lib/types/delegate/editorOptions.d.ts +25 -0
- package/dist-lib/types/delegate/kinds.d.ts +19 -0
- package/dist-lib/types/delegate/markers.d.ts +21 -0
- package/dist-lib/types/delegate/monacoSetup.d.ts +3 -0
- package/dist-lib/types/delegate/nl/NlAssistPanel.d.ts +10 -0
- package/dist-lib/types/delegate/nl/NlBackendConfig.d.ts +12 -0
- package/dist-lib/types/delegate/nl/NlDraftList.d.ts +42 -0
- package/dist-lib/types/delegate/nl/config.d.ts +105 -0
- package/dist-lib/types/delegate/nl/feedback.d.ts +30 -0
- package/dist-lib/types/delegate/nl/format.d.ts +6 -0
- package/dist-lib/types/delegate/nl/generate.d.ts +57 -0
- package/dist-lib/types/delegate/nl/prompt.d.ts +21 -0
- package/dist-lib/types/delegate/nl/useNlRun.d.ts +24 -0
- package/dist-lib/types/delegate/providers.d.ts +26 -0
- package/dist-lib/types/delegate/snippets.d.ts +25 -0
- package/dist-lib/types/embed/F8GraphCanvas.d.ts +37 -0
- package/dist-lib/types/embed/canvas.d.ts +23 -0
- package/dist-lib/types/embed/index.d.ts +14 -0
- package/dist-lib/types/firstrun/FirstRunOverlay.d.ts +10 -0
- package/dist-lib/types/firstrun/FirstRunShow.d.ts +22 -0
- package/dist-lib/types/firstrun/beats.d.ts +23 -0
- package/dist-lib/types/firstrun/firstRunStore.d.ts +38 -0
- package/dist-lib/types/firstrun/mockGraph.d.ts +56 -0
- package/dist-lib/types/firstrun/useBeatTimeline.d.ts +35 -0
- package/dist-lib/types/firstrun/useReducedMotion.d.ts +7 -0
- package/dist-lib/types/instances/registry.d.ts +83 -0
- package/dist-lib/types/instances/types.d.ts +49 -0
- package/dist-lib/types/lib/canvasCap.d.ts +7 -0
- package/dist-lib/types/lib/connectPaths.d.ts +55 -0
- package/dist-lib/types/lib/embeddingProperties.d.ts +6 -0
- package/dist-lib/types/lib/fieldHelp.d.ts +139 -0
- package/dist-lib/types/lib/format.d.ts +16 -0
- package/dist-lib/types/lib/hydrate.d.ts +37 -0
- package/dist-lib/types/lib/indexCapabilities.d.ts +17 -0
- package/dist-lib/types/lib/jsonlGraph.d.ts +42 -0
- package/dist-lib/types/lib/listCaps.d.ts +48 -0
- package/dist-lib/types/lib/literals.d.ts +36 -0
- package/dist-lib/types/lib/namespaceName.d.ts +10 -0
- package/dist-lib/types/lib/neighborhood.d.ts +37 -0
- package/dist-lib/types/lib/patternValidation.d.ts +12 -0
- package/dist-lib/types/lib/restartCopy.d.ts +11 -0
- package/dist-lib/types/lib/sampleLoader.d.ts +95 -0
- package/dist-lib/types/lib/samples.d.ts +87 -0
- package/dist-lib/types/lib/sbomGraph.d.ts +58 -0
- package/dist-lib/types/lib/sectionHelp.d.ts +39 -0
- package/dist-lib/types/lib/semantic.d.ts +95 -0
- package/dist-lib/types/lib/storedQueries.d.ts +43 -0
- package/dist-lib/types/lib/truncate.d.ts +34 -0
- package/dist-lib/types/lib/truncation.d.ts +7 -0
- package/dist-lib/types/lib/vector.d.ts +13 -0
- package/dist-lib/types/main.d.ts +1 -0
- package/dist-lib/types/plugin/PluginEditor.d.ts +20 -0
- package/dist-lib/types/plugin/nl/PluginNlAssistPanel.d.ts +13 -0
- package/dist-lib/types/plugin/nl/pluginPrompt.d.ts +48 -0
- package/dist-lib/types/plugin/scaffolds.d.ts +26 -0
- package/dist-lib/types/screens/AnalyticsScreen.d.ts +8 -0
- package/dist-lib/types/screens/BenchmarkScreen.d.ts +1 -0
- package/dist-lib/types/screens/BrowserScreen.d.ts +6 -0
- package/dist-lib/types/screens/CanvasScreen.d.ts +10 -0
- package/dist-lib/types/screens/ConnectScreen.d.ts +1 -0
- package/dist-lib/types/screens/DashboardScreen.d.ts +13 -0
- package/dist-lib/types/screens/IndexesScreen.d.ts +8 -0
- package/dist-lib/types/screens/IntegrationsScreen.d.ts +14 -0
- package/dist-lib/types/screens/KnowledgeScreen.d.ts +1 -0
- package/dist-lib/types/screens/PathScreen.d.ts +9 -0
- package/dist-lib/types/screens/PluginsScreen.d.ts +1 -0
- package/dist-lib/types/screens/QueryScreen.d.ts +1 -0
- package/dist-lib/types/screens/SamplesScreen.d.ts +7 -0
- package/dist-lib/types/screens/SaveGamesScreen.d.ts +7 -0
- package/dist-lib/types/screens/SubgraphScreen.d.ts +1 -0
- package/dist-lib/types/state/eventFeed.d.ts +63 -0
- package/dist-lib/types/state/feedFilter.d.ts +42 -0
- package/dist-lib/types/state/graphShape.d.ts +37 -0
- package/dist-lib/types/state/instanceStore.d.ts +280 -0
- package/dist-lib/types/state/integrations.d.ts +25 -0
- package/dist-lib/types/state/liveFeed.d.ts +37 -0
- package/dist-lib/types/state/scopeKey.d.ts +8 -0
- package/dist-lib/types/state/status.d.ts +21 -0
- package/dist-lib/typescript-aCo3H3H0.js +343 -0
- package/dist-lib/typespec-BsmjDEu7.js +117 -0
- package/dist-lib/vb-ChHvIDrk.js +372 -0
- package/dist-lib/wgsl-XEp1ju8c.js +439 -0
- package/dist-lib/xml-CSt-F-dl.js +95 -0
- package/dist-lib/yaml-kSsc3ru_.js +206 -0
- package/package.json +98 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type SemanticDraft } from "../lib/semantic";
|
|
2
|
+
/**
|
|
3
|
+
* The Path screen's declarative semantic block (feature element-embeddings): the shared
|
|
4
|
+
* query core (SemanticQueryEditor) plus the block-local minScore filter and
|
|
5
|
+
* costBySimilarity cost. Pure data — it compiles no C#, so it expresses similarity
|
|
6
|
+
* filtering without writing a fragment. The Subgraph screen does not use this block: there
|
|
7
|
+
* the thresholds live on the vertex-filter slots themselves (feature
|
|
8
|
+
* subgraph-semantic-thresholds).
|
|
9
|
+
* Full rules: features/done/element-embeddings README.
|
|
10
|
+
*
|
|
11
|
+
* Controlled: the parent owns the SemanticDraft and derives which delegate slots to
|
|
12
|
+
* disable from semanticOwnsVertex{Filter,Cost}.
|
|
13
|
+
*/
|
|
14
|
+
export declare function SemanticBlockEditor({ draft, onChange, allowCost, costDisabledReason, providerEnabled, embeddingNames, idPrefix, disabled, disabledReason, }: {
|
|
15
|
+
draft: SemanticDraft;
|
|
16
|
+
onChange: (patch: Partial<SemanticDraft>) => void;
|
|
17
|
+
/** costBySimilarity is a path concept; false disables the cost slot entirely. */
|
|
18
|
+
allowCost: boolean;
|
|
19
|
+
/** When set (e.g. algorithm is BLS, which ignores costs), the cost checkbox is disabled
|
|
20
|
+
* with this reason — distinct from the internal DotProduct rule. */
|
|
21
|
+
costDisabledReason?: string;
|
|
22
|
+
/** Resolved provider state; null = unknown (no graph shape computed yet). */
|
|
23
|
+
providerEnabled: boolean | null;
|
|
24
|
+
embeddingNames: string[];
|
|
25
|
+
idPrefix: string;
|
|
26
|
+
/** e.g. a stored template is selected — the block cannot apply. */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
disabledReason?: string;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SemanticQueryDraft } from "../lib/semantic";
|
|
2
|
+
/**
|
|
3
|
+
* The semantic QUERY fields (source, vector/text, embedding name, metric) — the one query
|
|
4
|
+
* every semantic decision of a request scores against. Extracted so the Path screen's
|
|
5
|
+
* block editor and the Subgraph screen's per-request query section render exactly one
|
|
6
|
+
* implementation. Pure data — it compiles no C#.
|
|
7
|
+
*/
|
|
8
|
+
export declare function SemanticQueryEditor({ query, onChange, providerEnabled, embeddingNames, idPrefix, }: {
|
|
9
|
+
query: SemanticQueryDraft;
|
|
10
|
+
onChange: (patch: Partial<SemanticQueryDraft>) => void;
|
|
11
|
+
/** Resolved provider state; null = unknown (no graph shape computed yet). */
|
|
12
|
+
providerEnabled: boolean | null;
|
|
13
|
+
embeddingNames: string[];
|
|
14
|
+
idPrefix: string;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SettingREST } from "../api/types";
|
|
2
|
+
/** The environment-variable spelling an operator has to remove to manage a key here instead. */
|
|
3
|
+
export declare function environmentSpelling(key: string): string;
|
|
4
|
+
export declare function isEnvironmentLocked(setting: SettingREST): boolean;
|
|
5
|
+
/** A stable, key-derived handle: Fallen8:Plugins:MaxCount -> config-setting-fallen8-plugins-maxcount. */
|
|
6
|
+
export declare function settingTestId(key: string): string;
|
|
7
|
+
export declare const SettingRow: import("react").NamedExoticComponent<{
|
|
8
|
+
setting: SettingREST;
|
|
9
|
+
/** The unsaved value, or undefined when this row is untouched. */
|
|
10
|
+
draft?: string | null;
|
|
11
|
+
onChange: (key: string, value: string) => void;
|
|
12
|
+
onClear: (key: string) => void;
|
|
13
|
+
/** True when the whole editable region is gated off (an embed host locked it). */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One labeled stat cell (Dashboard counts, benchmark results, Graph shape numbers, and
|
|
3
|
+
* value tiles fed user/algorithm-controlled strings such as the embedding model id or an
|
|
4
|
+
* analytics statistic key). Both lines truncate with a full-value title so an unbounded
|
|
5
|
+
* label or value can never overflow the fixed-width tile.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Stat({ label, value }: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StoredQueryKind } from "../api/types";
|
|
2
|
+
/**
|
|
3
|
+
* Kind-scoped stored-query management (concept spec §5.3): a stored query is unique to its
|
|
4
|
+
* scenario — Path or SubGraph — so its management home lives on that scenario's screen, next
|
|
5
|
+
* to the fragments it captures. The panel lists ONLY entries of `kind`, with read-only source,
|
|
6
|
+
* recompile diagnostics, delete (immutable entries: delete + re-register is the edit flow),
|
|
7
|
+
* and a **Use** action that selects the entry into this screen's own filter picker. Capture
|
|
8
|
+
* ("Save as stored query…") lives in the inline advanced tier of the same screen.
|
|
9
|
+
*/
|
|
10
|
+
export declare function StoredQueriesPanel({ kind, onUse, }: {
|
|
11
|
+
kind: StoredQueryKind;
|
|
12
|
+
/** Select this entry into the host screen's filter picker (stored source + name). */
|
|
13
|
+
onUse: (name: string) => void;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { StoredPathQueryBlock, StoredQueryKind, StoredSubGraphQueryBlock } from "../api/types";
|
|
2
|
+
import type { InstanceConfig } from "../instances/types";
|
|
3
|
+
import type { FilterSource } from "../state/instanceStore";
|
|
4
|
+
/**
|
|
5
|
+
* Stored-query surfaces shared by Path and Subgraph (concept spec §5.1/5.2): the
|
|
6
|
+
* inline|stored source toggle, the kind-filtered picker with a read-only fragment
|
|
7
|
+
* preview, and the "Save as stored query…" capture dialog. Management (list, source,
|
|
8
|
+
* delete) lives in the kind-scoped Stored queries panel below on the same screen — the
|
|
9
|
+
* picker only points there.
|
|
10
|
+
*/
|
|
11
|
+
export declare const REGISTRATION_401 = "registration requires the instance's API key \u2014 configure it on the Connect screen";
|
|
12
|
+
export declare function FilterSourceToggle({ value, onChange, }: {
|
|
13
|
+
value: FilterSource;
|
|
14
|
+
onChange: (source: FilterSource) => void;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function StoredQueryPicker({ instance, kind, value, onChange, }: {
|
|
17
|
+
instance: InstanceConfig;
|
|
18
|
+
kind: StoredQueryKind;
|
|
19
|
+
value: string;
|
|
20
|
+
onChange: (name: string) => void;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
export declare function SaveAsStoredQuery({ instance, kind, buildBlock, disabled, disabledReason, onSaved, }: {
|
|
23
|
+
instance: InstanceConfig;
|
|
24
|
+
kind: StoredQueryKind;
|
|
25
|
+
buildBlock: () => StoredPathQueryBlock | StoredSubGraphQueryBlock;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
disabledReason?: string;
|
|
28
|
+
onSaved: (name: string) => void;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a possibly-unbounded, user-controlled string clipped so it cannot blow out the
|
|
3
|
+
* view, with the FULL value in the native title tooltip so nothing is lost. The one home for
|
|
4
|
+
* "don't let user text destroy the layout" (feature graph-namespaces follow-up).
|
|
5
|
+
*
|
|
6
|
+
* Two modes:
|
|
7
|
+
* - `max` given → a deterministic CHAR cap via {@link truncateChars} (chrome, headings,
|
|
8
|
+
* table cells without a fixed layout). Pass `middle` for path/URL-shaped values.
|
|
9
|
+
* - `max` omitted → CSS ellipsis (`truncate`): the element must sit in a width-bounded flex
|
|
10
|
+
* parent (`min-w-0`, and usually `flex-1`), which adapts to the available space.
|
|
11
|
+
*/
|
|
12
|
+
export declare function Truncated({ text, max, middle, className, }: {
|
|
13
|
+
text: string;
|
|
14
|
+
max?: number;
|
|
15
|
+
middle?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type TypedValue } from "../lib/literals";
|
|
2
|
+
import type { FieldHelpKey } from "../lib/fieldHelp";
|
|
3
|
+
/**
|
|
4
|
+
* Typed-literal input (FR-9): a type selector + a validated value field, replacing
|
|
5
|
+
* free-text JSON everywhere the API takes { value | propertyValue, fullQualifiedTypeName }.
|
|
6
|
+
*/
|
|
7
|
+
export declare function TypedLiteralEditor({ label, value, onChange, idPrefix, helpKey, }: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: TypedValue;
|
|
10
|
+
onChange: (value: TypedValue) => void;
|
|
11
|
+
idPrefix: string;
|
|
12
|
+
helpKey?: FieldHelpKey;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { InstanceConfig } from "../instances/types";
|
|
2
|
+
import { type SemanticMetric, type SlotMode } from "../lib/semantic";
|
|
3
|
+
/**
|
|
4
|
+
* A vertex-filter SLOT with its three fill modes (feature subgraph-semantic-thresholds):
|
|
5
|
+
* match everything, a compiled C# fragment, or a declarative semantic threshold against
|
|
6
|
+
* the request's semantic query. One owner per slot is structural here — the mode chooser
|
|
7
|
+
* replaces the old "disabled with a reason" dance, and an inert semantic configuration
|
|
8
|
+
* cannot be expressed. Used for the subgraph top-level vertex pre-filter and for every
|
|
9
|
+
* Vertex pattern step.
|
|
10
|
+
*/
|
|
11
|
+
export declare function VertexFilterSlot({ instance, idPrefix, label, contextLabel, mode, onModeChange, fragment, onFragmentChange, minScore, onMinScoreChange, metric, }: {
|
|
12
|
+
instance: InstanceConfig;
|
|
13
|
+
idPrefix: string;
|
|
14
|
+
label: string;
|
|
15
|
+
contextLabel: string;
|
|
16
|
+
mode: SlotMode;
|
|
17
|
+
onModeChange: (mode: SlotMode) => void;
|
|
18
|
+
fragment: string;
|
|
19
|
+
onFragmentChange: (fragment: string) => void;
|
|
20
|
+
/** Threshold text (parsed on build; non-finite blocks submit upstream). */
|
|
21
|
+
minScore: string;
|
|
22
|
+
onMinScoreChange: (minScore: string) => void;
|
|
23
|
+
/** The request's semantic metric — decides whether the threshold is a floor or a ceiling. */
|
|
24
|
+
metric: SemanticMetric;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DelegateKind } from "../api/types";
|
|
2
|
+
import type { InstanceConfig } from "../instances/types";
|
|
3
|
+
export declare function DelegateEditor({ instance, delegateKind, contextLabel, initialFragment, onCommit, onCancel, }: {
|
|
4
|
+
instance: InstanceConfig;
|
|
5
|
+
delegateKind: DelegateKind;
|
|
6
|
+
contextLabel: string;
|
|
7
|
+
initialFragment: string;
|
|
8
|
+
onCommit: (fragment: string) => void;
|
|
9
|
+
onCancel: () => void;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DelegateKind } from "../api/types";
|
|
2
|
+
import type { InstanceConfig } from "../instances/types";
|
|
3
|
+
/**
|
|
4
|
+
* A fragment slot (FR-13/16): shows the committed fragment (or "empty = match all") and
|
|
5
|
+
* opens the shared editor modal. Slots only ever hold fragments that passed validation
|
|
6
|
+
* (or empty) because the editor blocks commit otherwise (FR-25).
|
|
7
|
+
*/
|
|
8
|
+
export declare function DelegateSlot({ instance, delegateKind, label, contextLabel, value, onChange, disabled, disabledReason, }: {
|
|
9
|
+
instance: InstanceConfig;
|
|
10
|
+
delegateKind: DelegateKind;
|
|
11
|
+
label: string;
|
|
12
|
+
contextLabel: string;
|
|
13
|
+
value: string;
|
|
14
|
+
onChange: (fragment: string) => void;
|
|
15
|
+
/** When true (the semantic block owns this slot), the slot is inert with a reason. */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
disabledReason?: string;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { editor } from "monaco-editor";
|
|
2
|
+
/**
|
|
3
|
+
* The monaco options shared by every Studio editor surface (the delegate fragment editor and
|
|
4
|
+
* the plugin source editor). One home: the two option blocks were byte-identical and must not
|
|
5
|
+
* drift. Module scope also gives them a stable identity, so the react wrapper does not re-run
|
|
6
|
+
* updateOptions on every render.
|
|
7
|
+
*
|
|
8
|
+
* `occurrencesHighlight: "off"` is load-bearing, not cosmetic. monaco 0.52 through 0.55 arm a
|
|
9
|
+
* 50 ms `Delayer` for that feature on every cursor move and DISCARD the promise it returns
|
|
10
|
+
* (wordHighlighter.js:184 and :192); disposing the editor inside that window rejects the
|
|
11
|
+
* orphaned promise with a `CancellationError` whose name and message are both "Canceled"
|
|
12
|
+
* (async.js:219). Nothing outside monaco holds that promise, so nothing can catch it: it
|
|
13
|
+
* escapes as an unhandled rejection into the page - and Studio embeds into someone else's
|
|
14
|
+
* page, whose error reporting then owns our noise. Upstream calls it a bug
|
|
15
|
+
* (microsoft/monaco-editor#4702, #4859) and fixed it in 0.56.0 by attaching the handler those
|
|
16
|
+
* two lines forgot. With the option "off" both trigger sites early-return
|
|
17
|
+
* (wordHighlighter.js:179 and :187), so the promise is never created and disposing the delayer
|
|
18
|
+
* is a no-op. Measured before the change: closing the editor 31-50 ms after a keystroke leaked
|
|
19
|
+
* the rejection in 16 of 20 runs; after it, 0 of 40. It also costs nothing to lose: these
|
|
20
|
+
* editors hold a one-to-three line lambda or a single plugin type, where highlighting the
|
|
21
|
+
* other occurrences of the word under the cursor buys nothing, and it drops a debounce plus a
|
|
22
|
+
* full-model findMatches per cursor move. Keep the option when monaco is upgraded past 0.56.0;
|
|
23
|
+
* delete the upstream half of this note then.
|
|
24
|
+
*/
|
|
25
|
+
export declare const F8_EDITOR_OPTIONS: editor.IStandaloneEditorConstructionOptions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DelegateKind } from "../api/types";
|
|
2
|
+
/**
|
|
3
|
+
* Per-kind editing contract (spec §6.1): parameter name/type, lambda shape, usings, and
|
|
4
|
+
* the opening snippet. Every subgraph/path filter slot is typed (feature
|
|
5
|
+
* subgraph-typed-filters); GraphElementFilter is no longer produced by any slot but stays
|
|
6
|
+
* validatable on /delegates/validate — removal trigger in that feature's spec.
|
|
7
|
+
*/
|
|
8
|
+
export interface KindInfo {
|
|
9
|
+
kind: DelegateKind;
|
|
10
|
+
parameterName: string;
|
|
11
|
+
parameterType: "VertexModel" | "EdgeModel" | "AGraphElementModel" | "string";
|
|
12
|
+
returnType: "bool" | "double";
|
|
13
|
+
lambdaShape: string;
|
|
14
|
+
usings: string[];
|
|
15
|
+
openingSnippet: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const KIND_INFO: Record<DelegateKind, KindInfo>;
|
|
18
|
+
/** The canonical property-access idiom taught via snippets and the NL prompt (spec §6.2). */
|
|
19
|
+
export declare const TRY_GET_PROPERTY_IDIOM = "return (v) => v.TryGetProperty(out int age, \"age\") && age > 30;";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DelegateDiagnostic } from "../api/types";
|
|
2
|
+
/**
|
|
3
|
+
* Converts server diagnostics into Monaco marker data. The server already mapped
|
|
4
|
+
* positions to fragment coordinates (backend DelegateValidationHelper), so lines and
|
|
5
|
+
* columns pass through VERBATIM - re-mapping here is the off-by-N bug FR-24 forbids.
|
|
6
|
+
* Severity constants match monaco.MarkerSeverity (Error=8, Warning=4, Info=2).
|
|
7
|
+
*/
|
|
8
|
+
export declare const MARKER_SEVERITY: {
|
|
9
|
+
readonly error: 8;
|
|
10
|
+
readonly warning: 4;
|
|
11
|
+
readonly info: 2;
|
|
12
|
+
};
|
|
13
|
+
export interface MarkerData {
|
|
14
|
+
startLineNumber: number;
|
|
15
|
+
startColumn: number;
|
|
16
|
+
endLineNumber: number;
|
|
17
|
+
endColumn: number;
|
|
18
|
+
message: string;
|
|
19
|
+
severity: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function diagnosticsToMarkers(diagnostics: DelegateDiagnostic[]): MarkerData[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DelegateKind, DelegateValidationResult } from "../../api/types";
|
|
2
|
+
interface NlAssistPanelProps {
|
|
3
|
+
delegateKind: DelegateKind;
|
|
4
|
+
currentFragment: string;
|
|
5
|
+
onDraft: (code: string) => void;
|
|
6
|
+
validateDraft: (code: string) => Promise<DelegateValidationResult | null>;
|
|
7
|
+
drivingRef: React.MutableRefObject<boolean>;
|
|
8
|
+
}
|
|
9
|
+
export declare const NlAssistPanel: (props: NlAssistPanelProps) => import("react").ReactElement<NlAssistPanelProps, string | import("react").JSXElementConstructor<any>> | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type NlAssistConfig } from "./config";
|
|
2
|
+
/**
|
|
3
|
+
* The model-backend configuration form (nl-assist spec §4 / nl-assist-ux). Extracted so the
|
|
4
|
+
* fragment editor (NlAssistPanel) and the whole-type plugin editor (PluginNlAssistPanel) share
|
|
5
|
+
* ONE backend config UI over the same persisted store — the "one home per explanation" rule.
|
|
6
|
+
* Presentational only: it renders the instance/custom switch, presets, endpoint/api/model/temp,
|
|
7
|
+
* and the optional key, and reports changes back through {@link setConfig}.
|
|
8
|
+
*/
|
|
9
|
+
export declare function NlBackendConfig({ config, setConfig, }: {
|
|
10
|
+
config: NlAssistConfig;
|
|
11
|
+
setConfig: (patch: Partial<NlAssistConfig>) => void;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Verdict } from "./feedback";
|
|
3
|
+
/**
|
|
4
|
+
* The single home for the NL-assist draft list, shared by the delegate editor
|
|
5
|
+
* (NlAssistPanel) and the plugin authoring editor (PluginNlAssistPanel). It renders the
|
|
6
|
+
* small-model's drafts (the "results") with three review affordances:
|
|
7
|
+
*
|
|
8
|
+
* - **newest on top** — drafts arrive in generation order but display reversed, so the draft
|
|
9
|
+
* just produced (and loaded into the editor) is where the eye lands; "draft N" numbering
|
|
10
|
+
* stays in generation order and callbacks carry the original index, so nothing else shifts.
|
|
11
|
+
* - **its own scrollbar** — a fixed max height keeps a long run of drafts from pushing the
|
|
12
|
+
* export affordance (and, in the delegate sidebar, the rest of the panel) off screen.
|
|
13
|
+
* - **unrated drafts stand out** — a draft with no 👍/👎 verdict gets a warn-toned left bar and
|
|
14
|
+
* full-strength thumbs (a call to judge it, which feeds the fine-tune corpus); the highlight
|
|
15
|
+
* clears the instant it is rated, and returns if the rating is cleared.
|
|
16
|
+
*
|
|
17
|
+
* The panel-specific bits (label suffix, load-button title, per-attempt stats/detail slots, and
|
|
18
|
+
* the data-testid prefixes) are passed in so both panels behave identically.
|
|
19
|
+
*/
|
|
20
|
+
/** One drafted candidate, as the hosting panel wants it shown. */
|
|
21
|
+
export interface NlDraftView {
|
|
22
|
+
/** Server validation outcome: true = valid, false = invalid, null = not (yet) known. */
|
|
23
|
+
valid: boolean | null;
|
|
24
|
+
/** The user's 👍/👎 on this draft, or null until judged. */
|
|
25
|
+
verdict: Verdict | null;
|
|
26
|
+
/** True when this draft's body is the text currently loaded in the editor. */
|
|
27
|
+
active: boolean;
|
|
28
|
+
/** Hover title for the load button (e.g. the fragment text, or a generic hint). */
|
|
29
|
+
loadTitle: string;
|
|
30
|
+
/** Text appended after "draft N" — e.g. " (2 error(s))" or " (invalid)". Omit when valid. */
|
|
31
|
+
labelSuffix?: string;
|
|
32
|
+
/** Content shown below the row (the delegate panel's collapsible raw stats). */
|
|
33
|
+
below?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
export declare function NlDraftList({ testid, verdictTestidPrefix, drafts, onLoad, onRate, }: {
|
|
36
|
+
testid: string;
|
|
37
|
+
verdictTestidPrefix: string;
|
|
38
|
+
drafts: NlDraftView[];
|
|
39
|
+
/** Called with the draft's original (generation-order) index, not its display position. */
|
|
40
|
+
onLoad: (index: number) => void;
|
|
41
|
+
onRate: (index: number, verdict: Verdict) => void;
|
|
42
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type ComponentType } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* NL-assist model backend config (nl-assist spec FR-26.4, nl-assist-ux spec §2, feature
|
|
4
|
+
* instance-config). GLOBAL scope (not per-instance): it is a single browser preference for
|
|
5
|
+
* WHERE model calls go, and instance mode targets whichever instance is active.
|
|
6
|
+
*
|
|
7
|
+
* Two modes:
|
|
8
|
+
* - "instance" (default): the call is proxied THROUGH the active Fallen-8 instance
|
|
9
|
+
* (browser -> POST /chat -> the instance's model backend, e.g. the Ollama sidecar). The
|
|
10
|
+
* model is server-owned (Fallen8:Chat); nothing is configured here, and the prompt travels
|
|
11
|
+
* to the same instance the user already trusts with their graph, so there is no egress
|
|
12
|
+
* notice. This replaces the old browser-direct "builtin" mode (feature instance-config
|
|
13
|
+
* retired the "never through the instance" default; see docs/studio.md).
|
|
14
|
+
* - "custom": the browser calls a model endpoint DIRECTLY (Ollama-native or OpenAI-compatible),
|
|
15
|
+
* with any API key held only in the browser and never sent to a Fallen-8 instance (FR-26.11).
|
|
16
|
+
* A non-loopback custom endpoint shows the "text leaves this machine" notice.
|
|
17
|
+
*/
|
|
18
|
+
export type NlBackendMode = "instance" | "custom";
|
|
19
|
+
export interface NlAssistConfig {
|
|
20
|
+
mode: NlBackendMode;
|
|
21
|
+
endpoint: string;
|
|
22
|
+
apiKind: "ollama" | "openai";
|
|
23
|
+
model: string;
|
|
24
|
+
apiKey?: string;
|
|
25
|
+
temperature: number;
|
|
26
|
+
maxRetries: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The default model the compose stack pulls for the instance's chat backend (produced by
|
|
30
|
+
* nl-assist-finetune). Shown as a hint only; in instance mode the server owns the model, and
|
|
31
|
+
* in custom mode the user picks one (see NL_PRESETS). If the chosen model is absent on the
|
|
32
|
+
* backend, calls 404 - create it with the training pipeline or pick the stock phi4-mini preset.
|
|
33
|
+
*/
|
|
34
|
+
export declare const DEFAULT_NL_MODEL = "phi4-f8-mini";
|
|
35
|
+
export declare const DEFAULT_NL_CONFIG: NlAssistConfig;
|
|
36
|
+
/** Convenience prefills for custom mode (nl-assist-ux FR-3) — not recommendations. */
|
|
37
|
+
export interface NlPreset {
|
|
38
|
+
name: string;
|
|
39
|
+
endpoint: string;
|
|
40
|
+
apiKind: "ollama" | "openai";
|
|
41
|
+
model: string;
|
|
42
|
+
}
|
|
43
|
+
export declare const NL_PRESETS: NlPreset[];
|
|
44
|
+
interface NlAssistState {
|
|
45
|
+
config: NlAssistConfig;
|
|
46
|
+
/** FR-26.10: non-loopback CUSTOM endpoints show the "text leaves this machine" notice once. */
|
|
47
|
+
leaveNoticeAccepted: boolean;
|
|
48
|
+
setConfig: (patch: Partial<NlAssistConfig>) => void;
|
|
49
|
+
acceptLeaveNotice: () => void;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Persist migration. The legacy browser-direct "builtin" mode becomes "instance" (feature
|
|
53
|
+
* instance-config): those users now route through the active instance rather than a fixed
|
|
54
|
+
* localhost Ollama. A pre-mode config with a stored endpoint stays "custom"; everyone else
|
|
55
|
+
* lands on the instance default.
|
|
56
|
+
*/
|
|
57
|
+
export declare function migrateNlState(persisted: unknown): Partial<NlAssistState>;
|
|
58
|
+
export declare const useNlAssist: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<NlAssistState>, "setState" | "persist"> & {
|
|
59
|
+
setState(partial: NlAssistState | Partial<NlAssistState> | ((state: NlAssistState) => NlAssistState | Partial<NlAssistState>), replace?: false | undefined): unknown;
|
|
60
|
+
setState(state: NlAssistState | ((state: NlAssistState) => NlAssistState), replace: true): unknown;
|
|
61
|
+
persist: {
|
|
62
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<NlAssistState, NlAssistState, unknown>>) => void;
|
|
63
|
+
clearStorage: () => void;
|
|
64
|
+
rehydrate: () => Promise<void> | void;
|
|
65
|
+
hasHydrated: () => boolean;
|
|
66
|
+
onHydrate: (fn: (state: NlAssistState) => void) => () => void;
|
|
67
|
+
onFinishHydration: (fn: (state: NlAssistState) => void) => () => void;
|
|
68
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<NlAssistState, NlAssistState, unknown>>;
|
|
69
|
+
};
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* The embed-policy resolution (StudioConfig.nlAssist, documented on app/studioConfig.ts):
|
|
73
|
+
* under "instance-only" a custom config is forced back to instance mode with its key
|
|
74
|
+
* cleared. Applied at THREE altitudes so the policy holds structurally: the persist merge
|
|
75
|
+
* above (the store never holds a violating config), the transport (generateChat, plus the
|
|
76
|
+
* browser-direct functions refusing outright), and as a belt inside NlBackendConfig's
|
|
77
|
+
* locked rendering.
|
|
78
|
+
*/
|
|
79
|
+
export declare function resolveNlConfig(config: NlAssistConfig): NlAssistConfig;
|
|
80
|
+
/**
|
|
81
|
+
* The one panel gate (StudioConfig.nlAssist === "disabled"): both NL panels wrap their
|
|
82
|
+
* inner component with this, so the affordance disappears identically everywhere and the
|
|
83
|
+
* early return cannot trip the rules of hooks inside the inner component. Presentation
|
|
84
|
+
* only - the transport refuses independently.
|
|
85
|
+
*/
|
|
86
|
+
export declare function withNlAssistPolicyGate<P extends object>(Inner: ComponentType<P>): (props: P) => import("react").ReactElement<P, string | import("react").JSXElementConstructor<any>> | null;
|
|
87
|
+
/**
|
|
88
|
+
* The config to actually call a CUSTOM endpoint with. Instance mode does not go through this
|
|
89
|
+
* path (the transport routes to the active instance's /chat); it returns the config unchanged
|
|
90
|
+
* with any stray key cleared, so a status/probe read is harmless.
|
|
91
|
+
*/
|
|
92
|
+
export declare function effectiveNlConfig(config: NlAssistConfig): NlAssistConfig;
|
|
93
|
+
/**
|
|
94
|
+
* `enabled` is derived, not stored: instance mode is configured as long as an instance is
|
|
95
|
+
* active (checked by the caller); custom needs an endpoint and model (FR-26.8).
|
|
96
|
+
*/
|
|
97
|
+
export declare function isNlConfigured(config: NlAssistConfig): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* FR-26.12: the native Ollama path never authenticates - the Ollama transport sends no
|
|
100
|
+
* Authorization header. Only OpenAI-compatible custom endpoints can carry a key.
|
|
101
|
+
*/
|
|
102
|
+
export declare function usesApiKey(config: NlAssistConfig): boolean;
|
|
103
|
+
/** FR-26.10: loopback endpoints never show the privacy notice - nothing leaves. */
|
|
104
|
+
export declare function isLoopbackEndpoint(endpoint: string): boolean;
|
|
105
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DelegateKind } from "../../api/types";
|
|
2
|
+
/**
|
|
3
|
+
* FL-2 of the nl-assist-feedback-loop feature: opt-in, LOCAL capture of labelled
|
|
4
|
+
* (intent -> fragment) pairs for later fine-tuning. Nothing here touches the network - the
|
|
5
|
+
* parent NL-assist spec forbids server-side prompt storage, so capture is a file the operator
|
|
6
|
+
* exports and moves deliberately; the FL-3 consolidation tool ingests these lines and folds
|
|
7
|
+
* the good ones into the training corpus (never the held-out eval set).
|
|
8
|
+
*/
|
|
9
|
+
export type Verdict = "up" | "down";
|
|
10
|
+
export interface TrainingExample {
|
|
11
|
+
delegateKind: DelegateKind;
|
|
12
|
+
/** The plain-language request the draft was generated from. */
|
|
13
|
+
intent: string;
|
|
14
|
+
/** The drafted fragment being labelled (a 👍 marks it a good intent->fragment pair). */
|
|
15
|
+
fragment: string;
|
|
16
|
+
verdict: Verdict | null;
|
|
17
|
+
/** Capture time (ms since epoch) — lets the consolidation tool order/dedupe. */
|
|
18
|
+
ts: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One compact JSON object per line — the JSONL the FL-3 consolidation tool reads. A trailing
|
|
22
|
+
* newline keeps concatenating multiple exports valid; an empty set yields an empty string.
|
|
23
|
+
*/
|
|
24
|
+
export declare function toTrainingJsonl<T>(examples: T[]): string;
|
|
25
|
+
/**
|
|
26
|
+
* Trigger a browser download of `text`. Opt-in capture only: it builds an in-memory blob and
|
|
27
|
+
* clicks a link — it never calls an endpoint, so a captured example leaves the machine only
|
|
28
|
+
* when the operator moves the downloaded file.
|
|
29
|
+
*/
|
|
30
|
+
export declare function downloadText(filename: string, text: string): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function formatFragment(fragment: string): string;
|
|
2
|
+
/**
|
|
3
|
+
* Index of the first statement-terminating `;` (top level, outside literals), or -1.
|
|
4
|
+
* Used by extractFragment to cut trailing prose a model appends after the fragment.
|
|
5
|
+
*/
|
|
6
|
+
export declare function firstTopLevelSemicolon(text: string): number;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type NlAssistConfig } from "./config";
|
|
2
|
+
import type { NlPrompt } from "./prompt";
|
|
3
|
+
import type { InstanceConfig } from "../../instances/types";
|
|
4
|
+
/**
|
|
5
|
+
* Model transport (nl-assist spec §4, feature instance-config). Two paths, chosen by mode:
|
|
6
|
+
* - INSTANCE (default): browser -> the active Fallen-8 instance (POST /chat) -> its model
|
|
7
|
+
* backend. Auth is the instance's own credential (the shared api client); no third-party
|
|
8
|
+
* key is involved.
|
|
9
|
+
* - CUSTOM: browser DIRECTLY to an Ollama-native or OpenAI-compatible endpoint; F8 is never
|
|
10
|
+
* in this path and the API key (if any) goes only here (FR-26.11).
|
|
11
|
+
* Either path surfaces the provider's generation statistics (nl-assist-ux FR-5).
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Studio's own ceiling on ONE model call, and the LAST bound to fire in a normal setup.
|
|
15
|
+
*
|
|
16
|
+
* `fetch` has no timeout, so without this a browser-direct custom endpoint (custom mode, which has
|
|
17
|
+
* no Fallen-8 in front of it) can hang forever, and an instance whose connection wedges without
|
|
18
|
+
* answering never resolves either. Minutes are the right order of magnitude because a local model
|
|
19
|
+
* on CPU genuinely needs them.
|
|
20
|
+
*
|
|
21
|
+
* It is deliberately generous so that in instance mode `Fallen8:Chat:TimeoutSeconds` stays the
|
|
22
|
+
* deadline the user actually meets, and they get the server's 504 naming the setting they can
|
|
23
|
+
* change. Be honest about the consequence though: this is a hard ceiling, so a chat budget raised
|
|
24
|
+
* ABOVE it is capped here and the editor stops waiting first. That is stated in the give-up message
|
|
25
|
+
* and on the troubleshooting page rather than left for someone to discover.
|
|
26
|
+
*/
|
|
27
|
+
export declare const NL_REQUEST_TIMEOUT_MS: number;
|
|
28
|
+
export interface ChatTurn {
|
|
29
|
+
role: "system" | "user" | "assistant";
|
|
30
|
+
content: string;
|
|
31
|
+
}
|
|
32
|
+
export interface NlGenerationStats {
|
|
33
|
+
promptTokens?: number;
|
|
34
|
+
completionTokens?: number;
|
|
35
|
+
durationMs?: number;
|
|
36
|
+
tokensPerSecond?: number;
|
|
37
|
+
/** The provider's stats fields verbatim, for the expandable raw view. */
|
|
38
|
+
raw: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export interface NlChatResult {
|
|
41
|
+
content: string;
|
|
42
|
+
stats: NlGenerationStats | null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The single entry point both NL panels call. Routes to the instance gateway or a
|
|
46
|
+
* browser-direct custom endpoint per {@link NlAssistConfig.mode}.
|
|
47
|
+
*/
|
|
48
|
+
export declare function generateChat(config: NlAssistConfig, instance: InstanceConfig | null, messages: ChatTurn[], signal?: AbortSignal): Promise<NlChatResult>;
|
|
49
|
+
/** Instance-gateway path: browser -> F8 POST /chat -> the server's model backend. */
|
|
50
|
+
export declare function chatViaInstance(instance: InstanceConfig, messages: ChatTurn[], temperature: number, signal?: AbortSignal): Promise<NlChatResult>;
|
|
51
|
+
export declare function chatWithModel(config: NlAssistConfig, messages: ChatTurn[], signal?: AbortSignal): Promise<NlChatResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Reachability probe (nl-assist-ux FR-2): informational only, never gates generation.
|
|
54
|
+
* Ollama exposes GET /api/version; OpenAI-compatible endpoints expose GET /v1/models.
|
|
55
|
+
*/
|
|
56
|
+
export declare function probeEndpoint(config: NlAssistConfig, signal?: AbortSignal): Promise<boolean>;
|
|
57
|
+
export declare function initialMessages(prompt: NlPrompt): ChatTurn[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DelegateDiagnostic, DelegateKind } from "../../api/types";
|
|
2
|
+
/**
|
|
3
|
+
* Generation-prompt assembly (nl-assist spec FR-26.5). The contract fixes the order:
|
|
4
|
+
* (a) emit-only-a-fragment instruction, (b) the slot's exact lambda shape, (c) the
|
|
5
|
+
* available usings, (d) the reachable member surface incl. the TryGetProperty idiom,
|
|
6
|
+
* (e) matching few-shot examples from the snippet library (required - they carry the
|
|
7
|
+
* Python-to-C# gap), (f) the user's plain-language intent.
|
|
8
|
+
*/
|
|
9
|
+
export interface NlPrompt {
|
|
10
|
+
system: string;
|
|
11
|
+
user: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildGenerationPrompt(kind: DelegateKind, intent: string, priorDrafts?: string[]): NlPrompt;
|
|
14
|
+
/** Follow-up turn for the refine loop (FR-26.7): failed fragment + its diagnostics. */
|
|
15
|
+
export declare function buildRefinePrompt(kind: DelegateKind, fragment: string, diagnostics: DelegateDiagnostic[]): string;
|
|
16
|
+
/**
|
|
17
|
+
* Output handling (FR-26.6): strip markdown fences and stray prose. A fenced block wins;
|
|
18
|
+
* otherwise cut leading prose before the first "return" and trailing prose after the
|
|
19
|
+
* statement's closing `;` (models append parenthetical notes there - seen in the field).
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractFragment(raw: string): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run lifecycle shared by both NL panels (the delegate editor's and the plugin editor's).
|
|
3
|
+
* It exists because the two panels had the same two defects in duplicate:
|
|
4
|
+
*
|
|
5
|
+
* - The panel held an AbortController but nothing aborted it on unmount, so closing the editor
|
|
6
|
+
* mid-draft left the model call running. On a slow backend a second generation then queued
|
|
7
|
+
* behind the orphan instead of starting.
|
|
8
|
+
* - Nothing aborted a previous run when a new one began.
|
|
9
|
+
*
|
|
10
|
+
* Both are lifecycle concerns rather than presentation, so they live here once.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useNlRun(): {
|
|
13
|
+
begin: () => AbortController;
|
|
14
|
+
cancel: () => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Whole seconds since `active` last became true, and 0 whenever it is false.
|
|
18
|
+
*
|
|
19
|
+
* This is the panels' only progress signal, and it is load-bearing rather than decorative: a
|
|
20
|
+
* local model on CPU can need minutes for one draft (see the troubleshooting page), so without
|
|
21
|
+
* an advancing number a working call is indistinguishable from a hung one, which is exactly how
|
|
22
|
+
* the original hang was reported.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useElapsedSeconds(active: boolean): number;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type * as Monaco from "monaco-editor";
|
|
2
|
+
import type { DelegateKind } from "../api/types";
|
|
3
|
+
/**
|
|
4
|
+
* Static IntelliSense (FR-22): completions, hovers, and signature help driven entirely by
|
|
5
|
+
* the checked-in type model - the server's validate endpoint stays the only compile
|
|
6
|
+
* authority. Members are scoped to the slot's parameter type: after `v.` a VertexFilter
|
|
7
|
+
* offers AGraphElementModel + VertexModel members; an EdgePropertyFilter's `p.` offers
|
|
8
|
+
* string members only and no graph model.
|
|
9
|
+
*/
|
|
10
|
+
interface ModelMember {
|
|
11
|
+
name: string;
|
|
12
|
+
kind: string;
|
|
13
|
+
signature: string;
|
|
14
|
+
doc: string;
|
|
15
|
+
/**
|
|
16
|
+
* False = the member exists on the engine type but a fragment cannot CALL it. Offered anyway as a
|
|
17
|
+
* discovery aid, sorted last, struck through, and withheld from the NL-assist prompt. Which
|
|
18
|
+
* members and why: docs/src/content/docs/delegates.mdx, "Accessor surface".
|
|
19
|
+
*/
|
|
20
|
+
compilable?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function membersForType(typeName: string): ModelMember[];
|
|
23
|
+
export declare function memberByName(name: string): ModelMember | undefined;
|
|
24
|
+
/** Registers all providers for one editor session; returns a dispose function. */
|
|
25
|
+
export declare function registerDelegateProviders(monaco: typeof Monaco, delegateKind: DelegateKind): () => void;
|
|
26
|
+
export {};
|