@jskit-ai/assistant-core 0.1.227 → 0.1.228
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.
|
@@ -70,7 +70,7 @@ const models = reactive({
|
|
|
70
70
|
const goalEnabled = ref(new URLSearchParams(location.search).has("goal"));
|
|
71
71
|
const goal = ref(null);
|
|
72
72
|
const goalState = reactive({
|
|
73
|
-
enabled: goalEnabled, goal, working: computed(() => phase.value === "active"),
|
|
73
|
+
enabled: goalEnabled, goal, pauseBlocked: true, working: computed(() => phase.value === "active"),
|
|
74
74
|
set(input) { phase.value = "active"; goal.value = { ...input, status: "active", elapsedSeconds: 0, sampledAt: Date.now() }; },
|
|
75
75
|
pause() { goal.value = { ...goal.value, status: "paused", elapsedSeconds: goal.value.elapsedSeconds + (Date.now() - goal.value.sampledAt) / 1000, sampledAt: Date.now() }; },
|
|
76
76
|
resume() { phase.value = "active"; goal.value = { ...goal.value, status: "active", reason: "", sampledAt: Date.now() }; },
|
package/package.json
CHANGED
|
@@ -64,8 +64,8 @@ async function setGoal() {
|
|
|
64
64
|
</template>
|
|
65
65
|
<v-card class="assistant-goal__details pa-3" max-width="360">
|
|
66
66
|
<strong role="status">{{ label }}</strong>
|
|
67
|
-
<v-btn v-if="running && state.pause" size="small" :disabled="state.pending" @click="state.pause()">{{ state.action === 'pause' ? 'Pausing…' : 'Pause goal' }}</v-btn>
|
|
68
|
-
<v-btn v-
|
|
67
|
+
<v-btn v-if="(running || (state.pauseBlocked && goal?.status === 'blocked')) && state.pause" size="small" :disabled="state.pending" @click="state.pause()">{{ state.action === 'pause' ? 'Pausing…' : 'Pause goal' }}</v-btn>
|
|
68
|
+
<v-btn v-if="['paused', 'blocked', 'usageLimited'].includes(goal?.status) && state.resume" size="small" :disabled="state.pending" @click="state.resume()">{{ state.action === 'resume' ? 'Resuming…' : 'Resume goal' }}</v-btn>
|
|
69
69
|
<v-btn v-if="goal && goal.status !== 'complete' && state.cancel" color="error" size="small" variant="text" :disabled="state.pending" @click="state.cancel()">{{ state.action === 'cancel' ? 'Cancelling…' : 'Cancel goal' }}</v-btn>
|
|
70
70
|
<p v-if="goal" class="my-2">{{ goal.objective }}</p>
|
|
71
71
|
<p v-if="goal?.reason" class="text-body-small my-2">{{ goal.reason }}</p>
|
|
@@ -816,12 +816,14 @@ test("optional goals show running and paused lights, count only active time, and
|
|
|
816
816
|
await expect(light).toHaveCSS("animation-name", "none");
|
|
817
817
|
await page.getByRole("button", { name: "Goal blocked", exact: true }).click();
|
|
818
818
|
await page.clock.runFor(250);
|
|
819
|
-
for (const name of ["Resume goal", "Cancel goal"]) {
|
|
819
|
+
for (const name of ["Pause goal", "Resume goal", "Cancel goal"]) {
|
|
820
820
|
const button = page.getByRole("button", { name, exact: true });
|
|
821
821
|
await expect(button).toBeInViewport();
|
|
822
822
|
const bounds = await button.boundingBox();
|
|
823
823
|
assert.ok(bounds.y >= 0 && bounds.y + bounds.height <= 577, `${name} is fully visible without scrolling`);
|
|
824
824
|
}
|
|
825
|
+
await page.getByRole("button", { name: "Pause goal", exact: true }).click();
|
|
826
|
+
await expect(page.getByRole("button", { name: "Goal paused", exact: true })).toBeVisible();
|
|
825
827
|
await page.getByRole("button", { name: "Resume goal", exact: true }).click();
|
|
826
828
|
await expect(page.getByRole("button", { name: "Pause goal", exact: true })).toBeVisible();
|
|
827
829
|
await page.getByRole("button", { name: "Toggle goals" }).evaluate(element => element.click());
|
package/test/claudeTurn.test.js
CHANGED
|
@@ -2528,3 +2528,14 @@ test("Claude Block refuses absent reasons and stale identity before interrupting
|
|
|
2528
2528
|
assert.equal(f.entry.blockedGoal, null);
|
|
2529
2529
|
}
|
|
2530
2530
|
});
|
|
2531
|
+
|
|
2532
|
+
|
|
2533
|
+
test("Claude explicitly pauses a blocked goal without resuming native work", async t => {
|
|
2534
|
+
const f = await publishedClaudeFixture(t);
|
|
2535
|
+
f.entry.blockedGoal = { threadId: f.entry.id, createdAt: 123, objective: "Finish checks", status: "blocked", reason: "Native loop stopped" };
|
|
2536
|
+
const result = await f.owner.updateGoal(f.entry, { action: "pause", threadId: f.entry.id, createdAt: 123, objective: "Finish checks" });
|
|
2537
|
+
assert.equal(result.goal.status, "paused");
|
|
2538
|
+
assert.equal(f.entry.blockedGoal, null);
|
|
2539
|
+
assert.equal(f.entry.pausedGoal.status, "paused");
|
|
2540
|
+
assert.equal(f.processes.length, 0);
|
|
2541
|
+
});
|