@saadnvd1/agent-os 0.3.631 → 0.3.637
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/app/api/tasks/[id]/approve-plan/route.ts +6 -1
- package/app/api/tasks/[id]/export/route.ts +3 -2
- package/app/api/tasks/[id]/plan/route.ts +37 -0
- package/app/api/tasks/route.ts +4 -1
- package/app/globals.css +28 -0
- package/components/Chat/ChatPanel.tsx +2 -11
- package/components/Chat/EventTurns.tsx +1 -7
- package/components/Chat/Markdown.tsx +1 -0
- package/components/Chat/Messages.tsx +1 -1
- package/lib/approvals/enable.ts +9 -2
- package/lib/chat/events.ts +4 -0
- package/lib/chat/group.ts +3 -1
- package/lib/chat/reading-order.ts +50 -0
- package/lib/chat/turns.ts +22 -3
- package/lib/chat/worker/host.ts +3 -0
- package/lib/db/migrations/20261015T1600_plan_waits_for_caller.ts +19 -0
- package/lib/db/types.ts +6 -1
- package/lib/env-setup.ts +17 -4
- package/lib/models/plan-step.ts +75 -24
- package/lib/tasks/held.ts +23 -0
- package/lib/tasks/hold-checks.ts +134 -0
- package/lib/tasks/holds.ts +281 -0
- package/lib/tasks/import.ts +11 -3
- package/lib/tasks/index.ts +25 -3
- package/lib/tasks/move-bundle.ts +17 -2
- package/lib/tasks/move-guard.ts +9 -1
- package/lib/tasks/move.ts +5 -4
- package/lib/tasks/pause.ts +2 -31
- package/lib/tasks/placement.ts +16 -16
- package/lib/tasks/plan-view.ts +11 -3
- package/lib/tasks/queue-candidates.ts +151 -0
- package/lib/tasks/queue-placement.ts +155 -0
- package/lib/tasks/queue-rows.ts +236 -0
- package/lib/tasks/queue-start.ts +211 -0
- package/lib/tasks/queue-tick.ts +148 -0
- package/lib/tasks/queue-types.ts +141 -0
- package/lib/tasks/queue-view.ts +112 -0
- package/lib/tasks/queue.ts +53 -1096
- package/lib/tasks/remote-plan-path.ts +7 -0
- package/lib/tasks/remote-plan.ts +308 -0
- package/lib/tasks/remote.ts +18 -1
- package/lib/tasks/schedule.ts +44 -147
- package/package.json +1 -1
- package/scripts/check +55 -7
- package/lib/tasks/auto-hold.ts +0 -17
package/scripts/check
CHANGED
|
@@ -2,18 +2,66 @@
|
|
|
2
2
|
# The full guard, the same run locally and in CI:
|
|
3
3
|
# scripts/check banned terms, typecheck, lint, format, tests
|
|
4
4
|
# scripts/check --build ...and a production build, held to its JS budget
|
|
5
|
+
# CI runs the same groups as parallel jobs:
|
|
6
|
+
# --only static,test,build run just these groups (static = migrations,
|
|
7
|
+
# terms, typecheck, lint, format)
|
|
8
|
+
# --parallel run typecheck, lint and format at once
|
|
9
|
+
# -- <args> passed to `vitest run` (e.g. --shard=1/3)
|
|
5
10
|
set -euo pipefail
|
|
6
11
|
cd "$(dirname "$0")/.."
|
|
7
12
|
|
|
13
|
+
usage() { sed -n '2,10p' "$0" | sed 's/^# \{0,1\}//' >&2; exit 2; }
|
|
14
|
+
|
|
15
|
+
groups="static,test" parallel=0 vitest_args=()
|
|
16
|
+
while [ $# -gt 0 ]; do
|
|
17
|
+
case "$1" in
|
|
18
|
+
--build) groups="$groups,build" ;;
|
|
19
|
+
--only) [ $# -ge 2 ] || usage; groups="$2"; shift ;;
|
|
20
|
+
--parallel) parallel=1 ;;
|
|
21
|
+
--) shift; vitest_args=("$@"); break ;;
|
|
22
|
+
*) usage ;;
|
|
23
|
+
esac
|
|
24
|
+
shift
|
|
25
|
+
done
|
|
26
|
+
for g in ${groups//,/ }; do
|
|
27
|
+
case "$g" in static|test|build) ;; *) usage ;; esac
|
|
28
|
+
done
|
|
29
|
+
has() { [[ ",$groups," == *",$1,"* ]]; }
|
|
30
|
+
|
|
8
31
|
step() { printf '\n▸ %s\n' "$1"; }
|
|
9
32
|
|
|
10
|
-
|
|
11
|
-
step "
|
|
12
|
-
step "
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
33
|
+
if has static; then
|
|
34
|
+
step "migrations"; node scripts/gen-migrations-index.mjs && node scripts/gen-migrations-index.mjs --check
|
|
35
|
+
step "terms"; npx tsx scripts/hooks/banned-terms.ts --tree
|
|
36
|
+
if [ "$parallel" = 1 ]; then
|
|
37
|
+
out=$(mktemp -d); trap 'rm -rf "$out"' EXIT
|
|
38
|
+
pids=()
|
|
39
|
+
npx tsc --noEmit >"$out/typecheck" 2>&1 & pids+=($!)
|
|
40
|
+
npx eslint . --max-warnings=40 --concurrency=auto >"$out/lint" 2>&1 & pids+=($!)
|
|
41
|
+
npx prettier --check . --log-level warn >"$out/format" 2>&1 & pids+=($!)
|
|
42
|
+
failed=()
|
|
43
|
+
names=(typecheck lint format)
|
|
44
|
+
for i in 0 1 2; do
|
|
45
|
+
wait "${pids[$i]}" || failed+=("${names[$i]}")
|
|
46
|
+
step "${names[$i]}"; cat "$out/${names[$i]}"
|
|
47
|
+
done
|
|
48
|
+
if [ ${#failed[@]} -gt 0 ]; then
|
|
49
|
+
printf '\n✗ failed: %s\n' "${failed[*]}" >&2
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
else
|
|
53
|
+
step "typecheck"; npx tsc --noEmit
|
|
54
|
+
step "lint"; npx eslint . --max-warnings=40 --concurrency=auto
|
|
55
|
+
step "format"; npx prettier --check . --log-level warn
|
|
56
|
+
fi
|
|
57
|
+
fi
|
|
58
|
+
if has test; then
|
|
59
|
+
step "test"; npx vitest run ${vitest_args[@]+"${vitest_args[@]}"}
|
|
60
|
+
fi
|
|
61
|
+
if has build; then
|
|
62
|
+
# The build imports the generated migrations index, so it needs it even
|
|
63
|
+
# when the static group (which checks it) did not run.
|
|
64
|
+
step "migrations"; node scripts/gen-migrations-index.mjs
|
|
17
65
|
step "build"; npx next build
|
|
18
66
|
step "bundle"; node scripts/check-bundle.mjs
|
|
19
67
|
fi
|
package/lib/tasks/auto-hold.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { brakesEnabled } from "../orchestrator/brakes";
|
|
2
|
-
import { isPaused } from "../orchestrator/pause";
|
|
3
|
-
import { readUsage, windowRefusal } from "../orchestrator/usage";
|
|
4
|
-
import type { Hold } from "./schedule";
|
|
5
|
-
|
|
6
|
-
// Why an automatic start has to wait, or null. A start now by a person
|
|
7
|
-
// isn't held.
|
|
8
|
-
export function autoHold(
|
|
9
|
-
workspaceId: string | null,
|
|
10
|
-
planOnly = false
|
|
11
|
-
): Hold | null {
|
|
12
|
-
if (workspaceId && isPaused(workspaceId))
|
|
13
|
-
return { code: "orch_paused", text: "Waiting: the orchestrator is paused" };
|
|
14
|
-
if (planOnly) return null;
|
|
15
|
-
const window = brakesEnabled() ? windowRefusal(readUsage()) : null;
|
|
16
|
-
return window ? { code: "window", text: `Waiting: ${window}` } : null;
|
|
17
|
-
}
|