History

Update dependencies and add utility functions

- Added `@executor/convex` as a dependency in multiple package configurations. - Introduced `postcss` dependency in the web app package. - Added `asPayload` utility function to handle non-object values in tool call payloads. - Refactored imports to utilize the new `asPayload` function in relevant files. - Updated `core` package dependencies with `better-result` and `graphql`.

Rhys Sullivan committed 9 months ago

Commit 650736b1 parent 2c3cc0e10 files · +54 −14Browse files

Unified · Split

10 files
  1. assistant/packages/server/package.json +1 −0
  2. bun.lock +6 −0
  3. executor/apps/web/package.json +1 −0
  4. executor/packages/convex/lib/object.ts +7 −0
  5. executor/packages/convex/runtime/tool_call_credentials.ts +1 −1
  6. executor/packages/convex/runtime/tool_invocation.ts +2 −1
  7. executor/packages/core/package.json +4 −0
  8. executor/packages/core/src/utils.ts +0 −12
  9. knip.json +31 −0
  10. package.json +1 −0
assistant/packages/server/package.json+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 },
1414 "dependencies": {
1515 "@assistant/core": "workspace:*",
16+ "@executor/convex": "workspace:*",
1617 "convex": "^1.31.7",
1718 "elysia": "latest",
1819 "@elysiajs/eden": "latest"
bun.lock+6−0
@@ -70,6 +70,7 @@ · 69 unmodified lines
7070 "dependencies": {
7171 "@assistant/core": "workspace:*",
7272 "@elysiajs/eden": "latest",
73+ "@executor/convex": "workspace:*",
7374 "convex": "^1.31.7",
7475 "elysia": "latest",
7576 },
@@ -117,6 +118,7 @@ · 41 unmodified lines
117118 "@types/react-dom": "^19",
118119 "eslint": "^9",
119120 "eslint-config-next": "16.1.6",
121+ "postcss": "^8.5.6",
120122 "shadcn": "^3.8.4",
121123 "tailwindcss": "^4",
122124 "tw-animate-css": "^1.4.0",
@@ -144,6 +146,10 @@ · 21 unmodified lines
144146 "executor/packages/core": {
145147 "name": "@executor/core",
146148 "version": "0.1.0",
149+ "dependencies": {
150+ "better-result": "^2.7.0",
151+ "graphql": "^16.12.0",
152+ },
147153 "devDependencies": {
148154 "typescript": "^5.9.3",
149155 },
executor/apps/web/package.json+1−0
@@ -43,6 +43,7 @@ · 42 unmodified lines
4343 "@types/react-dom": "^19",
4444 "eslint": "^9",
4545 "eslint-config-next": "16.1.6",
46+ "postcss": "^8.5.6",
4647 "shadcn": "^3.8.4",
4748 "tailwindcss": "^4",
4849 "tw-animate-css": "^1.4.0",
executor/packages/convex/lib/object.ts+7−0
@@ -4,3 +4,10 @@ export function asRecord(value: unknown): Record<string, unknown> { · 3 unmodified lines
44 }
55 return {};
66 }
7+
8+export function asPayload(value: unknown): Record<string, unknown> {
9+ if (value && typeof value === "object") {
10+ return value as Record<string, unknown>;
11+ }
12+ return { value };
13+}
executor/packages/convex/runtime/tool_call_credentials.ts+1−1
@@ -5,7 +5,7 @@ import { internal } from "../_generated/api"; · 4 unmodified lines
55 import { resolveCredentialPayload } from "../../core/src/credential-providers";
66 import { APPROVAL_DENIED_PREFIX } from "../../core/src/execution-constants";
77 import type { CredentialScope, ResolvedToolCredential, TaskRecord, ToolCallRecord, ToolCredentialSpec } from "../../core/src/types";
8−import { asPayload } from "../../core/src/utils";
8+import { asPayload } from "../lib/object";
99
1010 export async function resolveCredentialHeaders(
1111 ctx: ActionCtx,
executor/packages/convex/runtime/tool_invocation.ts+2−1
@@ -12,7 +12,8 @@ import type { · 11 unmodified lines
1212 ToolCallRequest,
1313 ToolRunContext,
1414 } from "../../core/src/types";
15−import { asPayload, describeError } from "../../core/src/utils";
15+import { describeError } from "../../core/src/utils";
16+import { asPayload } from "../lib/object";
1617 import { getToolDecision, isToolAllowedForTask } from "./policy";
1718 import { baseTools } from "./workspace_tools";
1819 import { publishTaskEvent } from "./events";
executor/packages/core/package.json+4−0
@@ -9,6 +9,10 @@ · 8 unmodified lines
99 "scripts": {
1010 "typecheck": "tsc --noEmit"
1111 },
12+ "dependencies": {
13+ "better-result": "^2.7.0",
14+ "graphql": "^16.12.0"
15+ },
1216 "devDependencies": {
1317 "typescript": "^5.9.3"
1418 }
executor/packages/core/src/utils.ts+0−12
@@ -9,18 +9,6 @@ export function asRecord(value: unknown): Record<string, unknown> { · 8 unmodified lines
99 return {};
1010 }
1111
12−/**
13− * Like `asRecord`, but for tool call payloads: wraps non-object values
14− * in `{ value }` instead of returning an empty object. Use this when
15− * the caller may have passed a bare primitive as input.
16− */
17−export function asPayload(value: unknown): Record<string, unknown> {
18− if (value && typeof value === "object") {
19− return value as Record<string, unknown>;
20− }
21− return { value };
22−}
23−
2412 /**
2513 * Extract a human-readable message from an unknown thrown value.
2614 */
knip.json+31−0
@@ -0,0 +1,31 @@
1+{
2+ "$schema": "https://unpkg.com/knip@latest/schema.json",
3+ "ignoreIssues": {
4+ "executor/packages/core/src/**/*.ts": [
5+ "types"
6+ ]
7+ },
8+ "workspaces": {
9+ "executor/packages/convex": {
10+ "entry": [
11+ "*.ts"
12+ ],
13+ "ignore": [
14+ "_generated/server.d.ts"
15+ ]
16+ },
17+ "executor/packages/core": {
18+ "entry": [
19+ "src/function-builders.ts",
20+ "src/identity.ts",
21+ "src/mcp-server.ts",
22+ "src/tool-discovery.ts",
23+ "src/tool-sources.ts",
24+ "src/managed-runtime.ts",
25+ "src/slug.ts",
26+ "../convex/**/*.ts",
27+ "../../executor.ts"
28+ ]
29+ }
30+ }
31+}
package.json+1−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 "typecheck": "bun run typecheck:executor && bun run typecheck:assistant",
3030 "typecheck:executor": "bunx tsc --noEmit -p executor/tsconfig.json",
3131 "typecheck:assistant": "bunx tsc --noEmit -p assistant/packages/server/tsconfig.json && bunx tsc --noEmit -p assistant/packages/bot/tsconfig.json",
32+ "knip": "bunx knip --config knip.json",
3233 "db:clear:executor": "bun with-env bun run executor/scripts/dev/wipe-convex-db.ts",
3334 "convex:codegen": "bunx --cwd executor convex codegen"
3435 },