@tangle-network/agent-app 0.60.207 → 0.60.209
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/dist/assistant/index.js +1 -1
- package/dist/chat-routes/index.js +6 -2
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/{chunk-65SDSB6D.js → chunk-7LMHBLFH.js} +19 -2
- package/dist/chunk-7LMHBLFH.js.map +1 -0
- package/dist/{chunk-JDEGS53O.js → chunk-LRW36WCF.js} +25 -2
- package/dist/chunk-LRW36WCF.js.map +1 -0
- package/dist/{chunk-2CBRCREL.js → chunk-R75P63W5.js} +2 -2
- package/dist/intakes/drizzle.js +114 -6
- package/dist/intakes/drizzle.js.map +1 -1
- package/dist/intakes/index.d.ts +2 -6
- package/dist/intakes/index.js +6 -8
- package/dist/intakes/index.js.map +1 -1
- package/dist/intakes/model.d.ts +1 -2
- package/dist/public-consultation/index.d.ts +2 -2
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/openai-stream.d.ts +7 -0
- package/dist/runtime/router-turn.d.ts +14 -1
- package/dist/runtime/router-turn.js +1 -1
- package/dist/stories/panels/fixtures.d.ts +3 -29
- package/dist/web-react/index.js +3 -3
- package/package.json +1 -16
- package/dist/IntakeInterview-OKT6DCBN.js +0 -8
- package/dist/IntakeInterview-OKT6DCBN.js.map +0 -1
- package/dist/chunk-65SDSB6D.js.map +0 -1
- package/dist/chunk-I2CA5N7V.js +0 -254
- package/dist/chunk-I2CA5N7V.js.map +0 -1
- package/dist/chunk-JDEGS53O.js.map +0 -1
- package/dist/chunk-VWAEWOWK.js +0 -124
- package/dist/chunk-VWAEWOWK.js.map +0 -1
- package/dist/chunk-YZ6KQULN.js +0 -30
- package/dist/chunk-YZ6KQULN.js.map +0 -1
- package/dist/intakes/api.d.ts +0 -54
- package/dist/intakes/api.js +0 -63
- package/dist/intakes/api.js.map +0 -1
- package/dist/intakes-react/components/BrandMark.d.ts +0 -10
- package/dist/intakes-react/components/IntakeInterview.d.ts +0 -15
- package/dist/intakes-react/components/index.d.ts +0 -1
- package/dist/intakes-react/contracts.d.ts +0 -42
- package/dist/intakes-react/index.d.ts +0 -14
- package/dist/intakes-react/index.js +0 -8
- package/dist/intakes-react/index.js.map +0 -1
- package/dist/intakes-react/lazy.d.ts +0 -10
- package/dist/intakes-react/lazy.js +0 -9
- package/dist/intakes-react/lazy.js.map +0 -1
- /package/dist/{chunk-2CBRCREL.js.map → chunk-R75P63W5.js.map} +0 -0
package/dist/chunk-VWAEWOWK.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
emptyPayload,
|
|
3
|
-
markComplete,
|
|
4
|
-
payloadComplete,
|
|
5
|
-
withAnswer
|
|
6
|
-
} from "./chunk-YZ6KQULN.js";
|
|
7
|
-
import {
|
|
8
|
-
getQuestion,
|
|
9
|
-
validateAnswer
|
|
10
|
-
} from "./chunk-JDEGS53O.js";
|
|
11
|
-
|
|
12
|
-
// src/intakes/drizzle/store.ts
|
|
13
|
-
import { eq } from "drizzle-orm";
|
|
14
|
-
var IntakeError = class extends Error {
|
|
15
|
-
code;
|
|
16
|
-
constructor(code, message) {
|
|
17
|
-
super(message);
|
|
18
|
-
this.name = "IntakeError";
|
|
19
|
-
this.code = code;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
function createScopedStore(opts) {
|
|
23
|
-
const { db, graph, table, scopeColumn, scopeValue, insertScope } = opts;
|
|
24
|
-
async function loadRow() {
|
|
25
|
-
const [row] = await db.select().from(table).where(eq(scopeColumn, scopeValue)).limit(1);
|
|
26
|
-
return row ?? null;
|
|
27
|
-
}
|
|
28
|
-
function toState(row) {
|
|
29
|
-
if (!row) {
|
|
30
|
-
return { payload: emptyPayload(graph), completed: false, completedAt: null };
|
|
31
|
-
}
|
|
32
|
-
const payload = normalizePayload(row.payload, row.graphId);
|
|
33
|
-
const completedAt = toDate(row.completedAt);
|
|
34
|
-
return {
|
|
35
|
-
payload,
|
|
36
|
-
completed: completedAt != null && payloadComplete(graph, payload),
|
|
37
|
-
completedAt
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
async function get() {
|
|
41
|
-
return toState(await loadRow());
|
|
42
|
-
}
|
|
43
|
-
async function upsertPayload(payload, completedAt) {
|
|
44
|
-
const existing = await loadRow();
|
|
45
|
-
if (existing) {
|
|
46
|
-
await db.update(table).set({ graphId: payload.graphId, payload, completedAt, updatedAt: /* @__PURE__ */ new Date() }).where(eq(scopeColumn, scopeValue));
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
await db.insert(table).values({
|
|
50
|
-
...insertScope,
|
|
51
|
-
graphId: payload.graphId,
|
|
52
|
-
payload,
|
|
53
|
-
completedAt
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
async function save(questionId, value) {
|
|
57
|
-
const question = getQuestion(graph, questionId);
|
|
58
|
-
if (!question) throw new IntakeError("unknown-question", `No question '${questionId}' in intake '${graph.id}'`);
|
|
59
|
-
const validity = validateAnswer(question, value);
|
|
60
|
-
if (!validity.ok) {
|
|
61
|
-
throw new IntakeError("invalid-answer", `Answer to '${questionId}' rejected: ${validity.reason}`);
|
|
62
|
-
}
|
|
63
|
-
const current = await get();
|
|
64
|
-
const next = withAnswer(current.payload, questionId, value);
|
|
65
|
-
await upsertPayload(next, current.completedAt);
|
|
66
|
-
return toState({ graphId: next.graphId, payload: next, completedAt: current.completedAt });
|
|
67
|
-
}
|
|
68
|
-
async function complete() {
|
|
69
|
-
const current = await get();
|
|
70
|
-
if (current.payload.graphId !== graph.id) {
|
|
71
|
-
throw new IntakeError("stale-graph", `Intake payload was collected against '${current.payload.graphId}', not '${graph.id}'`);
|
|
72
|
-
}
|
|
73
|
-
if (!payloadComplete(graph, current.payload)) {
|
|
74
|
-
throw new IntakeError("incomplete", `Intake '${graph.id}' has unanswered required questions`);
|
|
75
|
-
}
|
|
76
|
-
const completedPayload = markComplete(current.payload);
|
|
77
|
-
const completedAt = new Date(completedPayload.completedAt);
|
|
78
|
-
await upsertPayload(completedPayload, completedAt);
|
|
79
|
-
return { payload: completedPayload, completed: true, completedAt };
|
|
80
|
-
}
|
|
81
|
-
return { get, save, complete };
|
|
82
|
-
}
|
|
83
|
-
function createUserIntakeStore(opts) {
|
|
84
|
-
return createScopedStore({
|
|
85
|
-
db: opts.db,
|
|
86
|
-
graph: opts.graph,
|
|
87
|
-
table: opts.table,
|
|
88
|
-
scopeColumn: opts.table.userId,
|
|
89
|
-
scopeValue: opts.userId,
|
|
90
|
-
insertScope: { userId: opts.userId }
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
function createProjectIntakeStore(opts) {
|
|
94
|
-
return createScopedStore({
|
|
95
|
-
db: opts.db,
|
|
96
|
-
graph: opts.graph,
|
|
97
|
-
table: opts.table,
|
|
98
|
-
scopeColumn: opts.table.workspaceId,
|
|
99
|
-
scopeValue: opts.workspaceId,
|
|
100
|
-
insertScope: { workspaceId: opts.workspaceId }
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
function normalizePayload(raw, graphId) {
|
|
104
|
-
if (raw && typeof raw === "object" && "answers" in raw) {
|
|
105
|
-
const candidate = raw;
|
|
106
|
-
return {
|
|
107
|
-
graphId: candidate.graphId ?? graphId,
|
|
108
|
-
answers: candidate.answers ?? {},
|
|
109
|
-
...candidate.completedAt ? { completedAt: candidate.completedAt } : {}
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
return { graphId, answers: {} };
|
|
113
|
-
}
|
|
114
|
-
function toDate(value) {
|
|
115
|
-
if (value == null) return null;
|
|
116
|
-
return value instanceof Date ? value : new Date(Number(value) * (Number(value) < 1e12 ? 1e3 : 1));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export {
|
|
120
|
-
IntakeError,
|
|
121
|
-
createUserIntakeStore,
|
|
122
|
-
createProjectIntakeStore
|
|
123
|
-
};
|
|
124
|
-
//# sourceMappingURL=chunk-VWAEWOWK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intakes/drizzle/store.ts"],"sourcesContent":["/**\n * Drizzle-backed store over the tables from `createIntakeTables`. One store\n * builder per scope: `createUserIntakeStore` (keyed on userId) and\n * `createProjectIntakeStore` (keyed on workspaceId). Each returns the same\n * three-method surface — `get` / `save` / `complete` — so the api handlers and\n * the UI talk to one shape regardless of scope.\n *\n * Works against any SQLite drizzle driver (better-sqlite3, D1, libsql): the\n * builders are awaited, never `.run()`/`.all()`, so sync and async drivers\n * behave identically.\n *\n * Validation is fail-loud and pure (from the `./intakes` leaf). `save` runs\n * `validateAnswer` before writing, so an invalid answer can never enter the\n * payload; `complete` runs `payloadComplete` and refuses to stamp an\n * incomplete (or stale-graph) intake — it throws a typed `IntakeError` rather\n * than silently writing a half-finished onboarding state.\n *\n * `getProjectIntakeStore` pins `workspaceId` in every WHERE clause; RBAC runs\n * in the route before the store is built, but the scope key is enforced here\n * too, so a leaked id can never read or write across the boundary.\n *\n * Imports `drizzle-orm`, so this is a subpath, never re-exported from root.\n */\n\nimport { eq } from 'drizzle-orm'\nimport type { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core'\nimport {\n type IntakeAnswerValue,\n type IntakeGraph,\n getQuestion,\n validateAnswer,\n} from '../model'\nimport {\n type IntakePayload,\n emptyPayload,\n markComplete,\n payloadComplete,\n withAnswer,\n} from '../completion'\nimport type { ProjectIntakeTable, UserIntakeTable } from './schema'\n\n/** Any SQLite drizzle database — `any` erases driver-specific generics so\n * better-sqlite3, D1, and libsql handles all fit. */\nexport type IntakeDatabase = BaseSQLiteDatabase<'sync' | 'async', any, any>\n\n/** A loaded intake: the payload plus whether it is complete against the graph. */\nexport interface IntakeState {\n payload: IntakePayload\n completed: boolean\n completedAt: Date | null\n}\n\n/** Define error codes representing specific intake validation failures */\nexport type IntakeErrorCode = 'invalid-answer' | 'unknown-question' | 'incomplete' | 'stale-graph'\n\n/** Thrown by store mutations on a refused write — callers map it to a 4xx. */\nexport class IntakeError extends Error {\n readonly code: IntakeErrorCode\n constructor(code: IntakeErrorCode, message: string) {\n super(message)\n this.name = 'IntakeError'\n this.code = code\n }\n}\n\n/** The three-method store surface, identical for both scopes. */\nexport interface IntakeStore {\n /** Load the current intake, or seed an empty payload when none exists yet. */\n get(): Promise<IntakeState>\n /** Validate and persist one answer; returns the updated state. */\n save(questionId: string, value: IntakeAnswerValue): Promise<IntakeState>\n /** Stamp the intake complete; throws IntakeError when not yet completable. */\n complete(): Promise<IntakeState>\n}\n\ninterface IntakeTableShape {\n id: any\n graphId: any\n payload: any\n completedAt: any\n updatedAt: any\n}\n\ninterface ScopedStoreOptions {\n db: IntakeDatabase\n graph: IntakeGraph\n table: IntakeTableShape\n /** The scope column (userIntake.userId or projectIntake.workspaceId). */\n scopeColumn: any\n scopeValue: string\n /** Extra columns to set on insert (the scope key). */\n insertScope: Record<string, unknown>\n}\n\nfunction createScopedStore(opts: ScopedStoreOptions): IntakeStore {\n const { db, graph, table, scopeColumn, scopeValue, insertScope } = opts\n\n async function loadRow() {\n const [row] = await db\n .select()\n .from(table as any)\n .where(eq(scopeColumn, scopeValue))\n .limit(1)\n return (row ?? null) as\n | { id: string; graphId: string; payload: unknown; completedAt: Date | number | null }\n | null\n }\n\n function toState(\n row: { graphId: string; payload: unknown; completedAt: Date | number | null } | null,\n ): IntakeState {\n if (!row) {\n return { payload: emptyPayload(graph), completed: false, completedAt: null }\n }\n const payload = normalizePayload(row.payload, row.graphId)\n const completedAt = toDate(row.completedAt)\n return {\n payload,\n completed: completedAt != null && payloadComplete(graph, payload),\n completedAt,\n }\n }\n\n async function get(): Promise<IntakeState> {\n return toState(await loadRow())\n }\n\n async function upsertPayload(payload: IntakePayload, completedAt: Date | null) {\n const existing = await loadRow()\n if (existing) {\n await db\n .update(table as any)\n .set({ graphId: payload.graphId, payload, completedAt, updatedAt: new Date() })\n .where(eq(scopeColumn, scopeValue))\n return\n }\n await db.insert(table as any).values({\n ...insertScope,\n graphId: payload.graphId,\n payload,\n completedAt,\n })\n }\n\n async function save(questionId: string, value: IntakeAnswerValue): Promise<IntakeState> {\n const question = getQuestion(graph, questionId)\n if (!question) throw new IntakeError('unknown-question', `No question '${questionId}' in intake '${graph.id}'`)\n const validity = validateAnswer(question, value)\n if (!validity.ok) {\n throw new IntakeError('invalid-answer', `Answer to '${questionId}' rejected: ${validity.reason}`)\n }\n\n const current = await get()\n const next = withAnswer(current.payload, questionId, value)\n await upsertPayload(next, current.completedAt)\n return toState({ graphId: next.graphId, payload: next, completedAt: current.completedAt })\n }\n\n async function complete(): Promise<IntakeState> {\n const current = await get()\n if (current.payload.graphId !== graph.id) {\n throw new IntakeError('stale-graph', `Intake payload was collected against '${current.payload.graphId}', not '${graph.id}'`)\n }\n if (!payloadComplete(graph, current.payload)) {\n throw new IntakeError('incomplete', `Intake '${graph.id}' has unanswered required questions`)\n }\n const completedPayload = markComplete(current.payload)\n const completedAt = new Date(completedPayload.completedAt!)\n await upsertPayload(completedPayload, completedAt)\n return { payload: completedPayload, completed: true, completedAt }\n }\n\n return { get, save, complete }\n}\n\n/** Define options required to create a user intake store for onboarding data collection */\nexport interface CreateUserIntakeStoreOptions {\n db: IntakeDatabase\n /** The user-intake table from createIntakeTables. */\n table: UserIntakeTable\n /** The intake definition this store collects answers against. */\n graph: IntakeGraph\n /** The user whose onboarding this is. */\n userId: string\n}\n\n/** Build the per-user onboarding store, scoped to one userId. */\nexport function createUserIntakeStore(opts: CreateUserIntakeStoreOptions): IntakeStore {\n return createScopedStore({\n db: opts.db,\n graph: opts.graph,\n table: opts.table as unknown as IntakeTableShape,\n scopeColumn: opts.table.userId,\n scopeValue: opts.userId,\n insertScope: { userId: opts.userId },\n })\n}\n\n/** Define options required to create a project intake store including database, table, graph, and workspace ID */\nexport interface CreateProjectIntakeStoreOptions {\n db: IntakeDatabase\n /** The project-intake table from createIntakeTables (workspace scope). */\n table: ProjectIntakeTable\n graph: IntakeGraph\n /** The workspace this intake is attached to. */\n workspaceId: string\n}\n\n/** Build the per-project store, scoped to one workspaceId. */\nexport function createProjectIntakeStore(opts: CreateProjectIntakeStoreOptions): IntakeStore {\n return createScopedStore({\n db: opts.db,\n graph: opts.graph,\n table: opts.table as unknown as IntakeTableShape,\n scopeColumn: opts.table.workspaceId,\n scopeValue: opts.workspaceId,\n insertScope: { workspaceId: opts.workspaceId },\n })\n}\n\nfunction normalizePayload(raw: unknown, graphId: string): IntakePayload {\n if (raw && typeof raw === 'object' && 'answers' in (raw as Record<string, unknown>)) {\n const candidate = raw as Partial<IntakePayload>\n return {\n graphId: candidate.graphId ?? graphId,\n answers: candidate.answers ?? {},\n ...(candidate.completedAt ? { completedAt: candidate.completedAt } : {}),\n }\n }\n return { graphId, answers: {} }\n}\n\nfunction toDate(value: Date | number | null | undefined): Date | null {\n if (value == null) return null\n return value instanceof Date ? value : new Date(Number(value) * (Number(value) < 1e12 ? 1000 : 1))\n}\n"],"mappings":"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","names":[]}
|
package/dist/chunk-YZ6KQULN.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isComplete
|
|
3
|
-
} from "./chunk-JDEGS53O.js";
|
|
4
|
-
|
|
5
|
-
// src/intakes/completion.ts
|
|
6
|
-
function emptyPayload(graph) {
|
|
7
|
-
return { graphId: graph.id, answers: {} };
|
|
8
|
-
}
|
|
9
|
-
function withAnswer(payload, questionId, value) {
|
|
10
|
-
return { ...payload, answers: { ...payload.answers, [questionId]: value } };
|
|
11
|
-
}
|
|
12
|
-
function payloadComplete(graph, payload) {
|
|
13
|
-
if (payload.graphId !== graph.id) return false;
|
|
14
|
-
return isComplete(graph, payload.answers);
|
|
15
|
-
}
|
|
16
|
-
function payloadIsStale(graph, payload) {
|
|
17
|
-
return payload.graphId !== graph.id;
|
|
18
|
-
}
|
|
19
|
-
function markComplete(payload, at = /* @__PURE__ */ new Date()) {
|
|
20
|
-
return { ...payload, completedAt: at.toISOString() };
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
emptyPayload,
|
|
25
|
-
withAnswer,
|
|
26
|
-
payloadComplete,
|
|
27
|
-
payloadIsStale,
|
|
28
|
-
markComplete
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=chunk-YZ6KQULN.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/intakes/completion.ts"],"sourcesContent":["/**\n * Pure completion-state helpers for an intake payload — the small algebra over\n * the JSON blob the store persists. No I/O: the store reads/writes the row;\n * these functions only build and judge the payload shape, so the same logic\n * runs in the UI, the handlers, and the DB layer without divergence.\n *\n * A payload is `{ graphId, answers, completedAt? }`. It carries the answers\n * and the id of the graph they were collected against, so a later graph\n * revision can detect a stale payload (`graphId` mismatch) rather than\n * silently mixing answers from two question sets.\n */\n\nimport type { IntakeAnswers, IntakeAnswerValue, IntakeGraph } from './model'\nimport { isComplete } from './model'\n\n/** The persisted JSON for one intake (the `payload` column). */\nexport interface IntakePayload {\n /** The graph id the answers were collected against — guards stale schemas. */\n graphId: string\n answers: IntakeAnswers\n /** ISO-8601 instant the intake was completed, or undefined while in progress. */\n completedAt?: string\n}\n\n/** An empty payload for a fresh intake against `graph`. */\nexport function emptyPayload(graph: IntakeGraph): IntakePayload {\n return { graphId: graph.id, answers: {} }\n}\n\n/** A copy of `payload` with one answer set (does not mutate the input). */\nexport function withAnswer(\n payload: IntakePayload,\n questionId: string,\n value: IntakeAnswerValue,\n): IntakePayload {\n return { ...payload, answers: { ...payload.answers, [questionId]: value } }\n}\n\n/**\n * True when the payload's answers complete the graph AND the payload was\n * collected against THIS graph. A `graphId` mismatch is never \"complete\" —\n * the answers belong to a different question set and must be re-collected.\n */\nexport function payloadComplete(graph: IntakeGraph, payload: IntakePayload): boolean {\n if (payload.graphId !== graph.id) return false\n return isComplete(graph, payload.answers)\n}\n\n/** True when the payload was collected against a DIFFERENT graph revision. */\nexport function payloadIsStale(graph: IntakeGraph, payload: IntakePayload): boolean {\n return payload.graphId !== graph.id\n}\n\n/**\n * Stamp the payload complete at `at` (default now). Returns a copy; pure. The\n * caller has already checked `payloadComplete` — this only records the instant.\n */\nexport function markComplete(payload: IntakePayload, at: Date = new Date()): IntakePayload {\n return { ...payload, completedAt: at.toISOString() }\n}\n"],"mappings":";;;;;AAyBO,SAAS,aAAa,OAAmC;AAC9D,SAAO,EAAE,SAAS,MAAM,IAAI,SAAS,CAAC,EAAE;AAC1C;AAGO,SAAS,WACd,SACA,YACA,OACe;AACf,SAAO,EAAE,GAAG,SAAS,SAAS,EAAE,GAAG,QAAQ,SAAS,CAAC,UAAU,GAAG,MAAM,EAAE;AAC5E;AAOO,SAAS,gBAAgB,OAAoB,SAAiC;AACnF,MAAI,QAAQ,YAAY,MAAM,GAAI,QAAO;AACzC,SAAO,WAAW,OAAO,QAAQ,OAAO;AAC1C;AAGO,SAAS,eAAe,OAAoB,SAAiC;AAClF,SAAO,QAAQ,YAAY,MAAM;AACnC;AAMO,SAAS,aAAa,SAAwB,KAAW,oBAAI,KAAK,GAAkB;AACzF,SAAO,EAAE,GAAG,SAAS,aAAa,GAAG,YAAY,EAAE;AACrD;","names":[]}
|
package/dist/intakes/api.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Framework-neutral intake API: the get-current / save-answer / complete logic,
|
|
3
|
-
* lifted out of any one app's route file. Each app mounts these in its own
|
|
4
|
-
* route with its own auth — the handlers take an already-resolved store (the
|
|
5
|
-
* caller built it from `createUserIntakeStore` / `createProjectIntakeStore`
|
|
6
|
-
* after running RBAC), the intake graph, and the parsed inputs. They return
|
|
7
|
-
* web-standard `Response`s (available in Workers, Node 18+, Deno, browsers), so
|
|
8
|
-
* "framework-neutral" is literal: no Remix/React-Router/Express import anywhere.
|
|
9
|
-
*
|
|
10
|
-
* The handlers own the graph→HTTP mapping the UI needs: `getCurrentIntake`
|
|
11
|
-
* returns the loaded state PLUS the next question to ask (the question-graph
|
|
12
|
-
* traversal from the `./intakes` leaf) and the progress counter, so the client
|
|
13
|
-
* renders one question at a time without re-deriving the graph. Store
|
|
14
|
-
* `IntakeError`s map to typed 4xx codes, never a generic 500 — an invalid
|
|
15
|
-
* answer is a 400, an incomplete-complete is a 409, never a silent success.
|
|
16
|
-
*
|
|
17
|
-
* Imports `drizzle-orm` transitively (through the store types), so this is a
|
|
18
|
-
* subpath, never re-exported from root.
|
|
19
|
-
*/
|
|
20
|
-
import { type IntakeAnswerValue, type IntakeGraph, type IntakeQuestion } from './model';
|
|
21
|
-
import { type IntakeStore } from './drizzle/store';
|
|
22
|
-
/** What the client renders: the saved state, the next prompt, and progress. */
|
|
23
|
-
export interface CurrentIntakeView {
|
|
24
|
-
graphId: string;
|
|
25
|
-
title: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
answers: Record<string, IntakeAnswerValue>;
|
|
28
|
-
/** The next question to ask, or null when the interview is done. */
|
|
29
|
-
nextQuestion: IntakeQuestion | null;
|
|
30
|
-
completed: boolean;
|
|
31
|
-
completedAt: string | null;
|
|
32
|
-
progress: {
|
|
33
|
-
answered: number;
|
|
34
|
-
total: number;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/** Define configuration options for initializing the intake API with store and graph components */
|
|
38
|
-
export interface IntakeApiOptions {
|
|
39
|
-
store: IntakeStore;
|
|
40
|
-
graph: IntakeGraph;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Build the intake API bound to one store + graph. Returns three handlers; an
|
|
44
|
-
* app maps its route methods onto them (GET→getCurrentIntake, POST→saveAnswer,
|
|
45
|
-
* a complete action→completeIntake).
|
|
46
|
-
*/
|
|
47
|
-
export declare function createIntakeApi(opts: IntakeApiOptions): {
|
|
48
|
-
getCurrentIntake: () => Promise<Response>;
|
|
49
|
-
saveAnswer: (input: {
|
|
50
|
-
questionId?: string;
|
|
51
|
-
value?: IntakeAnswerValue;
|
|
52
|
-
}) => Promise<Response>;
|
|
53
|
-
completeIntake: () => Promise<Response>;
|
|
54
|
-
};
|
package/dist/intakes/api.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IntakeError
|
|
3
|
-
} from "../chunk-VWAEWOWK.js";
|
|
4
|
-
import "../chunk-YZ6KQULN.js";
|
|
5
|
-
import {
|
|
6
|
-
intakeProgress,
|
|
7
|
-
nextQuestion
|
|
8
|
-
} from "../chunk-JDEGS53O.js";
|
|
9
|
-
|
|
10
|
-
// src/intakes/api.ts
|
|
11
|
-
function createIntakeApi(opts) {
|
|
12
|
-
const { store, graph } = opts;
|
|
13
|
-
function view(state) {
|
|
14
|
-
return {
|
|
15
|
-
graphId: graph.id,
|
|
16
|
-
title: graph.title,
|
|
17
|
-
...graph.description ? { description: graph.description } : {},
|
|
18
|
-
answers: state.payload.answers,
|
|
19
|
-
nextQuestion: nextQuestion(graph, state.payload.answers),
|
|
20
|
-
completed: state.completed,
|
|
21
|
-
completedAt: state.completedAt ? state.completedAt.toISOString() : null,
|
|
22
|
-
progress: intakeProgress(graph, state.payload.answers)
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
async function getCurrentIntake() {
|
|
26
|
-
const state = await store.get();
|
|
27
|
-
return Response.json(view(state));
|
|
28
|
-
}
|
|
29
|
-
async function saveAnswer(input) {
|
|
30
|
-
if (!input.questionId) return Response.json({ error: "Missing questionId" }, { status: 400 });
|
|
31
|
-
try {
|
|
32
|
-
const state = await store.save(input.questionId, input.value ?? null);
|
|
33
|
-
return Response.json(view(state));
|
|
34
|
-
} catch (err) {
|
|
35
|
-
return intakeErrorResponse(err);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async function completeIntake() {
|
|
39
|
-
try {
|
|
40
|
-
const state = await store.complete();
|
|
41
|
-
return Response.json(view(state));
|
|
42
|
-
} catch (err) {
|
|
43
|
-
return intakeErrorResponse(err);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return { getCurrentIntake, saveAnswer, completeIntake };
|
|
47
|
-
}
|
|
48
|
-
var ERROR_STATUS = {
|
|
49
|
-
"invalid-answer": 400,
|
|
50
|
-
"unknown-question": 404,
|
|
51
|
-
incomplete: 409,
|
|
52
|
-
"stale-graph": 409
|
|
53
|
-
};
|
|
54
|
-
function intakeErrorResponse(err) {
|
|
55
|
-
if (err instanceof IntakeError) {
|
|
56
|
-
return Response.json({ error: err.message, code: err.code }, { status: ERROR_STATUS[err.code] ?? 400 });
|
|
57
|
-
}
|
|
58
|
-
throw err;
|
|
59
|
-
}
|
|
60
|
-
export {
|
|
61
|
-
createIntakeApi
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=api.js.map
|
package/dist/intakes/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/intakes/api.ts"],"sourcesContent":["/**\n * Framework-neutral intake API: the get-current / save-answer / complete logic,\n * lifted out of any one app's route file. Each app mounts these in its own\n * route with its own auth — the handlers take an already-resolved store (the\n * caller built it from `createUserIntakeStore` / `createProjectIntakeStore`\n * after running RBAC), the intake graph, and the parsed inputs. They return\n * web-standard `Response`s (available in Workers, Node 18+, Deno, browsers), so\n * \"framework-neutral\" is literal: no Remix/React-Router/Express import anywhere.\n *\n * The handlers own the graph→HTTP mapping the UI needs: `getCurrentIntake`\n * returns the loaded state PLUS the next question to ask (the question-graph\n * traversal from the `./intakes` leaf) and the progress counter, so the client\n * renders one question at a time without re-deriving the graph. Store\n * `IntakeError`s map to typed 4xx codes, never a generic 500 — an invalid\n * answer is a 400, an incomplete-complete is a 409, never a silent success.\n *\n * Imports `drizzle-orm` transitively (through the store types), so this is a\n * subpath, never re-exported from root.\n */\n\nimport {\n type IntakeAnswerValue,\n type IntakeGraph,\n type IntakeQuestion,\n intakeProgress,\n nextQuestion,\n} from './model'\nimport { type IntakeStore, IntakeError } from './drizzle/store'\n\n/** What the client renders: the saved state, the next prompt, and progress. */\nexport interface CurrentIntakeView {\n graphId: string\n title: string\n description?: string\n answers: Record<string, IntakeAnswerValue>\n /** The next question to ask, or null when the interview is done. */\n nextQuestion: IntakeQuestion | null\n completed: boolean\n completedAt: string | null\n progress: { answered: number; total: number }\n}\n\n/** Define configuration options for initializing the intake API with store and graph components */\nexport interface IntakeApiOptions {\n store: IntakeStore\n graph: IntakeGraph\n}\n\n/**\n * Build the intake API bound to one store + graph. Returns three handlers; an\n * app maps its route methods onto them (GET→getCurrentIntake, POST→saveAnswer,\n * a complete action→completeIntake).\n */\nexport function createIntakeApi(opts: IntakeApiOptions) {\n const { store, graph } = opts\n\n function view(state: Awaited<ReturnType<IntakeStore['get']>>): CurrentIntakeView {\n return {\n graphId: graph.id,\n title: graph.title,\n ...(graph.description ? { description: graph.description } : {}),\n answers: state.payload.answers,\n nextQuestion: nextQuestion(graph, state.payload.answers),\n completed: state.completed,\n completedAt: state.completedAt ? state.completedAt.toISOString() : null,\n progress: intakeProgress(graph, state.payload.answers),\n }\n }\n\n async function getCurrentIntake(): Promise<Response> {\n const state = await store.get()\n return Response.json(view(state))\n }\n\n async function saveAnswer(input: { questionId?: string; value?: IntakeAnswerValue }): Promise<Response> {\n if (!input.questionId) return Response.json({ error: 'Missing questionId' }, { status: 400 })\n try {\n const state = await store.save(input.questionId, input.value ?? null)\n return Response.json(view(state))\n } catch (err) {\n return intakeErrorResponse(err)\n }\n }\n\n async function completeIntake(): Promise<Response> {\n try {\n const state = await store.complete()\n return Response.json(view(state))\n } catch (err) {\n return intakeErrorResponse(err)\n }\n }\n\n return { getCurrentIntake, saveAnswer, completeIntake }\n}\n\nconst ERROR_STATUS: Record<string, number> = {\n 'invalid-answer': 400,\n 'unknown-question': 404,\n incomplete: 409,\n 'stale-graph': 409,\n}\n\nfunction intakeErrorResponse(err: unknown): Response {\n if (err instanceof IntakeError) {\n return Response.json({ error: err.message, code: err.code }, { status: ERROR_STATUS[err.code] ?? 400 })\n }\n throw err\n}\n"],"mappings":";;;;;;;;;;AAqDO,SAAS,gBAAgB,MAAwB;AACtD,QAAM,EAAE,OAAO,MAAM,IAAI;AAEzB,WAAS,KAAK,OAAmE;AAC/E,WAAO;AAAA,MACL,SAAS,MAAM;AAAA,MACf,OAAO,MAAM;AAAA,MACb,GAAI,MAAM,cAAc,EAAE,aAAa,MAAM,YAAY,IAAI,CAAC;AAAA,MAC9D,SAAS,MAAM,QAAQ;AAAA,MACvB,cAAc,aAAa,OAAO,MAAM,QAAQ,OAAO;AAAA,MACvD,WAAW,MAAM;AAAA,MACjB,aAAa,MAAM,cAAc,MAAM,YAAY,YAAY,IAAI;AAAA,MACnE,UAAU,eAAe,OAAO,MAAM,QAAQ,OAAO;AAAA,IACvD;AAAA,EACF;AAEA,iBAAe,mBAAsC;AACnD,UAAM,QAAQ,MAAM,MAAM,IAAI;AAC9B,WAAO,SAAS,KAAK,KAAK,KAAK,CAAC;AAAA,EAClC;AAEA,iBAAe,WAAW,OAA8E;AACtG,QAAI,CAAC,MAAM,WAAY,QAAO,SAAS,KAAK,EAAE,OAAO,qBAAqB,GAAG,EAAE,QAAQ,IAAI,CAAC;AAC5F,QAAI;AACF,YAAM,QAAQ,MAAM,MAAM,KAAK,MAAM,YAAY,MAAM,SAAS,IAAI;AACpE,aAAO,SAAS,KAAK,KAAK,KAAK,CAAC;AAAA,IAClC,SAAS,KAAK;AACZ,aAAO,oBAAoB,GAAG;AAAA,IAChC;AAAA,EACF;AAEA,iBAAe,iBAAoC;AACjD,QAAI;AACF,YAAM,QAAQ,MAAM,MAAM,SAAS;AACnC,aAAO,SAAS,KAAK,KAAK,KAAK,CAAC;AAAA,IAClC,SAAS,KAAK;AACZ,aAAO,oBAAoB,GAAG;AAAA,IAChC;AAAA,EACF;AAEA,SAAO,EAAE,kBAAkB,YAAY,eAAe;AACxD;AAEA,IAAM,eAAuC;AAAA,EAC3C,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,eAAe;AACjB;AAEA,SAAS,oBAAoB,KAAwB;AACnD,MAAI,eAAe,aAAa;AAC9B,WAAO,SAAS,KAAK,EAAE,OAAO,IAAI,SAAS,MAAM,IAAI,KAAK,GAAG,EAAE,QAAQ,aAAa,IAAI,IAAI,KAAK,IAAI,CAAC;AAAA,EACxG;AACA,QAAM;AACR;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Load the canonical Tangle knot only when an intakes surface renders it.
|
|
3
|
-
* `/brand` imports the optional `@tangle-network/brand` peer, so a failed load
|
|
4
|
-
* renders a fixed-size spacer instead of crashing the panel.
|
|
5
|
-
*/
|
|
6
|
-
export interface BrandMarkProps {
|
|
7
|
-
size: number;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function BrandMark({ size, className }: BrandMarkProps): import("react").JSX.Element;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent-led intake interview: asks one question at a time, advancing as each
|
|
3
|
-
* answer is saved. Fully callback-driven — the host supplies the loaded `view`
|
|
4
|
-
* and the async `onAnswer` / `onComplete` callbacks (backed by `./intakes/api`),
|
|
5
|
-
* so this imports no app router, fetch client, or toast. Styled with the
|
|
6
|
-
* shipped Tangle Quiet tokens (`var(--*)`).
|
|
7
|
-
*
|
|
8
|
-
* The server owns traversal: each `onAnswer` resolves with the next view (next
|
|
9
|
-
* question + progress), so the component never re-derives the graph — it renders
|
|
10
|
-
* `view.nextQuestion`, and when that is null and the view is completable it
|
|
11
|
-
* shows the finish action. Local validation only gates the submit button; the
|
|
12
|
-
* authoritative validation runs in the store.
|
|
13
|
-
*/
|
|
14
|
-
import type { IntakeInterviewProps } from '../contracts';
|
|
15
|
-
export declare function IntakeInterview({ view: initialView, onAnswer, onComplete, onDone, onNotice, }: IntakeInterviewProps): import("react").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './IntakeInterview';
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Seams between the intakes React surface and the host app. Everything here is
|
|
3
|
-
* interface-only and callback-driven: the components never import an app's
|
|
4
|
-
* router, fetch client, or toast system. The host passes the loaded view in and
|
|
5
|
-
* supplies the async callbacks (which it backs with `./intakes/api` over fetch),
|
|
6
|
-
* so the same interview mounts in any app and for either scope (user / project).
|
|
7
|
-
*/
|
|
8
|
-
import type { IntakeAnswerValue, IntakeQuestion } from '../intakes/model';
|
|
9
|
-
/** The state the interview renders — the shape `./intakes/api` returns. */
|
|
10
|
-
export interface IntakeView {
|
|
11
|
-
title: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
answers: Record<string, IntakeAnswerValue>;
|
|
14
|
-
/** The next question to ask, or null when the interview is done. */
|
|
15
|
-
nextQuestion: IntakeQuestion | null;
|
|
16
|
-
completed: boolean;
|
|
17
|
-
progress: {
|
|
18
|
-
answered: number;
|
|
19
|
-
total: number;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
/** Define properties and callbacks for managing the intake interview flow and user interactions */
|
|
23
|
-
export interface IntakeInterviewProps {
|
|
24
|
-
view: IntakeView;
|
|
25
|
-
/**
|
|
26
|
-
* Persist one answer; resolve with the next view (the server re-derives the
|
|
27
|
-
* next question + progress). The component re-renders from the returned view.
|
|
28
|
-
*/
|
|
29
|
-
onAnswer(input: {
|
|
30
|
-
questionId: string;
|
|
31
|
-
value: IntakeAnswerValue;
|
|
32
|
-
}): Promise<IntakeView>;
|
|
33
|
-
/** Finish the interview; resolve with the final view. */
|
|
34
|
-
onComplete(): Promise<IntakeView>;
|
|
35
|
-
/** Called once when the interview is done (completed view), for navigation. */
|
|
36
|
-
onDone?(): void;
|
|
37
|
-
/** Optional toast/notice hook; defaults to a no-op (host owns its UX). */
|
|
38
|
-
onNotice?(notice: {
|
|
39
|
-
kind: 'success' | 'error';
|
|
40
|
-
message: string;
|
|
41
|
-
}): void;
|
|
42
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React surface for the intakes module: the IntakeInterview (one question at a
|
|
3
|
-
* time, agent-led), plus its seams. Everything is callback-driven — no app
|
|
4
|
-
* router, fetch client, or toast import — so any app mounts it and wires it to
|
|
5
|
-
* `./intakes/api` over fetch, for either the per-user onboarding scope or the
|
|
6
|
-
* per-project intake scope.
|
|
7
|
-
*
|
|
8
|
-
* Never re-exported from the package root: `react` is an optional peer (the
|
|
9
|
-
* `web-react` / `teams-react` precedent). DOM access begins only inside
|
|
10
|
-
* component render. A `React.lazy` code-split entry lives at
|
|
11
|
-
* `./intakes-react/lazy`.
|
|
12
|
-
*/
|
|
13
|
-
export * from './contracts';
|
|
14
|
-
export * from './components/index';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Code-split entry for the intakes React surface. Products that don't need the
|
|
3
|
-
* interview UI on initial load import this `React.lazy` handle instead of the
|
|
4
|
-
* component directly, so the interview chunk loads on first render. Mount inside
|
|
5
|
-
* a `<Suspense>` boundary; the product provides the fallback.
|
|
6
|
-
*/
|
|
7
|
-
import type { IntakeInterviewProps } from './contracts';
|
|
8
|
-
export type { IntakeInterviewProps };
|
|
9
|
-
/** Load IntakeInterview component lazily to optimize initial application rendering */
|
|
10
|
-
export declare const IntakeInterviewLazy: import("react").LazyExoticComponent<typeof import("./components").IntakeInterview>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// src/intakes-react/lazy.tsx
|
|
2
|
-
import { lazy } from "react";
|
|
3
|
-
var IntakeInterviewLazy = lazy(
|
|
4
|
-
() => import("../IntakeInterview-OKT6DCBN.js").then((m) => ({ default: m.IntakeInterview }))
|
|
5
|
-
);
|
|
6
|
-
export {
|
|
7
|
-
IntakeInterviewLazy
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=lazy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/intakes-react/lazy.tsx"],"sourcesContent":["/**\n * Code-split entry for the intakes React surface. Products that don't need the\n * interview UI on initial load import this `React.lazy` handle instead of the\n * component directly, so the interview chunk loads on first render. Mount inside\n * a `<Suspense>` boundary; the product provides the fallback.\n */\n\nimport { lazy } from 'react'\nimport type { IntakeInterviewProps } from './contracts'\n\nexport type { IntakeInterviewProps }\n\n/** Load IntakeInterview component lazily to optimize initial application rendering */\nexport const IntakeInterviewLazy = lazy(\n () => import('./components/IntakeInterview').then((m) => ({ default: m.IntakeInterview })),\n)\n"],"mappings":";AAOA,SAAS,YAAY;AAMd,IAAM,sBAAsB;AAAA,EACjC,MAAM,OAAO,gCAA8B,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE;AAC3F;","names":[]}
|
|
File without changes
|