@vellumai/assistant 0.8.9 → 0.8.10-dev.202606092238.d04fd59
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/AGENTS.md +1 -1
- package/examples/plugins/echo/README.md +3 -3
- package/node_modules/@vellumai/skill-host-contracts/src/tool-types.ts +2 -0
- package/openapi.yaml +38 -12
- package/package.json +1 -1
- package/scripts/sync-llm-catalog.ts +2 -0
- package/src/__tests__/agent-loop-exit-reason.test.ts +19 -14
- package/src/__tests__/build-persisted-content.test.ts +75 -1
- package/src/__tests__/config-managed-gemini-defaults.test.ts +2 -46
- package/src/__tests__/context-overflow-reducer.test.ts +264 -124
- package/src/__tests__/context-window-manager-overflow-rung.test.ts +289 -0
- package/src/__tests__/conversation-agent-loop-overflow.test.ts +22 -22
- package/src/__tests__/conversation-agent-loop.test.ts +45 -37
- package/src/__tests__/conversation-fork-crud.test.ts +110 -0
- package/src/__tests__/conversation-provider-retry-repair.test.ts +16 -20
- package/src/__tests__/conversation-runtime-assembly.test.ts +118 -5
- package/src/__tests__/conversation-surfaces-app-control.test.ts +4 -1
- package/src/__tests__/conversation-tool-setup-app-refresh.test.ts +91 -142
- package/src/__tests__/conversation-tool-setup-skill-attribution.test.ts +116 -0
- package/src/__tests__/conversation-tool-setup-test-helpers.ts +98 -0
- package/src/__tests__/corrected-target.test.ts +93 -0
- package/src/__tests__/credential-execution-feature-gates.test.ts +3 -5
- package/src/__tests__/credential-security-invariants.test.ts +1 -0
- package/src/__tests__/embedding-managed-proxy-selection.test.ts +6 -40
- package/src/__tests__/external-plugin-loader.test.ts +0 -1
- package/src/__tests__/guardian-routing-invariants.test.ts +91 -0
- package/src/__tests__/history-repair-hook.test.ts +2 -0
- package/src/__tests__/host-app-control-proxy.test.ts +45 -0
- package/src/__tests__/llm-catalog-parity.test.ts +4 -0
- package/src/__tests__/memory-retrieval-hook.test.ts +29 -15
- package/src/__tests__/notification-decision-strategy.test.ts +3 -3
- package/src/__tests__/persistence-secret-redaction.test.ts +78 -0
- package/src/__tests__/plugin-bootstrap.test.ts +82 -73
- package/src/__tests__/plugin-tool-contribution.test.ts +7 -4
- package/src/__tests__/plugin-types.test.ts +0 -8
- package/src/__tests__/provider-catalog-visibility.test.ts +1 -9
- package/src/__tests__/retry-thinking-adaptive-only.test.ts +245 -0
- package/src/__tests__/server-history-render.test.ts +39 -0
- package/src/__tests__/skills.test.ts +123 -0
- package/src/__tests__/title-generate-hook.test.ts +2 -0
- package/src/__tests__/tool-audit-listener.test.ts +51 -0
- package/src/__tests__/tool-executor-lifecycle-events.test.ts +32 -0
- package/src/__tests__/tool-start-timestamp.test.ts +218 -0
- package/src/agent/loop.ts +26 -23
- package/src/api/events/tool-result.ts +9 -0
- package/src/api/events/tool-use-start.ts +7 -0
- package/src/api/responses/conversation-message.ts +91 -14
- package/src/approvals/guardian-request-resolvers.ts +26 -0
- package/src/cli/commands/channel-verification-sessions.ts +6 -6
- package/src/cli/commands/inference-providers.ts +0 -8
- package/src/cli/commands/plugins.ts +2 -2
- package/src/cli/lib/__tests__/install-from-github.test.ts +174 -18
- package/src/cli/lib/__tests__/plugin-catalog-cache.test.ts +1 -1
- package/src/cli/lib/__tests__/plugin-details.test.ts +1 -1
- package/src/cli/lib/__tests__/plugin-marketplace.test.ts +1 -1
- package/src/cli/lib/__tests__/search-plugins.test.ts +11 -11
- package/src/cli/lib/install-from-github.ts +130 -19
- package/src/cli/lib/plugin-catalog-cache.ts +1 -1
- package/src/cli/lib/plugin-details.ts +4 -4
- package/src/cli/lib/plugin-marketplace.ts +2 -2
- package/src/cli/lib/search-plugins.ts +6 -6
- package/src/config/bundled-skills/skill-management/SKILL.md +89 -1
- package/src/config/env-registry.ts +12 -0
- package/src/config/feature-flag-registry.json +0 -80
- package/src/config/loader.ts +5 -22
- package/src/config/seed-inference-profiles.ts +1 -1
- package/src/config/skills.ts +101 -47
- package/src/context/strip-injections.ts +7 -4
- package/src/daemon/conversation-agent-loop-handlers.ts +102 -6
- package/src/daemon/conversation-agent-loop.ts +134 -232
- package/src/daemon/conversation-runtime-assembly.ts +44 -8
- package/src/daemon/conversation-tool-setup.ts +9 -1
- package/src/daemon/external-plugins-bootstrap.ts +33 -87
- package/src/daemon/handlers/config-channels.ts +11 -2
- package/src/daemon/handlers/shared.ts +9 -1
- package/src/daemon/handlers/skills.ts +6 -2
- package/src/daemon/host-app-control-proxy.ts +72 -57
- package/src/daemon/message-protocol.ts +0 -7
- package/src/daemon/message-types/skills.ts +4 -0
- package/src/events/tool-audit-listener.ts +7 -1
- package/src/memory/__tests__/tool-invocation-test-helpers.ts +69 -0
- package/src/memory/conversation-crud.ts +44 -1
- package/src/memory/db-init.ts +4 -0
- package/src/memory/embedding-backend.ts +5 -22
- package/src/memory/memory-retrospective-startup-cleanup.ts +1 -1
- package/src/memory/migrations/275-tool-invocations-add-skill-id.test.ts +81 -0
- package/src/memory/migrations/275-tool-invocations-add-skill-id.ts +20 -0
- package/src/memory/migrations/276-tool-invocations-created-at-id-index.test.ts +68 -0
- package/src/memory/migrations/276-tool-invocations-created-at-id-index.ts +20 -0
- package/src/memory/migrations/index.ts +2 -0
- package/src/memory/schema/conversations.ts +3 -0
- package/src/memory/tool-execution-events-store.test.ts +162 -0
- package/src/memory/tool-execution-events-store.ts +73 -0
- package/src/memory/tool-usage-store.ts +4 -3
- package/src/memory/v2/__tests__/injected-block-slugs.test.ts +51 -0
- package/src/memory/v2/activation-store.ts +50 -1
- package/src/memory/v2/injected-block-slugs.ts +30 -0
- package/src/notifications/__tests__/copy-composer.test.ts +244 -0
- package/src/notifications/access-request-copy.ts +298 -0
- package/src/notifications/adapters/slack.ts +3 -3
- package/src/notifications/adapters/telegram.ts +2 -1
- package/src/notifications/copy-composer.ts +49 -267
- package/src/notifications/decision-engine.ts +16 -35
- package/src/notifications/home-feed-side-effect.ts +1 -6
- package/src/platform/client.ts +1 -3
- package/src/platform/feature-gate.ts +3 -12
- package/src/plugin-api/constants.ts +2 -0
- package/src/plugin-api/index.ts +34 -6
- package/src/plugin-api/types.ts +19 -0
- package/src/plugins/defaults/compaction/compact.ts +39 -1
- package/src/plugins/defaults/compaction/context-overflow-reducer.ts +240 -32
- package/src/plugins/defaults/compaction/corrected-target.ts +53 -0
- package/src/plugins/defaults/compaction/window-manager.ts +136 -0
- package/src/plugins/defaults/index.ts +24 -0
- package/src/plugins/defaults/memory-retrieval/hooks/post-compact.ts +68 -43
- package/src/plugins/defaults/memory-retrieval/hooks/{user-prompt-submit-temp.ts → user-prompt-submit.ts} +36 -67
- package/src/plugins/defaults/memory-retrieval/package.json +14 -0
- package/src/plugins/external-api.ts +1 -1
- package/src/plugins/types.ts +5 -51
- package/src/providers/inference/__tests__/base-url-route-validation.test.ts +1 -2
- package/src/providers/model-catalog.ts +57 -1
- package/src/providers/registry.ts +0 -8
- package/src/providers/retry.ts +35 -7
- package/src/runtime/routes/__tests__/acp-routes.test.ts +151 -0
- package/src/runtime/routes/__tests__/inference-provider-connection-routes.test.ts +0 -62
- package/src/runtime/routes/__tests__/plugins-routes.test.ts +4 -4
- package/src/runtime/routes/acp-routes.test.ts +106 -0
- package/src/runtime/routes/acp-routes.ts +248 -2
- package/src/runtime/routes/browser-tabs-routes.ts +1 -1
- package/src/runtime/routes/channel-verification-routes.ts +14 -5
- package/src/runtime/routes/chatgpt-subscription-auth-routes.ts +0 -14
- package/src/runtime/routes/inbound-stages/acl-enforcement.ts +33 -34
- package/src/runtime/routes/inference-provider-connection-routes.ts +0 -45
- package/src/runtime/routes/plugins-routes.ts +3 -3
- package/src/runtime/verification-outbound-actions.ts +147 -2
- package/src/runtime/verification-templates.ts +29 -3
- package/src/telemetry/types.ts +25 -1
- package/src/telemetry/usage-telemetry-reporter.test.ts +141 -7
- package/src/telemetry/usage-telemetry-reporter.ts +63 -7
- package/src/tools/executor.ts +4 -1
- package/src/tools/skills/load.ts +11 -6
- package/src/tools/terminal/safe-env.ts +1 -0
- package/src/tools/types.ts +10 -0
- package/src/__tests__/plugin-skill-contribution.test.ts +0 -355
- package/src/daemon/message-types/browser.ts +0 -10
- package/src/notifications/__tests__/emit-signal-home-feed.test.ts +0 -187
- package/src/plugins/plugin-skill-contributions.ts +0 -292
|
@@ -64,6 +64,8 @@ mock.module("../daemon/date-context.js", () => ({
|
|
|
64
64
|
formatTurnTimestamp: () => FIXED_TURN_TIMESTAMP,
|
|
65
65
|
}));
|
|
66
66
|
|
|
67
|
+
import { resolveCallSiteConfig } from "../config/llm-resolver.js";
|
|
68
|
+
import { LLMSchema } from "../config/schemas/llm.js";
|
|
67
69
|
import {
|
|
68
70
|
clearConversations,
|
|
69
71
|
setConversation,
|
|
@@ -87,6 +89,7 @@ import {
|
|
|
87
89
|
loadSlackChronologicalMessages,
|
|
88
90
|
resolveChannelCapabilities,
|
|
89
91
|
resolveTurnInboundActorContext,
|
|
92
|
+
resolveTurnModelProfileLabel,
|
|
90
93
|
stripChannelCapabilityContext,
|
|
91
94
|
stripInjectionsForCompaction,
|
|
92
95
|
stripNowScratchpad,
|
|
@@ -105,7 +108,9 @@ import {
|
|
|
105
108
|
writeSlackMetadata,
|
|
106
109
|
} from "../messaging/providers/slack/message-metadata.js";
|
|
107
110
|
import { parentAlias } from "../messaging/providers/slack/render-transcript.js";
|
|
108
|
-
import postCompact
|
|
111
|
+
import postCompact, {
|
|
112
|
+
type PostCompactContext,
|
|
113
|
+
} from "../plugins/defaults/memory-retrieval/hooks/post-compact.js";
|
|
109
114
|
import {
|
|
110
115
|
buildUnifiedTurnContextBlock,
|
|
111
116
|
type UnifiedTurnContextOptions,
|
|
@@ -1027,16 +1032,17 @@ describe("applyRuntimeInjections — injection mode", () => {
|
|
|
1027
1032
|
// only resolve when `applyRuntimeInjections` finds it by conversation id
|
|
1028
1033
|
// AND the agent loop hands the post-compaction hook the turn-identity fields
|
|
1029
1034
|
// flat (`requestId`, `conversationId`, `trust`)
|
|
1030
|
-
const
|
|
1035
|
+
const postCompactCtx: PostCompactContext = {
|
|
1031
1036
|
history: baseMessages,
|
|
1032
1037
|
requestId: "reinject-req",
|
|
1033
1038
|
conversationId: "injection-mode-conv",
|
|
1034
1039
|
trust: { sourceChannel: "vellum", trustClass: "guardian" },
|
|
1035
1040
|
isNonInteractive: false,
|
|
1036
|
-
|
|
1037
|
-
modelProfile: null,
|
|
1041
|
+
modelProfileKey: null,
|
|
1038
1042
|
actorContext: null,
|
|
1039
|
-
}
|
|
1043
|
+
};
|
|
1044
|
+
await postCompact(postCompactCtx);
|
|
1045
|
+
const result = postCompactCtx.history;
|
|
1040
1046
|
const allText = result[0].content
|
|
1041
1047
|
.filter((b): b is { type: "text"; text: string } => b.type === "text")
|
|
1042
1048
|
.map((b) => b.text)
|
|
@@ -1509,6 +1515,113 @@ describe("resolveTurnInboundActorContext", () => {
|
|
|
1509
1515
|
});
|
|
1510
1516
|
});
|
|
1511
1517
|
|
|
1518
|
+
// ---------------------------------------------------------------------------
|
|
1519
|
+
// resolveTurnModelProfileLabel
|
|
1520
|
+
// ---------------------------------------------------------------------------
|
|
1521
|
+
|
|
1522
|
+
describe("resolveTurnModelProfileLabel", () => {
|
|
1523
|
+
/**
|
|
1524
|
+
* A null key means the active profile is unchanged since the last notified
|
|
1525
|
+
* one, so there is no `model_profile` line to render this turn.
|
|
1526
|
+
*/
|
|
1527
|
+
test("returns null when the profile key is null", () => {
|
|
1528
|
+
// GIVEN a turn whose profile is unchanged since the last notification
|
|
1529
|
+
const llm = LLMSchema.parse({
|
|
1530
|
+
default: { provider: "anthropic", model: "claude-sonnet-4-7" },
|
|
1531
|
+
});
|
|
1532
|
+
|
|
1533
|
+
// WHEN the label is resolved for a null key
|
|
1534
|
+
const label = resolveTurnModelProfileLabel(null, "mainAgent", llm);
|
|
1535
|
+
|
|
1536
|
+
// THEN there is no profile line to inject
|
|
1537
|
+
expect(label).toBeNull();
|
|
1538
|
+
});
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* A known profile renders its configured display label paired with the model
|
|
1542
|
+
* the call site resolves to.
|
|
1543
|
+
*/
|
|
1544
|
+
test("renders the profile's label with the resolved model", () => {
|
|
1545
|
+
// GIVEN a workspace with a labelled "fast" profile
|
|
1546
|
+
const llm = LLMSchema.parse({
|
|
1547
|
+
default: { provider: "anthropic", model: "claude-sonnet-4-7" },
|
|
1548
|
+
profiles: {
|
|
1549
|
+
fast: { label: "Fast", provider: "anthropic", model: "claude-haiku-4" },
|
|
1550
|
+
},
|
|
1551
|
+
});
|
|
1552
|
+
|
|
1553
|
+
// WHEN the label is resolved for that profile at the main-agent call site
|
|
1554
|
+
const label = resolveTurnModelProfileLabel("fast", "mainAgent", llm);
|
|
1555
|
+
|
|
1556
|
+
// THEN the rendered line pairs the display label with the resolved model
|
|
1557
|
+
expect(label).toBe("Fast (claude-haiku-4)");
|
|
1558
|
+
});
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* A profile with no configured label falls back to its raw key so the model
|
|
1562
|
+
* still gets a stable identifier.
|
|
1563
|
+
*/
|
|
1564
|
+
test("falls back to the raw key when the profile has no label", () => {
|
|
1565
|
+
// GIVEN a profile that sets a model but no display label
|
|
1566
|
+
const llm = LLMSchema.parse({
|
|
1567
|
+
default: { provider: "anthropic", model: "claude-sonnet-4-7" },
|
|
1568
|
+
profiles: {
|
|
1569
|
+
deep: { provider: "anthropic", model: "claude-opus-4" },
|
|
1570
|
+
},
|
|
1571
|
+
});
|
|
1572
|
+
|
|
1573
|
+
// WHEN the label is resolved for that profile
|
|
1574
|
+
const label = resolveTurnModelProfileLabel("deep", "mainAgent", llm);
|
|
1575
|
+
|
|
1576
|
+
// THEN the raw key stands in for the missing label
|
|
1577
|
+
expect(label).toBe("deep (claude-opus-4)");
|
|
1578
|
+
});
|
|
1579
|
+
|
|
1580
|
+
/**
|
|
1581
|
+
* A key naming a `mix` profile must announce the arm the turn's provider
|
|
1582
|
+
* calls actually run on. The conversation id is threaded as the selection
|
|
1583
|
+
* seed so the announced model is a deterministic function of the
|
|
1584
|
+
* conversation, matching the seeded expansion the provider layer performs.
|
|
1585
|
+
*/
|
|
1586
|
+
test("announces the seeded mix arm so it matches the turn's model", () => {
|
|
1587
|
+
// GIVEN a mix profile routing between two models
|
|
1588
|
+
const llm = LLMSchema.parse({
|
|
1589
|
+
default: { provider: "anthropic", model: "claude-sonnet-4-7" },
|
|
1590
|
+
profiles: {
|
|
1591
|
+
a: { label: "Arm A", provider: "anthropic", model: "model-a" },
|
|
1592
|
+
b: { label: "Arm B", provider: "anthropic", model: "model-b" },
|
|
1593
|
+
ab: {
|
|
1594
|
+
label: "AB",
|
|
1595
|
+
mix: [
|
|
1596
|
+
{ profile: "a", weight: 50 },
|
|
1597
|
+
{ profile: "b", weight: 50 },
|
|
1598
|
+
],
|
|
1599
|
+
},
|
|
1600
|
+
},
|
|
1601
|
+
});
|
|
1602
|
+
|
|
1603
|
+
// AND the model the provider calls resolve to for this conversation's seed
|
|
1604
|
+
const seededModel = resolveCallSiteConfig("mainAgent", llm, {
|
|
1605
|
+
overrideProfile: "ab",
|
|
1606
|
+
selectionSeed: "conv-seed-1",
|
|
1607
|
+
}).model;
|
|
1608
|
+
|
|
1609
|
+
// WHEN the label is resolved with the same conversation seed
|
|
1610
|
+
const label = resolveTurnModelProfileLabel(
|
|
1611
|
+
"ab",
|
|
1612
|
+
"mainAgent",
|
|
1613
|
+
llm,
|
|
1614
|
+
"conv-seed-1",
|
|
1615
|
+
);
|
|
1616
|
+
|
|
1617
|
+
// THEN the announced model is the seeded arm (deterministic, not re-rolled)
|
|
1618
|
+
expect(label).toBe(`AB (${seededModel})`);
|
|
1619
|
+
expect(
|
|
1620
|
+
resolveTurnModelProfileLabel("ab", "mainAgent", llm, "conv-seed-1"),
|
|
1621
|
+
).toBe(label);
|
|
1622
|
+
});
|
|
1623
|
+
});
|
|
1624
|
+
|
|
1512
1625
|
// ---------------------------------------------------------------------------
|
|
1513
1626
|
// buildUnifiedTurnContextBlock
|
|
1514
1627
|
// ---------------------------------------------------------------------------
|
|
@@ -511,6 +511,7 @@ describe("surfaceProxyResolver — app-control tool routing", () => {
|
|
|
511
511
|
_setActiveAppControlSession({
|
|
512
512
|
conversationId: "conv-1",
|
|
513
513
|
app: "com.example.editor",
|
|
514
|
+
targetClientId: "client-b",
|
|
514
515
|
});
|
|
515
516
|
|
|
516
517
|
const resultPromise = surfaceProxyResolver(ctx, "app_control_observe", {
|
|
@@ -595,6 +596,7 @@ describe("surfaceProxyResolver — app-control tool routing", () => {
|
|
|
595
596
|
_setActiveAppControlSession({
|
|
596
597
|
conversationId: "conv-1",
|
|
597
598
|
app: "com.example.editor",
|
|
599
|
+
targetClientId: "client-mine",
|
|
598
600
|
});
|
|
599
601
|
|
|
600
602
|
const resultPromise = surfaceProxyResolver(ctx, "app_control_observe", {
|
|
@@ -617,7 +619,7 @@ describe("surfaceProxyResolver — app-control tool routing", () => {
|
|
|
617
619
|
proxy.dispose();
|
|
618
620
|
});
|
|
619
621
|
|
|
620
|
-
test("single same-user client with no target
|
|
622
|
+
test("single same-user client with no target resolves to that client", async () => {
|
|
621
623
|
mockHubClients = [
|
|
622
624
|
{
|
|
623
625
|
clientId: "only-client",
|
|
@@ -630,6 +632,7 @@ describe("surfaceProxyResolver — app-control tool routing", () => {
|
|
|
630
632
|
_setActiveAppControlSession({
|
|
631
633
|
conversationId: "conv-1",
|
|
632
634
|
app: "com.example.editor",
|
|
635
|
+
targetClientId: "only-client",
|
|
633
636
|
});
|
|
634
637
|
|
|
635
638
|
const resultPromise = surfaceProxyResolver(ctx, "app_control_observe", {
|
|
@@ -12,55 +12,20 @@
|
|
|
12
12
|
|
|
13
13
|
import { beforeEach, describe, expect, mock, test } from "bun:test";
|
|
14
14
|
|
|
15
|
-
import type { ToolSetupContext } from "../daemon/conversation-tool-setup.js";
|
|
16
|
-
import type { SurfaceData, SurfaceType } from "../daemon/message-protocol.js";
|
|
17
15
|
import { SYNC_TAGS } from "../daemon/message-types/sync.js";
|
|
18
16
|
import type { PermissionPrompter } from "../permissions/prompter.js";
|
|
19
17
|
import type { SecretPrompter } from "../permissions/secret-prompter.js";
|
|
20
18
|
import type { ToolExecutor } from "../tools/executor.js";
|
|
21
19
|
import type { ToolExecutionResult } from "../tools/types.js";
|
|
20
|
+
import {
|
|
21
|
+
broadcastMessageSpy,
|
|
22
|
+
installConversationToolSetupMocks,
|
|
23
|
+
makeToolSetupContext,
|
|
24
|
+
refreshSurfacesForAppSpy,
|
|
25
|
+
updatePublishedAppDeploymentSpy,
|
|
26
|
+
} from "./conversation-tool-setup-test-helpers.js";
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
// Spies for side-effect verification
|
|
25
|
-
// ---------------------------------------------------------------------------
|
|
26
|
-
|
|
27
|
-
const refreshSpy = mock(() => {});
|
|
28
|
-
const updatePublishedSpy = mock(() => Promise.resolve());
|
|
29
|
-
const broadcastSpy = mock(() => {});
|
|
30
|
-
|
|
31
|
-
mock.module("../runtime/assistant-event-hub.js", () => ({
|
|
32
|
-
broadcastMessage: broadcastSpy,
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
// Mock session-surfaces so refreshSurfacesForApp is captured
|
|
36
|
-
mock.module("../daemon/conversation-surfaces.js", () => ({
|
|
37
|
-
refreshSurfacesForApp: refreshSpy,
|
|
38
|
-
surfaceProxyResolver: mock(() =>
|
|
39
|
-
Promise.resolve({ content: "", isError: false }),
|
|
40
|
-
),
|
|
41
|
-
}));
|
|
42
|
-
|
|
43
|
-
// Mock published-app-updater to prevent real deployment calls
|
|
44
|
-
mock.module("../services/published-app-updater.js", () => ({
|
|
45
|
-
updatePublishedAppDeployment: updatePublishedSpy,
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
// Mock browser-screencast registration (no-op)
|
|
49
|
-
mock.module("../tools/browser/browser-screencast.js", () => ({
|
|
50
|
-
registerConversationSender: mock(() => {}),
|
|
51
|
-
}));
|
|
52
|
-
|
|
53
|
-
// Stub app-store functions used by other modules (e.g. app-source-watcher,
|
|
54
|
-
// conversation-surfaces) so tool-side-effects' hooks can run without touching
|
|
55
|
-
// the real app store during tests.
|
|
56
|
-
mock.module("../memory/app-store.js", () => ({
|
|
57
|
-
getApp: mock(() => null),
|
|
58
|
-
getAppDirPath: mock(() => "/tmp/test-apps/dummy"),
|
|
59
|
-
isMultifileApp: mock(() => false),
|
|
60
|
-
getAppsDir: mock(() => "/tmp/test-apps"),
|
|
61
|
-
resolveAppIdByDirName: mock(() => null),
|
|
62
|
-
resolveAppIdFromPath: mock(() => null),
|
|
63
|
-
}));
|
|
28
|
+
installConversationToolSetupMocks();
|
|
64
29
|
|
|
65
30
|
// ---------------------------------------------------------------------------
|
|
66
31
|
// Import createToolExecutor after mocks are in place
|
|
@@ -73,7 +38,9 @@ import { createToolExecutor } from "../daemon/conversation-tool-setup.js";
|
|
|
73
38
|
// ---------------------------------------------------------------------------
|
|
74
39
|
|
|
75
40
|
function broadcastPayloads(): unknown[] {
|
|
76
|
-
return (
|
|
41
|
+
return (broadcastMessageSpy.mock.calls as unknown[][]).map(
|
|
42
|
+
([payload]) => payload,
|
|
43
|
+
);
|
|
77
44
|
}
|
|
78
45
|
|
|
79
46
|
function expectAppChangeBroadcast(appId: string): void {
|
|
@@ -85,34 +52,6 @@ function expectAppChangeBroadcast(appId: string): void {
|
|
|
85
52
|
);
|
|
86
53
|
}
|
|
87
54
|
|
|
88
|
-
/** Build a minimal ToolSetupContext stub. */
|
|
89
|
-
function makeCtx(overrides: Partial<ToolSetupContext> = {}): ToolSetupContext {
|
|
90
|
-
return {
|
|
91
|
-
conversationId: "conv-test",
|
|
92
|
-
currentRequestId: "req-1",
|
|
93
|
-
workingDir: "/tmp/test",
|
|
94
|
-
abortController: null,
|
|
95
|
-
traceEmitter: { emit: () => {} },
|
|
96
|
-
sendToClient: mock(() => {}),
|
|
97
|
-
pendingSurfaceActions: new Map(),
|
|
98
|
-
lastSurfaceAction: new Map(),
|
|
99
|
-
surfaceState: new Map<
|
|
100
|
-
string,
|
|
101
|
-
{ surfaceType: SurfaceType; data: SurfaceData; title?: string }
|
|
102
|
-
>(),
|
|
103
|
-
surfaceUndoStacks: new Map(),
|
|
104
|
-
accumulatedSurfaceState: new Map(),
|
|
105
|
-
surfaceActionRequestIds: new Set<string>(),
|
|
106
|
-
currentTurnSurfaces: [],
|
|
107
|
-
isProcessing: () => false,
|
|
108
|
-
enqueueMessage: () => ({ queued: false, requestId: "r" }),
|
|
109
|
-
getQueueDepth: () => 0,
|
|
110
|
-
processMessage: async () => "",
|
|
111
|
-
withSurface: async <T>(_id: string, fn: () => T | Promise<T>) => fn(),
|
|
112
|
-
...overrides,
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
55
|
/** Fake ToolExecutor whose execute() returns a controlled result. */
|
|
117
56
|
function makeFakeExecutor(
|
|
118
57
|
result: ToolExecutionResult = { content: "{}", isError: false },
|
|
@@ -137,16 +76,16 @@ const noopLifecycleHandler = mock(() => {});
|
|
|
137
76
|
|
|
138
77
|
describe("session-tool-setup app refresh side effects", () => {
|
|
139
78
|
beforeEach(() => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
79
|
+
refreshSurfacesForAppSpy.mockClear();
|
|
80
|
+
broadcastMessageSpy.mockClear();
|
|
81
|
+
updatePublishedAppDeploymentSpy.mockClear();
|
|
143
82
|
});
|
|
144
83
|
|
|
145
84
|
// ── app_refresh ─────────────────────────────────────────────────────
|
|
146
85
|
|
|
147
86
|
describe("app_refresh", () => {
|
|
148
87
|
test("triggers refreshSurfacesForApp when result is not an error", async () => {
|
|
149
|
-
const ctx =
|
|
88
|
+
const ctx = makeToolSetupContext();
|
|
150
89
|
const executor = makeFakeExecutor({
|
|
151
90
|
content: '{"id":"app-1"}',
|
|
152
91
|
isError: false,
|
|
@@ -162,13 +101,17 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
162
101
|
|
|
163
102
|
await toolFn("app_refresh", { app_id: "app-1" });
|
|
164
103
|
|
|
165
|
-
expect(
|
|
166
|
-
expect((
|
|
167
|
-
|
|
104
|
+
expect(refreshSurfacesForAppSpy).toHaveBeenCalledTimes(1);
|
|
105
|
+
expect((refreshSurfacesForAppSpy.mock.calls as unknown[][])[0][0]).toBe(
|
|
106
|
+
ctx,
|
|
107
|
+
);
|
|
108
|
+
expect((refreshSurfacesForAppSpy.mock.calls as unknown[][])[0][1]).toBe(
|
|
109
|
+
"app-1",
|
|
110
|
+
);
|
|
168
111
|
});
|
|
169
112
|
|
|
170
113
|
test("broadcasts app_files_changed with correct appId", async () => {
|
|
171
|
-
const ctx =
|
|
114
|
+
const ctx = makeToolSetupContext();
|
|
172
115
|
const executor = makeFakeExecutor({ content: "{}", isError: false });
|
|
173
116
|
|
|
174
117
|
const toolFn = createToolExecutor(
|
|
@@ -181,12 +124,12 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
181
124
|
|
|
182
125
|
await toolFn("app_refresh", { app_id: "app-42" });
|
|
183
126
|
|
|
184
|
-
expect(
|
|
127
|
+
expect(broadcastMessageSpy).toHaveBeenCalledTimes(2);
|
|
185
128
|
expectAppChangeBroadcast("app-42");
|
|
186
129
|
});
|
|
187
130
|
|
|
188
131
|
test("calls updatePublishedAppDeployment", async () => {
|
|
189
|
-
const ctx =
|
|
132
|
+
const ctx = makeToolSetupContext();
|
|
190
133
|
const executor = makeFakeExecutor({ content: "{}", isError: false });
|
|
191
134
|
|
|
192
135
|
const toolFn = createToolExecutor(
|
|
@@ -201,14 +144,14 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
201
144
|
|
|
202
145
|
// updatePublishedAppDeployment is called with void (fire-and-forget),
|
|
203
146
|
// so just verify it was invoked.
|
|
204
|
-
expect(
|
|
205
|
-
expect(
|
|
206
|
-
|
|
207
|
-
);
|
|
147
|
+
expect(updatePublishedAppDeploymentSpy).toHaveBeenCalledTimes(1);
|
|
148
|
+
expect(
|
|
149
|
+
(updatePublishedAppDeploymentSpy.mock.calls as unknown[][])[0][0],
|
|
150
|
+
).toBe("app-publish");
|
|
208
151
|
});
|
|
209
152
|
|
|
210
153
|
test("skips side effects when result is an error", async () => {
|
|
211
|
-
const ctx =
|
|
154
|
+
const ctx = makeToolSetupContext();
|
|
212
155
|
const executor = makeFakeExecutor({
|
|
213
156
|
content: "Error: not found",
|
|
214
157
|
isError: true,
|
|
@@ -224,13 +167,13 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
224
167
|
|
|
225
168
|
await toolFn("app_refresh", { app_id: "app-err" });
|
|
226
169
|
|
|
227
|
-
expect(
|
|
228
|
-
expect(
|
|
229
|
-
expect(
|
|
170
|
+
expect(refreshSurfacesForAppSpy).not.toHaveBeenCalled();
|
|
171
|
+
expect(broadcastMessageSpy).not.toHaveBeenCalled();
|
|
172
|
+
expect(updatePublishedAppDeploymentSpy).not.toHaveBeenCalled();
|
|
230
173
|
});
|
|
231
174
|
|
|
232
175
|
test("skips side effects when app_id is missing", async () => {
|
|
233
|
-
const ctx =
|
|
176
|
+
const ctx = makeToolSetupContext();
|
|
234
177
|
const executor = makeFakeExecutor({ content: "{}", isError: false });
|
|
235
178
|
|
|
236
179
|
const toolFn = createToolExecutor(
|
|
@@ -243,8 +186,8 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
243
186
|
|
|
244
187
|
await toolFn("app_refresh", {});
|
|
245
188
|
|
|
246
|
-
expect(
|
|
247
|
-
expect(
|
|
189
|
+
expect(refreshSurfacesForAppSpy).not.toHaveBeenCalled();
|
|
190
|
+
expect(broadcastMessageSpy).not.toHaveBeenCalled();
|
|
248
191
|
});
|
|
249
192
|
});
|
|
250
193
|
|
|
@@ -252,7 +195,7 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
252
195
|
|
|
253
196
|
describe("app_update", () => {
|
|
254
197
|
test("triggers refreshSurfacesForApp and broadcast on success", async () => {
|
|
255
|
-
const ctx =
|
|
198
|
+
const ctx = makeToolSetupContext();
|
|
256
199
|
const executor = makeFakeExecutor({
|
|
257
200
|
content: '{"updated":true,"appId":"app-7"}',
|
|
258
201
|
isError: false,
|
|
@@ -268,17 +211,19 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
268
211
|
|
|
269
212
|
await toolFn("app_update", { app_id: "app-7" });
|
|
270
213
|
|
|
271
|
-
expect(
|
|
272
|
-
expect((
|
|
273
|
-
expectAppChangeBroadcast("app-7");
|
|
274
|
-
expect(updatePublishedSpy).toHaveBeenCalledTimes(1);
|
|
275
|
-
expect((updatePublishedSpy.mock.calls as unknown[][])[0][0]).toBe(
|
|
214
|
+
expect(refreshSurfacesForAppSpy).toHaveBeenCalledTimes(1);
|
|
215
|
+
expect((refreshSurfacesForAppSpy.mock.calls as unknown[][])[0][1]).toBe(
|
|
276
216
|
"app-7",
|
|
277
217
|
);
|
|
218
|
+
expectAppChangeBroadcast("app-7");
|
|
219
|
+
expect(updatePublishedAppDeploymentSpy).toHaveBeenCalledTimes(1);
|
|
220
|
+
expect(
|
|
221
|
+
(updatePublishedAppDeploymentSpy.mock.calls as unknown[][])[0][0],
|
|
222
|
+
).toBe("app-7");
|
|
278
223
|
});
|
|
279
224
|
|
|
280
225
|
test("skips side effects when result is an error", async () => {
|
|
281
|
-
const ctx =
|
|
226
|
+
const ctx = makeToolSetupContext();
|
|
282
227
|
const executor = makeFakeExecutor({
|
|
283
228
|
content: "Error: not found",
|
|
284
229
|
isError: true,
|
|
@@ -294,13 +239,13 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
294
239
|
|
|
295
240
|
await toolFn("app_update", { app_id: "app-err" });
|
|
296
241
|
|
|
297
|
-
expect(
|
|
298
|
-
expect(
|
|
299
|
-
expect(
|
|
242
|
+
expect(refreshSurfacesForAppSpy).not.toHaveBeenCalled();
|
|
243
|
+
expect(broadcastMessageSpy).not.toHaveBeenCalled();
|
|
244
|
+
expect(updatePublishedAppDeploymentSpy).not.toHaveBeenCalled();
|
|
300
245
|
});
|
|
301
246
|
|
|
302
247
|
test("skips side effects when app_id is missing", async () => {
|
|
303
|
-
const ctx =
|
|
248
|
+
const ctx = makeToolSetupContext();
|
|
304
249
|
const executor = makeFakeExecutor({ content: "{}", isError: false });
|
|
305
250
|
|
|
306
251
|
const toolFn = createToolExecutor(
|
|
@@ -313,8 +258,8 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
313
258
|
|
|
314
259
|
await toolFn("app_update", {});
|
|
315
260
|
|
|
316
|
-
expect(
|
|
317
|
-
expect(
|
|
261
|
+
expect(refreshSurfacesForAppSpy).not.toHaveBeenCalled();
|
|
262
|
+
expect(broadcastMessageSpy).not.toHaveBeenCalled();
|
|
318
263
|
});
|
|
319
264
|
});
|
|
320
265
|
|
|
@@ -322,7 +267,7 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
322
267
|
|
|
323
268
|
describe("app_create side effects", () => {
|
|
324
269
|
test("broadcasts app_files_changed immediately after app_create", async () => {
|
|
325
|
-
const ctx =
|
|
270
|
+
const ctx = makeToolSetupContext();
|
|
326
271
|
const executor = makeFakeExecutor({
|
|
327
272
|
content: JSON.stringify({ id: "new-app-1", name: "My App" }),
|
|
328
273
|
isError: false,
|
|
@@ -338,8 +283,8 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
338
283
|
|
|
339
284
|
await toolFn("app_create", { name: "My App", html: "<h1>hi</h1>" });
|
|
340
285
|
|
|
341
|
-
expect(
|
|
342
|
-
expect((
|
|
286
|
+
expect(broadcastMessageSpy.mock.calls.length).toBeGreaterThanOrEqual(1);
|
|
287
|
+
expect((broadcastMessageSpy.mock.calls as unknown[][])[0][0]).toEqual({
|
|
343
288
|
type: "app_files_changed",
|
|
344
289
|
appId: "new-app-1",
|
|
345
290
|
});
|
|
@@ -347,7 +292,9 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
347
292
|
});
|
|
348
293
|
|
|
349
294
|
test("canonicalizes create_app skill_execute alias before hooks run", async () => {
|
|
350
|
-
const ctx =
|
|
295
|
+
const ctx = makeToolSetupContext({
|
|
296
|
+
allowedToolNames: new Set(["app_create"]),
|
|
297
|
+
});
|
|
351
298
|
const executor = makeFakeExecutor({
|
|
352
299
|
content: JSON.stringify({ id: "alias-app-1", name: "Alias App" }),
|
|
353
300
|
isError: false,
|
|
@@ -370,8 +317,8 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
370
317
|
const calls = executor.execute.mock.calls as unknown[][];
|
|
371
318
|
expect(calls[0][0]).toBe("app_create");
|
|
372
319
|
expect(calls[0][1]).toEqual({ name: "Alias App" });
|
|
373
|
-
expect(
|
|
374
|
-
expect((
|
|
320
|
+
expect(broadcastMessageSpy.mock.calls.length).toBeGreaterThanOrEqual(1);
|
|
321
|
+
expect((broadcastMessageSpy.mock.calls as unknown[][])[0][0]).toEqual({
|
|
375
322
|
type: "app_files_changed",
|
|
376
323
|
appId: "alias-app-1",
|
|
377
324
|
});
|
|
@@ -379,7 +326,9 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
379
326
|
});
|
|
380
327
|
|
|
381
328
|
test("canonicalizes legacy computer_use_press_key skill_execute alias before dispatch", async () => {
|
|
382
|
-
const ctx =
|
|
329
|
+
const ctx = makeToolSetupContext({
|
|
330
|
+
allowedToolNames: new Set(["computer_use_key"]),
|
|
331
|
+
});
|
|
383
332
|
const executor = makeFakeExecutor({ content: "ok", isError: false });
|
|
384
333
|
|
|
385
334
|
const toolFn = createToolExecutor(
|
|
@@ -409,7 +358,7 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
409
358
|
});
|
|
410
359
|
|
|
411
360
|
test("preserves exact active create_app skill tool when app_create is also active", async () => {
|
|
412
|
-
const ctx =
|
|
361
|
+
const ctx = makeToolSetupContext({
|
|
413
362
|
allowedToolNames: new Set(["create_app", "app_create"]),
|
|
414
363
|
});
|
|
415
364
|
const executor = makeFakeExecutor({
|
|
@@ -433,11 +382,11 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
433
382
|
|
|
434
383
|
const calls = executor.execute.mock.calls as unknown[][];
|
|
435
384
|
expect(calls[0][0]).toBe("create_app");
|
|
436
|
-
expect(
|
|
385
|
+
expect(broadcastMessageSpy).not.toHaveBeenCalled();
|
|
437
386
|
});
|
|
438
387
|
|
|
439
388
|
test("skips side effects when app_create result is an error", async () => {
|
|
440
|
-
const ctx =
|
|
389
|
+
const ctx = makeToolSetupContext();
|
|
441
390
|
const executor = makeFakeExecutor({ content: "Error", isError: true });
|
|
442
391
|
|
|
443
392
|
const toolFn = createToolExecutor(
|
|
@@ -450,7 +399,7 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
450
399
|
|
|
451
400
|
await toolFn("app_create", { name: "Bad", html: "" });
|
|
452
401
|
|
|
453
|
-
expect(
|
|
402
|
+
expect(broadcastMessageSpy).not.toHaveBeenCalled();
|
|
454
403
|
});
|
|
455
404
|
|
|
456
405
|
test("fires notify side effects regardless of compile outcome reported in payload", async () => {
|
|
@@ -459,7 +408,7 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
459
408
|
// compile or returns compile_errors, the hook still refreshes
|
|
460
409
|
// surfaces and broadcasts — compile retries are the LLM's
|
|
461
410
|
// responsibility via a follow-up tool call, not the hook's.
|
|
462
|
-
const ctx =
|
|
411
|
+
const ctx = makeToolSetupContext();
|
|
463
412
|
const executor = makeFakeExecutor({
|
|
464
413
|
content: JSON.stringify({
|
|
465
414
|
id: "new-app-err",
|
|
@@ -480,14 +429,14 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
480
429
|
|
|
481
430
|
await toolFn("app_create", { name: "Busted", html: "" });
|
|
482
431
|
|
|
483
|
-
expect(
|
|
484
|
-
expect(
|
|
485
|
-
expect((
|
|
432
|
+
expect(refreshSurfacesForAppSpy).toHaveBeenCalledTimes(1);
|
|
433
|
+
expect(broadcastMessageSpy.mock.calls.length).toBeGreaterThanOrEqual(1);
|
|
434
|
+
expect((broadcastMessageSpy.mock.calls as unknown[][])[0][0]).toEqual({
|
|
486
435
|
type: "app_files_changed",
|
|
487
436
|
appId: "new-app-err",
|
|
488
437
|
});
|
|
489
438
|
expectAppChangeBroadcast("new-app-err");
|
|
490
|
-
expect(
|
|
439
|
+
expect(updatePublishedAppDeploymentSpy).toHaveBeenCalledTimes(1);
|
|
491
440
|
});
|
|
492
441
|
});
|
|
493
442
|
|
|
@@ -495,7 +444,7 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
495
444
|
|
|
496
445
|
describe("app_delete side effects", () => {
|
|
497
446
|
test("broadcasts app_files_changed after app_delete", async () => {
|
|
498
|
-
const ctx =
|
|
447
|
+
const ctx = makeToolSetupContext();
|
|
499
448
|
const executor = makeFakeExecutor({ content: "{}", isError: false });
|
|
500
449
|
|
|
501
450
|
const toolFn = createToolExecutor(
|
|
@@ -508,12 +457,12 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
508
457
|
|
|
509
458
|
await toolFn("app_delete", { app_id: "del-app-1" });
|
|
510
459
|
|
|
511
|
-
expect(
|
|
460
|
+
expect(broadcastMessageSpy).toHaveBeenCalledTimes(2);
|
|
512
461
|
expectAppChangeBroadcast("del-app-1");
|
|
513
462
|
});
|
|
514
463
|
|
|
515
464
|
test("skips side effects when app_delete result is an error", async () => {
|
|
516
|
-
const ctx =
|
|
465
|
+
const ctx = makeToolSetupContext();
|
|
517
466
|
const executor = makeFakeExecutor({ content: "Error", isError: true });
|
|
518
467
|
|
|
519
468
|
const toolFn = createToolExecutor(
|
|
@@ -526,7 +475,7 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
526
475
|
|
|
527
476
|
await toolFn("app_delete", { app_id: "del-err" });
|
|
528
477
|
|
|
529
|
-
expect(
|
|
478
|
+
expect(broadcastMessageSpy).not.toHaveBeenCalled();
|
|
530
479
|
});
|
|
531
480
|
});
|
|
532
481
|
|
|
@@ -538,7 +487,7 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
538
487
|
// string comparison, not tool metadata or origin. This means skill-
|
|
539
488
|
// projected tools with the same name trigger the same afterExecute
|
|
540
489
|
// hooks as core tools.
|
|
541
|
-
const ctx =
|
|
490
|
+
const ctx = makeToolSetupContext();
|
|
542
491
|
const executor = makeFakeExecutor({ content: "{}", isError: false });
|
|
543
492
|
|
|
544
493
|
const toolFn = createToolExecutor(
|
|
@@ -551,19 +500,19 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
551
500
|
|
|
552
501
|
// Simulate calling app_refresh by name (as the agent loop does)
|
|
553
502
|
for (const toolName of ["app_refresh"]) {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
503
|
+
refreshSurfacesForAppSpy.mockClear();
|
|
504
|
+
broadcastMessageSpy.mockClear();
|
|
505
|
+
broadcastMessageSpy.mockClear();
|
|
506
|
+
updatePublishedAppDeploymentSpy.mockClear();
|
|
558
507
|
|
|
559
508
|
await toolFn(toolName, {
|
|
560
509
|
app_id: "skill-app",
|
|
561
510
|
});
|
|
562
511
|
|
|
563
|
-
expect(
|
|
564
|
-
expect(
|
|
512
|
+
expect(refreshSurfacesForAppSpy).toHaveBeenCalledTimes(1);
|
|
513
|
+
expect(broadcastMessageSpy).toHaveBeenCalledTimes(2);
|
|
565
514
|
expectAppChangeBroadcast("skill-app");
|
|
566
|
-
expect(
|
|
515
|
+
expect(updatePublishedAppDeploymentSpy).toHaveBeenCalledTimes(1);
|
|
567
516
|
}
|
|
568
517
|
});
|
|
569
518
|
});
|
|
@@ -572,7 +521,7 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
572
521
|
|
|
573
522
|
describe("non-app tools", () => {
|
|
574
523
|
test("other tool names do not trigger app refresh side effects", async () => {
|
|
575
|
-
const ctx =
|
|
524
|
+
const ctx = makeToolSetupContext();
|
|
576
525
|
const executor = makeFakeExecutor({ content: "{}", isError: false });
|
|
577
526
|
|
|
578
527
|
const toolFn = createToolExecutor(
|
|
@@ -591,16 +540,16 @@ describe("session-tool-setup app refresh side effects", () => {
|
|
|
591
540
|
"app_file_edit",
|
|
592
541
|
"app_file_write",
|
|
593
542
|
]) {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
543
|
+
refreshSurfacesForAppSpy.mockClear();
|
|
544
|
+
broadcastMessageSpy.mockClear();
|
|
545
|
+
broadcastMessageSpy.mockClear();
|
|
546
|
+
updatePublishedAppDeploymentSpy.mockClear();
|
|
598
547
|
|
|
599
548
|
await toolFn(toolName, { app_id: "app-1" });
|
|
600
549
|
|
|
601
|
-
expect(
|
|
602
|
-
expect(
|
|
603
|
-
expect(
|
|
550
|
+
expect(refreshSurfacesForAppSpy).not.toHaveBeenCalled();
|
|
551
|
+
expect(broadcastMessageSpy).not.toHaveBeenCalled();
|
|
552
|
+
expect(updatePublishedAppDeploymentSpy).not.toHaveBeenCalled();
|
|
604
553
|
}
|
|
605
554
|
});
|
|
606
555
|
});
|