@tangle-network/agent-app 0.30.0 → 0.32.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.
Files changed (42) hide show
  1. package/dist/IntakeInterview-WHVKMNQW.js +8 -0
  2. package/dist/IntakeInterview-WHVKMNQW.js.map +1 -0
  3. package/dist/VaultPane-2BRLHKEB.js +7 -0
  4. package/dist/VaultPane-2BRLHKEB.js.map +1 -0
  5. package/dist/VaultPane-B8ipCqkB.d.ts +118 -0
  6. package/dist/chunk-4K7BZYO7.js +124 -0
  7. package/dist/chunk-4K7BZYO7.js.map +1 -0
  8. package/dist/chunk-5I72FRZY.js +212 -0
  9. package/dist/chunk-5I72FRZY.js.map +1 -0
  10. package/dist/{chunk-WOVCWPFF.js → chunk-FJUOBNIY.js} +1 -1
  11. package/dist/chunk-ND3XEGBE.js +119 -0
  12. package/dist/chunk-ND3XEGBE.js.map +1 -0
  13. package/dist/chunk-SMVD76VC.js +584 -0
  14. package/dist/chunk-SMVD76VC.js.map +1 -0
  15. package/dist/chunk-USYXHDKE.js +30 -0
  16. package/dist/chunk-USYXHDKE.js.map +1 -0
  17. package/dist/design-canvas-react/index.js +1 -1
  18. package/dist/design-canvas-react/lazy.js +1 -1
  19. package/dist/intakes/api.d.ts +59 -0
  20. package/dist/intakes/api.js +63 -0
  21. package/dist/intakes/api.js.map +1 -0
  22. package/dist/intakes/drizzle.d.ts +385 -0
  23. package/dist/intakes/drizzle.js +61 -0
  24. package/dist/intakes/drizzle.js.map +1 -0
  25. package/dist/intakes/index.d.ts +42 -0
  26. package/dist/intakes/index.js +31 -0
  27. package/dist/intakes/index.js.map +1 -0
  28. package/dist/intakes-react/index.d.ts +48 -0
  29. package/dist/intakes-react/index.js +8 -0
  30. package/dist/intakes-react/index.js.map +1 -0
  31. package/dist/intakes-react/lazy.d.ts +8 -0
  32. package/dist/intakes-react/lazy.js +9 -0
  33. package/dist/intakes-react/lazy.js.map +1 -0
  34. package/dist/model-Cuj7d-xT.d.ts +116 -0
  35. package/dist/vault/index.d.ts +22 -0
  36. package/dist/vault/index.js +9 -0
  37. package/dist/vault/index.js.map +1 -0
  38. package/dist/vault/lazy.d.ts +7 -0
  39. package/dist/vault/lazy.js +9 -0
  40. package/dist/vault/lazy.js.map +1 -0
  41. package/package.json +36 -1
  42. /package/dist/{chunk-WOVCWPFF.js.map → chunk-FJUOBNIY.js.map} +0 -0
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Pure intake MODEL — the question-graph and the answer/completion algebra a
3
+ * one-question-at-a-time interview runs on. Zero dependencies: no drizzle, no
4
+ * env, no react, no I/O. The DB layer (`./intakes/drizzle`), the handlers
5
+ * (`./intakes/api`) and the React surface (`./intakes-react`) all build on
6
+ * these functions; this leaf imports nothing back, so a consumer can pull just
7
+ * the intake math.
8
+ *
9
+ * An intake is an ordered list of questions, optionally branching: a question
10
+ * can declare `next` as a function of the answers so far, so the next prompt
11
+ * depends on what was said (e.g. "do you have a website?" → no → skip the URL
12
+ * question). Traversal is pure and deterministic — `nextQuestion(graph, answers)`
13
+ * folds the answers into the single question to ask next (or null = done), and
14
+ * `isComplete` is true exactly when every REQUIRED reachable question has a
15
+ * valid answer.
16
+ *
17
+ * Answers are a flat `Record<questionId, value>`. Each question declares an
18
+ * answer `type` that `validateAnswer` checks against — the same validation the
19
+ * UI runs before advancing and the store runs before persisting, so an invalid
20
+ * answer can never enter the payload.
21
+ */
22
+ /** The kinds of answer a question accepts. */
23
+ type IntakeAnswerType = 'text' | 'long-text' | 'single-select' | 'multi-select' | 'boolean' | 'number' | 'url' | 'email';
24
+ /** A selectable option for single/multi-select questions. */
25
+ interface IntakeOption {
26
+ value: string;
27
+ label: string;
28
+ }
29
+ /** A flat map of answers keyed by question id. */
30
+ type IntakeAnswers = Record<string, IntakeAnswerValue>;
31
+ /** Any value an answer can hold; the type is validated per-question. */
32
+ type IntakeAnswerValue = string | string[] | number | boolean | null;
33
+ /**
34
+ * One question in the graph. `next` (optional) makes the graph branch: given
35
+ * the answers so far it returns the id of the question to ask next, or null to
36
+ * end the interview early. With no `next`, traversal falls through to the next
37
+ * question in declaration order.
38
+ */
39
+ interface IntakeQuestion {
40
+ id: string;
41
+ /** The prompt the interviewer asks. */
42
+ prompt: string;
43
+ type: IntakeAnswerType;
44
+ /** Required questions gate completion; optional ones may be skipped. */
45
+ required?: boolean;
46
+ /** Help text shown under the prompt. */
47
+ help?: string;
48
+ /** Options for single/multi-select questions. */
49
+ options?: IntakeOption[];
50
+ /** Min length (text) or min value (number); inclusive. */
51
+ min?: number;
52
+ /** Max length (text) or max value (number); inclusive. */
53
+ max?: number;
54
+ /**
55
+ * Branch override: given the answers so far, the id of the next question
56
+ * (or null to end early). Omit for linear flow (next in declaration order).
57
+ */
58
+ next?(answers: IntakeAnswers): string | null;
59
+ }
60
+ /** The intake definition: an ordered, addressable set of questions. */
61
+ interface IntakeGraph {
62
+ /** Stable id for the intake definition (e.g. 'user-onboarding-v1'). */
63
+ id: string;
64
+ /** Human title shown at the top of the interview. */
65
+ title: string;
66
+ /** Optional one-line description. */
67
+ description?: string;
68
+ /** Questions in declaration (default traversal) order. */
69
+ questions: IntakeQuestion[];
70
+ }
71
+ /** The reason an answer failed validation. */
72
+ type AnswerRejectionReason = 'required' | 'wrong-type' | 'too-short' | 'too-long' | 'too-small' | 'too-large' | 'not-an-option' | 'invalid-url' | 'invalid-email' | 'unknown-question';
73
+ interface AnswerValidationResult {
74
+ ok: boolean;
75
+ reason?: AnswerRejectionReason;
76
+ }
77
+ /** Look up a question by id, or null if the graph has none. */
78
+ declare function getQuestion(graph: IntakeGraph, questionId: string): IntakeQuestion | null;
79
+ /** True when an answer value is present (not null/undefined/empty). */
80
+ declare function hasAnswer(value: IntakeAnswerValue | undefined): boolean;
81
+ /**
82
+ * Validate one answer against its question. Pure: no I/O, no graph mutation.
83
+ * An empty value is rejected as `required` only when the question is required;
84
+ * an empty value for an optional question is OK (the user skipped it).
85
+ */
86
+ declare function validateAnswer(question: IntakeQuestion, value: IntakeAnswerValue | undefined): AnswerValidationResult;
87
+ /**
88
+ * The single question to ask next given the answers so far, or null when the
89
+ * interview is done. Walks the graph from the first question, following each
90
+ * question's `next` branch (or declaration order) and stopping at the first
91
+ * reachable question that has no valid answer yet. Deterministic and pure.
92
+ *
93
+ * A `next` that points at a missing id, or returns null, ends the walk — so a
94
+ * malformed graph terminates rather than looping. A visited-set guards against
95
+ * a cyclic `next`.
96
+ */
97
+ declare function nextQuestion(graph: IntakeGraph, answers: IntakeAnswers): IntakeQuestion | null;
98
+ /**
99
+ * True when every REQUIRED question reachable under the current answers has a
100
+ * valid answer. Pure: it replays the same traversal `nextQuestion` uses and is
101
+ * complete exactly when that traversal has no question left to ask.
102
+ */
103
+ declare function isComplete(graph: IntakeGraph, answers: IntakeAnswers): boolean;
104
+ /**
105
+ * Progress as answered-vs-total over the REACHABLE required questions under the
106
+ * current answers — what a progress bar renders. Optional questions don't count
107
+ * toward the denominator (they never block completion).
108
+ */
109
+ declare function intakeProgress(graph: IntakeGraph, answers: IntakeAnswers): {
110
+ answered: number;
111
+ total: number;
112
+ };
113
+ /** The questions reachable under the current answers, in traversal order. */
114
+ declare function reachableQuestions(graph: IntakeGraph, answers: IntakeAnswers): IntakeQuestion[];
115
+
116
+ export { type AnswerRejectionReason as A, type IntakeAnswerValue as I, type IntakeQuestion as a, type IntakeGraph as b, type IntakeAnswers as c, type AnswerValidationResult as d, type IntakeAnswerType as e, type IntakeOption as f, getQuestion as g, hasAnswer as h, intakeProgress as i, isComplete as j, nextQuestion as n, reachableQuestions as r, validateAnswer as v };
@@ -0,0 +1,22 @@
1
+ export { V as VaultArtifactRenderProps, a as VaultDataPort, b as VaultDockRenderProps, c as VaultEditorMode, d as VaultFile, e as VaultMarkdownCodec, f as VaultPane, g as VaultPaneProps, h as VaultRichParts, i as VaultTreeNode, j as VaultTreeRenderProps } from '../VaultPane-B8ipCqkB.js';
2
+ import * as react from 'react';
3
+ import { ReactNode } from 'react';
4
+
5
+ interface ConfirmDialogProps {
6
+ open: boolean;
7
+ title: string;
8
+ description?: ReactNode;
9
+ confirmLabel?: string;
10
+ cancelLabel?: string;
11
+ /** Styles the confirm button as a destructive action. */
12
+ destructive?: boolean;
13
+ /** Disables the confirm button (e.g. while the action is in flight). */
14
+ confirmDisabled?: boolean;
15
+ onConfirm: () => void;
16
+ onCancel: () => void;
17
+ /** Optional body (e.g. an input field for the create flow). */
18
+ children?: ReactNode;
19
+ }
20
+ declare function ConfirmDialog({ open, title, description, confirmLabel, cancelLabel, destructive, confirmDisabled, onConfirm, onCancel, children, }: ConfirmDialogProps): react.JSX.Element | null;
21
+
22
+ export { ConfirmDialog, type ConfirmDialogProps };
@@ -0,0 +1,9 @@
1
+ import {
2
+ ConfirmDialog,
3
+ VaultPane
4
+ } from "../chunk-SMVD76VC.js";
5
+ export {
6
+ ConfirmDialog,
7
+ VaultPane
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,7 @@
1
+ import * as react from 'react';
2
+ import { f as VaultPane } from '../VaultPane-B8ipCqkB.js';
3
+ export { g as VaultPaneProps } from '../VaultPane-B8ipCqkB.js';
4
+
5
+ declare const VaultPaneLazy: react.LazyExoticComponent<typeof VaultPane>;
6
+
7
+ export { VaultPaneLazy };
@@ -0,0 +1,9 @@
1
+ // src/vault/lazy.tsx
2
+ import { lazy } from "react";
3
+ var VaultPaneLazy = lazy(
4
+ () => import("../VaultPane-2BRLHKEB.js").then((m) => ({ default: m.VaultPane }))
5
+ );
6
+ export {
7
+ VaultPaneLazy
8
+ };
9
+ //# sourceMappingURL=lazy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/vault/lazy.tsx"],"sourcesContent":["/**\n * Code-split entry for the vault surface. Products that don't need the vault on\n * initial load import `VaultPaneLazy` (a `React.lazy` handle) instead of the\n * component directly, so the pane chunk loads on first render. Mount inside a\n * `<Suspense>` boundary; the product provides the fallback.\n */\n\nimport { lazy } from 'react'\nimport type { VaultPaneProps } from './contracts'\n\nexport type { VaultPaneProps }\n\nexport const VaultPaneLazy = lazy(\n () => import('./VaultPane').then((m) => ({ default: m.VaultPane })),\n)\n"],"mappings":";AAOA,SAAS,YAAY;AAKd,IAAM,gBAAgB;AAAA,EAC3B,MAAM,OAAO,0BAAa,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE;AACpE;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "0.30.0",
3
+ "version": "0.32.0",
4
4
  "packageManager": "pnpm@10.33.4",
5
5
  "description": "Application-shell framework for Tangle agent products: a bounded tool loop, the structured agent→app tool side channel, integration-hub client, per-workspace billing, and crypto — composed over the Tangle agent substrate through typed seams.",
6
6
  "keywords": [
@@ -253,6 +253,41 @@
253
253
  "import": "./dist/teams-react/lazy.js",
254
254
  "default": "./dist/teams-react/lazy.js"
255
255
  },
256
+ "./intakes": {
257
+ "types": "./dist/intakes/index.d.ts",
258
+ "import": "./dist/intakes/index.js",
259
+ "default": "./dist/intakes/index.js"
260
+ },
261
+ "./intakes/drizzle": {
262
+ "types": "./dist/intakes/drizzle.d.ts",
263
+ "import": "./dist/intakes/drizzle.js",
264
+ "default": "./dist/intakes/drizzle.js"
265
+ },
266
+ "./intakes/api": {
267
+ "types": "./dist/intakes/api.d.ts",
268
+ "import": "./dist/intakes/api.js",
269
+ "default": "./dist/intakes/api.js"
270
+ },
271
+ "./intakes-react": {
272
+ "types": "./dist/intakes-react/index.d.ts",
273
+ "import": "./dist/intakes-react/index.js",
274
+ "default": "./dist/intakes-react/index.js"
275
+ },
276
+ "./intakes-react/lazy": {
277
+ "types": "./dist/intakes-react/lazy.d.ts",
278
+ "import": "./dist/intakes-react/lazy.js",
279
+ "default": "./dist/intakes-react/lazy.js"
280
+ },
281
+ "./vault": {
282
+ "types": "./dist/vault/index.d.ts",
283
+ "import": "./dist/vault/index.js",
284
+ "default": "./dist/vault/index.js"
285
+ },
286
+ "./vault/lazy": {
287
+ "types": "./dist/vault/lazy.d.ts",
288
+ "import": "./dist/vault/lazy.js",
289
+ "default": "./dist/vault/lazy.js"
290
+ },
256
291
  "./theme": {
257
292
  "types": "./dist/theme/index.d.ts",
258
293
  "import": "./dist/theme/index.js",