@locusgraph/loop 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +35 -2
- package/dist/agent/index.d.ts +5 -0
- package/dist/agent/index.js +5 -0
- package/dist/agent/pulse/gradient-label.d.ts +7 -0
- package/dist/agent/pulse/gradient-label.js +23 -0
- package/dist/agent/pulse/marks/bars-mark.d.ts +1 -0
- package/dist/agent/pulse/marks/bars-mark.js +15 -0
- package/dist/agent/pulse/marks/glyph-mark.d.ts +4 -0
- package/dist/agent/pulse/marks/glyph-mark.js +17 -0
- package/dist/agent/pulse/marks/locus-mark.d.ts +1 -0
- package/dist/agent/pulse/marks/locus-mark.js +38 -0
- package/dist/agent/pulse/marks/orb-mark.d.ts +1 -0
- package/dist/agent/pulse/marks/orb-mark.js +11 -0
- package/dist/agent/pulse/marks/spinner-mark.d.ts +1 -0
- package/dist/agent/pulse/marks/spinner-mark.js +4 -0
- package/dist/agent/pulse/pulse-tone.d.ts +1 -0
- package/dist/agent/pulse/pulse-tone.js +1 -0
- package/dist/agent/pulse/pulse.d.ts +12 -0
- package/dist/agent/pulse/pulse.js +51 -0
- package/dist/agent/pulse/use-loop-animation.d.ts +2 -0
- package/dist/agent/pulse/use-loop-animation.js +21 -0
- package/dist/agent/shared/status-dot.d.ts +1 -0
- package/dist/agent/shared/status-dot.js +1 -0
- package/dist/agent/steps/step-icon.d.ts +8 -0
- package/dist/agent/steps/step-icon.js +31 -0
- package/dist/agent/steps/steps.d.ts +7 -0
- package/dist/agent/steps/steps.js +39 -0
- package/dist/agent/thinking/thinking.d.ts +6 -0
- package/dist/agent/thinking/thinking.js +31 -0
- package/dist/agent/thinking/thought-duration.d.ts +2 -0
- package/dist/agent/thinking/thought-duration.js +13 -0
- package/dist/agent/tool/json-block.d.ts +5 -0
- package/dist/agent/tool/json-block.js +15 -0
- package/dist/agent/tool/tool-status.d.ts +6 -0
- package/dist/agent/tool/tool-status.js +26 -0
- package/dist/agent/tool/tool.d.ts +7 -0
- package/dist/agent/tool/tool.js +14 -0
- package/dist/approval/inbox/inbox-row.d.ts +11 -0
- package/dist/approval/inbox/inbox-row.js +14 -0
- package/dist/approval/inbox/inbox-selection.d.ts +6 -0
- package/dist/approval/inbox/inbox-selection.js +21 -0
- package/dist/approval/inbox/inbox.d.ts +11 -0
- package/dist/approval/inbox/inbox.js +26 -0
- package/dist/approval/index.d.ts +9 -0
- package/dist/approval/index.js +8 -0
- package/dist/approval/memory/memory-choices.d.ts +10 -0
- package/dist/approval/memory/memory-choices.js +30 -0
- package/dist/approval/memory/memory-review.d.ts +11 -0
- package/dist/approval/memory/memory-review.js +31 -0
- package/dist/approval/memory/memory-row.d.ts +9 -0
- package/dist/approval/memory/memory-row.js +30 -0
- package/dist/approval/plan/plan-review.d.ts +13 -0
- package/dist/approval/plan/plan-review.js +38 -0
- package/dist/approval/plan/plan-step-row.d.ts +13 -0
- package/dist/approval/plan/plan-step-row.js +50 -0
- package/dist/approval/plan/plan-steps.d.ts +8 -0
- package/dist/approval/plan/plan-steps.js +29 -0
- package/dist/approval/plan/question-choices.d.ts +10 -0
- package/dist/approval/plan/question-choices.js +47 -0
- package/dist/approval/plan/question.d.ts +18 -0
- package/dist/approval/plan/question.js +35 -0
- package/dist/approval/run/run-bar.d.ts +13 -0
- package/dist/approval/run/run-bar.js +33 -0
- package/dist/approval/shared/decision-line.d.ts +1 -0
- package/dist/approval/shared/decision-line.js +1 -0
- package/dist/approval/shared/risk-badge.d.ts +10 -0
- package/dist/approval/shared/risk-badge.js +26 -0
- package/dist/approval/shared/time.d.ts +3 -0
- package/dist/approval/shared/time.js +15 -0
- package/dist/approval/shared/use-focus-on-mount.d.ts +2 -0
- package/dist/approval/shared/use-focus-on-mount.js +9 -0
- package/dist/approval/spend/raise-cap-form.d.ts +8 -0
- package/dist/approval/spend/raise-cap-form.js +26 -0
- package/dist/approval/spend/spend-gate.d.ts +16 -0
- package/dist/approval/spend/spend-gate.js +32 -0
- package/dist/approval/spend/spend-math.d.ts +5 -0
- package/dist/approval/spend/spend-math.js +18 -0
- package/dist/approval/spend/spend-meter.d.ts +10 -0
- package/dist/approval/spend/spend-meter.js +49 -0
- package/dist/approval/tool/approval.d.ts +14 -0
- package/dist/approval/tool/approval.js +45 -0
- package/dist/approval/tool/args/args-editor.d.ts +16 -0
- package/dist/approval/tool/args/args-editor.js +37 -0
- package/dist/approval/tool/args/args-field.d.ts +11 -0
- package/dist/approval/tool/args/args-field.js +28 -0
- package/dist/approval/tool/args/args-validation.d.ts +8 -0
- package/dist/approval/tool/args/args-validation.js +59 -0
- package/dist/approval/tool/deny-form.d.ts +6 -0
- package/dist/approval/tool/deny-form.js +15 -0
- package/dist/approval/tool/tool-inputs.d.ts +6 -0
- package/dist/approval/tool/tool-inputs.js +53 -0
- package/dist/approval/types.d.ts +59 -0
- package/dist/approval/types.js +1 -0
- package/dist/chat/chat/chat.d.ts +7 -0
- package/dist/chat/chat/chat.js +11 -0
- package/dist/chat/chat/use-stick-to-bottom.d.ts +7 -0
- package/dist/chat/chat/use-stick-to-bottom.js +57 -0
- package/dist/chat/composer/composer-actions.d.ts +15 -0
- package/dist/chat/composer/composer-actions.js +23 -0
- package/dist/chat/composer/composer.d.ts +20 -0
- package/dist/chat/composer/composer.js +42 -0
- package/dist/chat/composer/use-auto-grow.d.ts +2 -0
- package/dist/chat/composer/use-auto-grow.js +14 -0
- package/dist/chat/files/file-meta.d.ts +13 -0
- package/dist/chat/files/file-meta.js +30 -0
- package/dist/chat/files/files.d.ts +9 -0
- package/dist/chat/files/files.js +39 -0
- package/dist/chat/index.d.ts +7 -0
- package/dist/chat/index.js +7 -0
- package/dist/chat/reply/fenced-code.d.ts +8 -0
- package/dist/chat/reply/fenced-code.js +29 -0
- package/dist/chat/reply/markdown-components.d.ts +2 -0
- package/dist/chat/reply/markdown-components.js +22 -0
- package/dist/chat/reply/reply.d.ts +8 -0
- package/dist/chat/reply/reply.js +21 -0
- package/dist/chat/turn/group-parts.d.ts +24 -0
- package/dist/chat/turn/group-parts.js +35 -0
- package/dist/chat/turn/turn.d.ts +11 -0
- package/dist/chat/turn/turn.js +45 -0
- package/dist/cost/context.d.ts +13 -0
- package/dist/cost/context.js +35 -0
- package/dist/cost/cost-steps.d.ts +17 -0
- package/dist/cost/cost-steps.js +24 -0
- package/dist/cost/cost.d.ts +8 -0
- package/dist/cost/cost.js +37 -0
- package/dist/cost/index.d.ts +4 -0
- package/dist/cost/index.js +4 -0
- package/dist/cost/model-picker.d.ts +11 -0
- package/dist/cost/model-picker.js +9 -0
- package/dist/cost/shared/context-breakdown.d.ts +15 -0
- package/dist/cost/shared/context-breakdown.js +17 -0
- package/dist/cost/shared/meter-marks.d.ts +9 -0
- package/dist/cost/shared/meter-marks.js +16 -0
- package/dist/cost/shared/model-option-row.d.ts +14 -0
- package/dist/cost/shared/model-option-row.js +32 -0
- package/dist/cost/shared/step-cost-row.d.ts +15 -0
- package/dist/cost/shared/step-cost-row.js +34 -0
- package/dist/cost/shared/usage-totals.d.ts +11 -0
- package/dist/cost/shared/usage-totals.js +26 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/memory/cite.d.ts +8 -0
- package/dist/memory/cite.js +19 -0
- package/dist/memory/index.d.ts +5 -0
- package/dist/memory/index.js +4 -0
- package/dist/memory/memorized.d.ts +14 -0
- package/dist/memory/memorized.js +19 -0
- package/dist/memory/recall.d.ts +9 -0
- package/dist/memory/recall.js +24 -0
- package/dist/memory/shared/disclosure.d.ts +6 -0
- package/dist/memory/shared/disclosure.js +6 -0
- package/dist/memory/shared/host-label.d.ts +6 -0
- package/dist/memory/shared/host-label.js +34 -0
- package/dist/memory/shared/source-mark.d.ts +5 -0
- package/dist/memory/shared/source-mark.js +6 -0
- package/dist/memory/sources.d.ts +9 -0
- package/dist/memory/sources.js +22 -0
- package/dist/shared/decision-summary.d.ts +18 -0
- package/dist/shared/decision-summary.js +25 -0
- package/dist/shared/panel-empty.d.ts +8 -0
- package/dist/shared/panel-empty.js +5 -0
- package/dist/shared/panel.d.ts +19 -0
- package/dist/shared/panel.js +21 -0
- package/dist/shared/status-dot.d.ts +6 -0
- package/dist/shared/status-dot.js +12 -0
- package/dist/sources.css +1 -0
- package/dist/thread/actions/action-button.d.ts +8 -0
- package/dist/thread/actions/action-button.js +5 -0
- package/dist/thread/actions/actions.d.ts +13 -0
- package/dist/thread/actions/actions.js +21 -0
- package/dist/thread/actions/branch-switcher.d.ts +10 -0
- package/dist/thread/actions/branch-switcher.js +7 -0
- package/dist/thread/canvas/canvas.d.ts +14 -0
- package/dist/thread/canvas/canvas.js +12 -0
- package/dist/thread/canvas/version-switcher.d.ts +12 -0
- package/dist/thread/canvas/version-switcher.js +11 -0
- package/dist/thread/code/code.d.ts +10 -0
- package/dist/thread/code/code.js +33 -0
- package/dist/thread/code/copy-code-button.d.ts +6 -0
- package/dist/thread/code/copy-code-button.js +18 -0
- package/dist/thread/code/highlight.d.ts +1 -0
- package/dist/thread/code/highlight.js +39 -0
- package/dist/thread/history/history-row.d.ts +14 -0
- package/dist/thread/history/history-row.js +17 -0
- package/dist/thread/history/history.d.ts +15 -0
- package/dist/thread/history/history.js +10 -0
- package/dist/thread/history/thread-groups.d.ts +8 -0
- package/dist/thread/history/thread-groups.js +46 -0
- package/dist/thread/history/thread-item-menu.d.ts +7 -0
- package/dist/thread/history/thread-item-menu.js +6 -0
- package/dist/thread/history/thread-title-editor.d.ts +7 -0
- package/dist/thread/history/thread-title-editor.js +25 -0
- package/dist/thread/index.d.ts +8 -0
- package/dist/thread/index.js +5 -0
- package/dist/thread/starters/starters.d.ts +12 -0
- package/dist/thread/starters/starters.js +15 -0
- package/dist/thread/use-copied.d.ts +5 -0
- package/dist/thread/use-copied.js +22 -0
- package/dist/types.d.ts +70 -0
- package/dist/types.js +3 -0
- package/package.json +57 -3
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export type AgentRole = "user" | "assistant" | "system";
|
|
2
|
+
export type StreamState = "streaming" | "done";
|
|
3
|
+
export type TextPart = {
|
|
4
|
+
type: "text";
|
|
5
|
+
text: string;
|
|
6
|
+
state?: StreamState;
|
|
7
|
+
};
|
|
8
|
+
export type ReasoningPart = {
|
|
9
|
+
type: "reasoning";
|
|
10
|
+
text: string;
|
|
11
|
+
state?: StreamState;
|
|
12
|
+
durationMs?: number;
|
|
13
|
+
};
|
|
14
|
+
export type ToolState = "input-streaming" | "input-available" | "approval-requested" | "approval-responded" | "output-available" | "output-error" | "output-denied";
|
|
15
|
+
export type ToolPart = {
|
|
16
|
+
type: `tool-${string}` | "dynamic-tool";
|
|
17
|
+
toolCallId: string;
|
|
18
|
+
toolName?: string;
|
|
19
|
+
state: ToolState;
|
|
20
|
+
input?: unknown;
|
|
21
|
+
output?: unknown;
|
|
22
|
+
errorText?: string;
|
|
23
|
+
};
|
|
24
|
+
export type SourceUrlPart = {
|
|
25
|
+
type: "source-url";
|
|
26
|
+
sourceId: string;
|
|
27
|
+
url: string;
|
|
28
|
+
title?: string;
|
|
29
|
+
};
|
|
30
|
+
export type FilePart = {
|
|
31
|
+
type: "file";
|
|
32
|
+
mediaType: string;
|
|
33
|
+
url: string;
|
|
34
|
+
filename?: string;
|
|
35
|
+
};
|
|
36
|
+
export type MessagePart = TextPart | ReasoningPart | ToolPart | SourceUrlPart | FilePart;
|
|
37
|
+
export type AgentMessage = {
|
|
38
|
+
id: string;
|
|
39
|
+
role: AgentRole;
|
|
40
|
+
parts: MessagePart[];
|
|
41
|
+
};
|
|
42
|
+
export type RiskLevel = "read" | "write" | "destructive";
|
|
43
|
+
export type StepStatus = "pending" | "running" | "done" | "failed" | "skipped";
|
|
44
|
+
export type AgentStep = {
|
|
45
|
+
id: string;
|
|
46
|
+
title: string;
|
|
47
|
+
status: StepStatus;
|
|
48
|
+
detail?: string;
|
|
49
|
+
};
|
|
50
|
+
export type Citation = {
|
|
51
|
+
index: number;
|
|
52
|
+
title: string;
|
|
53
|
+
url?: string;
|
|
54
|
+
snippet?: string;
|
|
55
|
+
};
|
|
56
|
+
export type MemoryRef = {
|
|
57
|
+
id: string;
|
|
58
|
+
label: string;
|
|
59
|
+
kind?: string;
|
|
60
|
+
relevance?: number;
|
|
61
|
+
snippet?: string;
|
|
62
|
+
};
|
|
63
|
+
export type RunUsage = {
|
|
64
|
+
inputTokens: number;
|
|
65
|
+
outputTokens: number;
|
|
66
|
+
costMicroUsd: number;
|
|
67
|
+
model?: string;
|
|
68
|
+
failed?: boolean;
|
|
69
|
+
};
|
|
70
|
+
export declare function toolNameOf(part: ToolPart): string;
|
package/dist/types.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusgraph/loop",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Agent components for LocusGraph apps: chat, agent steps, human-in-the-loop approvals, memory and cost. Takes Vercel AI SDK UIMessage parts; never calls a model.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/locusgraph/design.git",
|
|
9
|
+
"directory": "packages/loop"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://design.locusgraph.com",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"**/*.css"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./sources.css": "./dist/sources.css"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"registry": "https://registry.npmjs.org",
|
|
28
|
+
"access": "public",
|
|
29
|
+
"provenance": true
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@locusgraph/components": "^0.2.0",
|
|
33
|
+
"react": "^19.2.0",
|
|
34
|
+
"react-dom": "^19.2.0"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@carbon/icons-react": "11.89.0",
|
|
38
|
+
"@locusgraph/brand": "0.2.0",
|
|
39
|
+
"@locusgraph/utils": "0.1.1",
|
|
40
|
+
"react-markdown": "^10.1.0",
|
|
41
|
+
"remark-gfm": "^4.0.1",
|
|
42
|
+
"shiki": "^4.5.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@locusgraph/components": "0.2.0",
|
|
46
|
+
"@locusgraph/config": "0.1.1",
|
|
47
|
+
"@types/node": "^22.0.0",
|
|
48
|
+
"@types/react": "^19.2.0",
|
|
49
|
+
"@types/react-dom": "^19.2.0",
|
|
50
|
+
"react": "19.2.8",
|
|
51
|
+
"react-dom": "19.2.8",
|
|
52
|
+
"typescript": "^7.0.2",
|
|
53
|
+
"vitest": "^5.0.3"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && cp src/sources.css dist/sources.css && node ../../scripts/esm-extensions.mjs dist",
|
|
57
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
58
|
+
"test": "vitest run"
|
|
59
|
+
}
|
|
6
60
|
}
|