@swarmclawai/swarmclaw 0.7.2 → 0.7.3
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/README.md +81 -22
- package/package.json +1 -1
- package/src/app/api/agents/[id]/route.ts +26 -0
- package/src/app/api/agents/[id]/thread/route.ts +36 -7
- package/src/app/api/agents/route.ts +12 -1
- package/src/app/api/auth/route.ts +76 -7
- package/src/app/api/chatrooms/[id]/chat/route.ts +7 -2
- package/src/app/api/chats/[id]/browser/route.ts +5 -1
- package/src/app/api/chats/[id]/chat/route.ts +7 -3
- package/src/app/api/chats/[id]/main-loop/route.ts +7 -88
- package/src/app/api/chats/[id]/messages/route.ts +19 -13
- package/src/app/api/chats/[id]/route.ts +18 -0
- package/src/app/api/chats/[id]/stop/route.ts +6 -1
- package/src/app/api/chats/route.ts +16 -0
- package/src/app/api/connectors/[id]/doctor/route.ts +26 -0
- package/src/app/api/connectors/doctor/route.ts +13 -0
- package/src/app/api/files/open/route.ts +16 -14
- package/src/app/api/memory/maintenance/route.ts +11 -1
- package/src/app/api/openclaw/agent-files/route.ts +27 -4
- package/src/app/api/openclaw/skills/route.ts +11 -3
- package/src/app/api/plugins/dependencies/route.ts +24 -0
- package/src/app/api/plugins/install/route.ts +15 -92
- package/src/app/api/plugins/route.ts +3 -26
- package/src/app/api/plugins/settings/route.ts +17 -12
- package/src/app/api/plugins/ui/route.ts +1 -0
- package/src/app/api/settings/route.ts +49 -7
- package/src/app/api/tasks/[id]/route.ts +15 -6
- package/src/app/api/tasks/bulk/route.ts +2 -2
- package/src/app/api/tasks/route.ts +9 -4
- package/src/app/api/webhooks/[id]/route.ts +8 -1
- package/src/app/page.tsx +9 -2
- package/src/cli/index.js +4 -0
- package/src/cli/index.ts +3 -10
- package/src/components/agents/agent-card.tsx +15 -12
- package/src/components/agents/agent-chat-list.tsx +101 -1
- package/src/components/agents/agent-list.tsx +46 -9
- package/src/components/agents/agent-sheet.tsx +207 -16
- package/src/components/agents/inspector-panel.tsx +108 -48
- package/src/components/auth/access-key-gate.tsx +36 -97
- package/src/components/chat/chat-area.tsx +29 -13
- package/src/components/chat/chat-card.tsx +4 -20
- package/src/components/chat/chat-header.tsx +255 -353
- package/src/components/chat/chat-list.tsx +7 -9
- package/src/components/chat/checkpoint-timeline.tsx +1 -1
- package/src/components/chat/message-list.tsx +3 -1
- package/src/components/chatrooms/chatroom-view.tsx +347 -205
- package/src/components/connectors/connector-list.tsx +265 -127
- package/src/components/connectors/connector-sheet.tsx +217 -0
- package/src/components/home/home-view.tsx +128 -4
- package/src/components/layout/app-layout.tsx +383 -194
- package/src/components/layout/mobile-header.tsx +26 -8
- package/src/components/plugins/plugin-list.tsx +15 -3
- package/src/components/plugins/plugin-sheet.tsx +118 -9
- package/src/components/projects/project-detail.tsx +183 -0
- package/src/components/shared/agent-picker-list.tsx +2 -2
- package/src/components/shared/command-palette.tsx +111 -24
- package/src/components/shared/settings/plugin-manager.tsx +20 -4
- package/src/components/shared/settings/section-capability-policy.tsx +105 -0
- package/src/components/shared/settings/section-heartbeat.tsx +77 -0
- package/src/components/shared/settings/section-orchestrator.tsx +3 -3
- package/src/components/shared/settings/section-runtime-loop.tsx +5 -5
- package/src/components/shared/settings/section-secrets.tsx +6 -6
- package/src/components/shared/settings/section-user-preferences.tsx +1 -1
- package/src/components/shared/settings/section-voice.tsx +5 -1
- package/src/components/shared/settings/section-web-search.tsx +10 -2
- package/src/components/shared/settings/settings-page.tsx +245 -46
- package/src/components/tasks/approvals-panel.tsx +205 -18
- package/src/components/tasks/task-board.tsx +242 -46
- package/src/components/usage/metrics-dashboard.tsx +74 -1
- package/src/components/wallets/wallet-panel.tsx +17 -5
- package/src/components/webhooks/webhook-sheet.tsx +7 -7
- package/src/lib/auth.ts +17 -0
- package/src/lib/chat-streaming-state.test.ts +108 -0
- package/src/lib/chat-streaming-state.ts +108 -0
- package/src/lib/openclaw-agent-id.test.ts +14 -0
- package/src/lib/openclaw-agent-id.ts +31 -0
- package/src/lib/server/agent-assignment.test.ts +112 -0
- package/src/lib/server/agent-assignment.ts +169 -0
- package/src/lib/server/approval-connector-notify.test.ts +253 -0
- package/src/lib/server/approvals-auto-approve.test.ts +205 -0
- package/src/lib/server/approvals.ts +483 -75
- package/src/lib/server/autonomy-runtime.test.ts +341 -0
- package/src/lib/server/browser-state.test.ts +118 -0
- package/src/lib/server/browser-state.ts +123 -0
- package/src/lib/server/build-llm.test.ts +36 -0
- package/src/lib/server/build-llm.ts +11 -4
- package/src/lib/server/builtin-plugins.ts +34 -0
- package/src/lib/server/chat-execution-heartbeat.test.ts +40 -0
- package/src/lib/server/chat-execution-tool-events.test.ts +134 -0
- package/src/lib/server/chat-execution.ts +250 -61
- package/src/lib/server/chatroom-health.test.ts +26 -0
- package/src/lib/server/chatroom-health.ts +2 -3
- package/src/lib/server/chatroom-helpers.test.ts +67 -2
- package/src/lib/server/chatroom-helpers.ts +45 -5
- package/src/lib/server/connectors/discord.ts +175 -11
- package/src/lib/server/connectors/doctor.test.ts +80 -0
- package/src/lib/server/connectors/doctor.ts +116 -0
- package/src/lib/server/connectors/manager.ts +946 -110
- package/src/lib/server/connectors/policy.test.ts +222 -0
- package/src/lib/server/connectors/policy.ts +452 -0
- package/src/lib/server/connectors/slack.ts +188 -9
- package/src/lib/server/connectors/telegram.ts +65 -15
- package/src/lib/server/connectors/thread-context.test.ts +44 -0
- package/src/lib/server/connectors/thread-context.ts +72 -0
- package/src/lib/server/connectors/types.ts +41 -11
- package/src/lib/server/daemon-state.ts +59 -1
- package/src/lib/server/data-dir.ts +13 -0
- package/src/lib/server/delegation-jobs.test.ts +140 -0
- package/src/lib/server/delegation-jobs.ts +248 -0
- package/src/lib/server/document-utils.test.ts +47 -0
- package/src/lib/server/document-utils.ts +397 -0
- package/src/lib/server/heartbeat-service.ts +13 -39
- package/src/lib/server/heartbeat-source.test.ts +22 -0
- package/src/lib/server/heartbeat-source.ts +7 -0
- package/src/lib/server/identity-continuity.test.ts +77 -0
- package/src/lib/server/identity-continuity.ts +127 -0
- package/src/lib/server/mailbox-utils.ts +347 -0
- package/src/lib/server/main-agent-loop.ts +27 -967
- package/src/lib/server/memory-db.ts +4 -6
- package/src/lib/server/memory-tiers.ts +40 -0
- package/src/lib/server/openclaw-agent-resolver.test.ts +70 -0
- package/src/lib/server/openclaw-agent-resolver.ts +128 -0
- package/src/lib/server/openclaw-exec-config.ts +5 -6
- package/src/lib/server/openclaw-skills-normalize.test.ts +56 -0
- package/src/lib/server/openclaw-skills-normalize.ts +136 -0
- package/src/lib/server/openclaw-sync.ts +3 -2
- package/src/lib/server/orchestrator-lg.ts +17 -6
- package/src/lib/server/orchestrator.ts +2 -2
- package/src/lib/server/playwright-proxy.mjs +27 -3
- package/src/lib/server/plugins.test.ts +207 -0
- package/src/lib/server/plugins.ts +822 -69
- package/src/lib/server/provider-health.ts +33 -3
- package/src/lib/server/queue.ts +3 -20
- package/src/lib/server/scheduler.ts +2 -0
- package/src/lib/server/session-archive-memory.test.ts +85 -0
- package/src/lib/server/session-archive-memory.ts +230 -0
- package/src/lib/server/session-mailbox.ts +8 -18
- package/src/lib/server/session-reset-policy.test.ts +99 -0
- package/src/lib/server/session-reset-policy.ts +311 -0
- package/src/lib/server/session-run-manager.ts +33 -80
- package/src/lib/server/session-tools/autonomy-tools.test.ts +105 -0
- package/src/lib/server/session-tools/calendar.ts +2 -12
- package/src/lib/server/session-tools/connector.ts +109 -8
- package/src/lib/server/session-tools/context.ts +14 -2
- package/src/lib/server/session-tools/crawl.ts +447 -0
- package/src/lib/server/session-tools/crud.ts +70 -32
- package/src/lib/server/session-tools/delegate-fallback.test.ts +219 -0
- package/src/lib/server/session-tools/delegate.ts +406 -20
- package/src/lib/server/session-tools/discovery.ts +22 -4
- package/src/lib/server/session-tools/document.ts +283 -0
- package/src/lib/server/session-tools/email.ts +1 -3
- package/src/lib/server/session-tools/extract.ts +137 -0
- package/src/lib/server/session-tools/file-normalize.test.ts +93 -0
- package/src/lib/server/session-tools/file-send.test.ts +84 -1
- package/src/lib/server/session-tools/file.ts +237 -24
- package/src/lib/server/session-tools/human-loop.ts +227 -0
- package/src/lib/server/session-tools/image-gen.ts +1 -3
- package/src/lib/server/session-tools/index.ts +56 -1
- package/src/lib/server/session-tools/mailbox.ts +276 -0
- package/src/lib/server/session-tools/memory.ts +35 -3
- package/src/lib/server/session-tools/monitor.ts +150 -7
- package/src/lib/server/session-tools/normalize-tool-args.ts +17 -14
- package/src/lib/server/session-tools/platform-normalize.test.ts +142 -0
- package/src/lib/server/session-tools/platform.ts +142 -4
- package/src/lib/server/session-tools/plugin-creator.ts +86 -23
- package/src/lib/server/session-tools/primitive-tools.test.ts +257 -0
- package/src/lib/server/session-tools/replicate.ts +1 -3
- package/src/lib/server/session-tools/schedule.ts +20 -10
- package/src/lib/server/session-tools/session-info.ts +36 -3
- package/src/lib/server/session-tools/session-tools-wiring.test.ts +31 -17
- package/src/lib/server/session-tools/subagent.ts +193 -27
- package/src/lib/server/session-tools/table.ts +587 -0
- package/src/lib/server/session-tools/wallet.ts +13 -10
- package/src/lib/server/session-tools/web-browser-config.test.ts +39 -0
- package/src/lib/server/session-tools/web.ts +896 -100
- package/src/lib/server/storage.ts +226 -7
- package/src/lib/server/stream-agent-chat.ts +46 -21
- package/src/lib/server/structured-extract.test.ts +72 -0
- package/src/lib/server/structured-extract.ts +373 -0
- package/src/lib/server/task-mention.test.ts +16 -2
- package/src/lib/server/task-mention.ts +61 -10
- package/src/lib/server/tool-aliases.ts +44 -7
- package/src/lib/server/tool-capability-policy.ts +6 -0
- package/src/lib/server/tool-retry.ts +2 -0
- package/src/lib/server/watch-jobs.test.ts +173 -0
- package/src/lib/server/watch-jobs.ts +532 -0
- package/src/lib/server/ws-hub.ts +5 -3
- package/src/lib/validation/schemas.test.ts +26 -0
- package/src/lib/validation/schemas.ts +7 -0
- package/src/lib/ws-client.ts +14 -12
- package/src/proxy.ts +5 -5
- package/src/stores/use-app-store.ts +0 -6
- package/src/stores/use-chat-store.ts +31 -2
- package/src/types/index.ts +287 -44
- package/src/components/chat/new-chat-sheet.tsx +0 -253
- package/src/lib/server/main-session.ts +0 -17
- package/src/lib/server/session-run-manager.test.ts +0 -26
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import '@/lib/server/session-tools/shell'
|
|
2
|
+
import '@/lib/server/session-tools/file'
|
|
3
|
+
import '@/lib/server/session-tools/edit_file'
|
|
4
|
+
import '@/lib/server/session-tools/web'
|
|
5
|
+
import '@/lib/server/session-tools/memory'
|
|
6
|
+
import '@/lib/server/session-tools/platform'
|
|
7
|
+
import '@/lib/server/session-tools/monitor'
|
|
8
|
+
import '@/lib/server/session-tools/discovery'
|
|
9
|
+
import '@/lib/server/session-tools/sample-ui'
|
|
10
|
+
import '@/lib/server/session-tools/git'
|
|
11
|
+
import '@/lib/server/session-tools/wallet'
|
|
12
|
+
import '@/lib/server/session-tools/connector'
|
|
13
|
+
import '@/lib/server/session-tools/http'
|
|
14
|
+
import '@/lib/server/session-tools/sandbox'
|
|
15
|
+
import '@/lib/server/session-tools/canvas'
|
|
16
|
+
import '@/lib/server/session-tools/chatroom'
|
|
17
|
+
import '@/lib/server/session-tools/delegate'
|
|
18
|
+
import '@/lib/server/session-tools/schedule'
|
|
19
|
+
import '@/lib/server/session-tools/session-info'
|
|
20
|
+
import '@/lib/server/session-tools/openclaw-nodes'
|
|
21
|
+
import '@/lib/server/session-tools/openclaw-workspace'
|
|
22
|
+
import '@/lib/server/session-tools/context-mgmt'
|
|
23
|
+
import '@/lib/server/session-tools/subagent'
|
|
24
|
+
import '@/lib/server/session-tools/plugin-creator'
|
|
25
|
+
import '@/lib/server/session-tools/image-gen'
|
|
26
|
+
import '@/lib/server/session-tools/email'
|
|
27
|
+
import '@/lib/server/session-tools/calendar'
|
|
28
|
+
import '@/lib/server/session-tools/replicate'
|
|
29
|
+
import '@/lib/server/session-tools/mailbox'
|
|
30
|
+
import '@/lib/server/session-tools/human-loop'
|
|
31
|
+
import '@/lib/server/session-tools/document'
|
|
32
|
+
import '@/lib/server/session-tools/extract'
|
|
33
|
+
import '@/lib/server/session-tools/table'
|
|
34
|
+
import '@/lib/server/session-tools/crawl'
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import assert from 'node:assert/strict'
|
|
2
|
+
import { describe, it } from 'node:test'
|
|
3
|
+
import type { Message } from '@/types'
|
|
4
|
+
import { pruneSuppressedHeartbeatStreamMessage, shouldApplySessionFreshnessReset } from './chat-execution'
|
|
5
|
+
|
|
6
|
+
describe('pruneSuppressedHeartbeatStreamMessage', () => {
|
|
7
|
+
it('removes a trailing streaming assistant heartbeat artifact', () => {
|
|
8
|
+
const messages: Message[] = [
|
|
9
|
+
{ role: 'assistant', text: 'real reply', time: 1, kind: 'chat' },
|
|
10
|
+
{ role: 'assistant', text: 'HEARTBEAT_OK', time: 2, streaming: true },
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
const changed = pruneSuppressedHeartbeatStreamMessage(messages)
|
|
14
|
+
|
|
15
|
+
assert.equal(changed, true)
|
|
16
|
+
assert.deepEqual(messages, [
|
|
17
|
+
{ role: 'assistant', text: 'real reply', time: 1, kind: 'chat' },
|
|
18
|
+
])
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it('keeps non-streaming or user messages intact', () => {
|
|
22
|
+
const nonStreaming: Message[] = [
|
|
23
|
+
{ role: 'assistant', text: 'HEARTBEAT_OK', time: 2, kind: 'heartbeat' },
|
|
24
|
+
]
|
|
25
|
+
const userTail: Message[] = [
|
|
26
|
+
{ role: 'user', text: 'ping', time: 3, streaming: true },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
assert.equal(pruneSuppressedHeartbeatStreamMessage(nonStreaming), false)
|
|
30
|
+
assert.equal(pruneSuppressedHeartbeatStreamMessage(userTail), false)
|
|
31
|
+
assert.equal(nonStreaming.length, 1)
|
|
32
|
+
assert.equal(userTail.length, 1)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('applies freshness resets beyond heartbeat but skips eval runs', () => {
|
|
36
|
+
assert.equal(shouldApplySessionFreshnessReset('chat'), true)
|
|
37
|
+
assert.equal(shouldApplySessionFreshnessReset('heartbeat'), true)
|
|
38
|
+
assert.equal(shouldApplySessionFreshnessReset('eval'), false)
|
|
39
|
+
})
|
|
40
|
+
})
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { describe, it } from 'node:test'
|
|
2
|
+
import assert from 'node:assert/strict'
|
|
3
|
+
import fs from 'fs'
|
|
4
|
+
import os from 'os'
|
|
5
|
+
import path from 'path'
|
|
6
|
+
import type { MessageToolEvent, SSEEvent } from '@/types'
|
|
7
|
+
import {
|
|
8
|
+
collectToolEvent,
|
|
9
|
+
dedupeConsecutiveToolEvents,
|
|
10
|
+
normalizeAssistantArtifactLinks,
|
|
11
|
+
requestedToolNamesFromMessage,
|
|
12
|
+
} from './chat-execution'
|
|
13
|
+
|
|
14
|
+
describe('collectToolEvent', () => {
|
|
15
|
+
it('dedupes consecutive identical pending tool_call events', () => {
|
|
16
|
+
const bag: MessageToolEvent[] = []
|
|
17
|
+
const toolCall: SSEEvent = {
|
|
18
|
+
t: 'tool_call',
|
|
19
|
+
toolName: 'files',
|
|
20
|
+
toolInput: '{"path":"spec.md"}',
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
collectToolEvent(toolCall, bag)
|
|
24
|
+
collectToolEvent(toolCall, bag)
|
|
25
|
+
|
|
26
|
+
assert.deepEqual(bag, [
|
|
27
|
+
{
|
|
28
|
+
name: 'files',
|
|
29
|
+
input: '{"path":"spec.md"}',
|
|
30
|
+
},
|
|
31
|
+
])
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it('still records a second tool call after the first one completed', () => {
|
|
35
|
+
const bag: MessageToolEvent[] = []
|
|
36
|
+
const toolCall: SSEEvent = {
|
|
37
|
+
t: 'tool_call',
|
|
38
|
+
toolName: 'files',
|
|
39
|
+
toolInput: '{"path":"spec.md"}',
|
|
40
|
+
}
|
|
41
|
+
const toolResult: SSEEvent = {
|
|
42
|
+
t: 'tool_result',
|
|
43
|
+
toolName: 'files',
|
|
44
|
+
toolOutput: 'Written spec.md (12 bytes)',
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
collectToolEvent(toolCall, bag)
|
|
48
|
+
collectToolEvent(toolResult, bag)
|
|
49
|
+
collectToolEvent(toolCall, bag)
|
|
50
|
+
|
|
51
|
+
assert.deepEqual(bag, [
|
|
52
|
+
{
|
|
53
|
+
name: 'files',
|
|
54
|
+
input: '{"path":"spec.md"}',
|
|
55
|
+
output: 'Written spec.md (12 bytes)',
|
|
56
|
+
error: undefined,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'files',
|
|
60
|
+
input: '{"path":"spec.md"}',
|
|
61
|
+
},
|
|
62
|
+
])
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
describe('dedupeConsecutiveToolEvents', () => {
|
|
67
|
+
it('removes consecutive duplicate persisted events', () => {
|
|
68
|
+
const events: MessageToolEvent[] = [
|
|
69
|
+
{ name: 'web', input: '{"action":"search"}', output: 'ok' },
|
|
70
|
+
{ name: 'web', input: '{"action":"search"}', output: 'ok' },
|
|
71
|
+
{ name: 'files', input: '{"action":"list"}', output: 'spec.md' },
|
|
72
|
+
{ name: 'files', input: '{"action":"list"}', output: 'spec.md' },
|
|
73
|
+
{ name: 'web', input: '{"action":"search"}', output: 'ok' },
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
assert.deepEqual(dedupeConsecutiveToolEvents(events), [
|
|
77
|
+
{ name: 'web', input: '{"action":"search"}', output: 'ok' },
|
|
78
|
+
{ name: 'files', input: '{"action":"list"}', output: 'spec.md' },
|
|
79
|
+
{ name: 'web', input: '{"action":"search"}', output: 'ok' },
|
|
80
|
+
])
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it('collapses adjacent repeated event blocks', () => {
|
|
84
|
+
const events: MessageToolEvent[] = [
|
|
85
|
+
{ name: 'delegate', input: '{"task":"draft"}', output: '{"status":"completed"}' },
|
|
86
|
+
{ name: 'files', input: '{"action":"write"}', output: 'Written spec.md' },
|
|
87
|
+
{ name: 'delegate', input: '{"task":"draft"}', output: '{"status":"completed"}' },
|
|
88
|
+
{ name: 'files', input: '{"action":"write"}', output: 'Written spec.md' },
|
|
89
|
+
{ name: 'delegate_to_codex_cli', input: '{"task":"full"}', output: '{"status":"completed"}' },
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
assert.deepEqual(dedupeConsecutiveToolEvents(events), [
|
|
93
|
+
{ name: 'delegate', input: '{"task":"draft"}', output: '{"status":"completed"}' },
|
|
94
|
+
{ name: 'files', input: '{"action":"write"}', output: 'Written spec.md' },
|
|
95
|
+
{ name: 'delegate_to_codex_cli', input: '{"task":"full"}', output: '{"status":"completed"}' },
|
|
96
|
+
])
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
describe('requestedToolNamesFromMessage', () => {
|
|
101
|
+
it('does not infer delegate from ordinary delegation prose', () => {
|
|
102
|
+
assert.deepEqual(
|
|
103
|
+
requestedToolNamesFromMessage('If Molly delegates later, that is fine, but do not mention tools.'),
|
|
104
|
+
[],
|
|
105
|
+
)
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
it('still detects explicit delegate tool requests', () => {
|
|
109
|
+
assert.deepEqual(
|
|
110
|
+
requestedToolNamesFromMessage('Use the delegate tool if Codex is better suited.'),
|
|
111
|
+
['delegate'],
|
|
112
|
+
)
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
describe('normalizeAssistantArtifactLinks', () => {
|
|
117
|
+
it('rewrites existing workspace sandbox links to served file URLs', () => {
|
|
118
|
+
const cwd = fs.mkdtempSync(path.join(os.tmpdir(), 'chat-execution-links-'))
|
|
119
|
+
const nestedDir = path.join(cwd, 'notes')
|
|
120
|
+
fs.mkdirSync(nestedDir, { recursive: true })
|
|
121
|
+
const filePath = path.join(nestedDir, 'spec.md')
|
|
122
|
+
fs.writeFileSync(filePath, '# spec\n')
|
|
123
|
+
|
|
124
|
+
const normalized = normalizeAssistantArtifactLinks(
|
|
125
|
+
`Saved \`sandbox:/workspace/notes/spec.md\`, [spec](${filePath}), and sandbox:/api/uploads/demo.pdf`,
|
|
126
|
+
cwd,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
assert.equal(
|
|
130
|
+
normalized,
|
|
131
|
+
`Saved \`/api/files/serve?path=${encodeURIComponent(filePath)}\`, [spec](/api/files/serve?path=${encodeURIComponent(filePath)}), and /api/uploads/demo.pdf`,
|
|
132
|
+
)
|
|
133
|
+
})
|
|
134
|
+
})
|