@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.
Files changed (45) hide show
  1. package/app/api/tasks/[id]/approve-plan/route.ts +6 -1
  2. package/app/api/tasks/[id]/export/route.ts +3 -2
  3. package/app/api/tasks/[id]/plan/route.ts +37 -0
  4. package/app/api/tasks/route.ts +4 -1
  5. package/app/globals.css +28 -0
  6. package/components/Chat/ChatPanel.tsx +2 -11
  7. package/components/Chat/EventTurns.tsx +1 -7
  8. package/components/Chat/Markdown.tsx +1 -0
  9. package/components/Chat/Messages.tsx +1 -1
  10. package/lib/approvals/enable.ts +9 -2
  11. package/lib/chat/events.ts +4 -0
  12. package/lib/chat/group.ts +3 -1
  13. package/lib/chat/reading-order.ts +50 -0
  14. package/lib/chat/turns.ts +22 -3
  15. package/lib/chat/worker/host.ts +3 -0
  16. package/lib/db/migrations/20261015T1600_plan_waits_for_caller.ts +19 -0
  17. package/lib/db/types.ts +6 -1
  18. package/lib/env-setup.ts +17 -4
  19. package/lib/models/plan-step.ts +75 -24
  20. package/lib/tasks/held.ts +23 -0
  21. package/lib/tasks/hold-checks.ts +134 -0
  22. package/lib/tasks/holds.ts +281 -0
  23. package/lib/tasks/import.ts +11 -3
  24. package/lib/tasks/index.ts +25 -3
  25. package/lib/tasks/move-bundle.ts +17 -2
  26. package/lib/tasks/move-guard.ts +9 -1
  27. package/lib/tasks/move.ts +5 -4
  28. package/lib/tasks/pause.ts +2 -31
  29. package/lib/tasks/placement.ts +16 -16
  30. package/lib/tasks/plan-view.ts +11 -3
  31. package/lib/tasks/queue-candidates.ts +151 -0
  32. package/lib/tasks/queue-placement.ts +155 -0
  33. package/lib/tasks/queue-rows.ts +236 -0
  34. package/lib/tasks/queue-start.ts +211 -0
  35. package/lib/tasks/queue-tick.ts +148 -0
  36. package/lib/tasks/queue-types.ts +141 -0
  37. package/lib/tasks/queue-view.ts +112 -0
  38. package/lib/tasks/queue.ts +53 -1096
  39. package/lib/tasks/remote-plan-path.ts +7 -0
  40. package/lib/tasks/remote-plan.ts +308 -0
  41. package/lib/tasks/remote.ts +18 -1
  42. package/lib/tasks/schedule.ts +44 -147
  43. package/package.json +1 -1
  44. package/scripts/check +55 -7
  45. 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
- step "migrations"; node scripts/gen-migrations-index.mjs && node scripts/gen-migrations-index.mjs --check
11
- step "terms"; npx tsx scripts/hooks/banned-terms.ts --tree
12
- step "typecheck"; npx tsc --noEmit
13
- step "lint"; npx eslint . --max-warnings=40
14
- step "format"; npx prettier --check . --log-level warn
15
- step "test"; npx vitest run
16
- if [ "${1:-}" = "--build" ]; then
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
@@ -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
- }