Skip to content

Commit d2ad311

Browse files
committed
..
1 parent 3141774 commit d2ad311

File tree

15 files changed

+76
-350
lines changed

15 files changed

+76
-350
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ out
8383
# Nuxt.js build / generate output
8484
.nuxt
8585
dist
86+
scripts/dist
8687

8788
# Gatsby files
8889
.cache/

jest.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const replaceJsExtensionsPlugin = path.join(
99

1010
export default {
1111
testEnvironment: 'node',
12-
setupFilesAfterEnv: ['<rootDir>/tests/mockOpenAI.js'],
12+
setupFilesAfterEnv: ['<rootDir>/tests/mockOpenAI.ts'],
1313
roots: ['<rootDir>/packages', '<rootDir>/tests'],
1414
extensionsToTreatAsEsm: ['.ts'],
1515
moduleNameMapper: {

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
"packages/*"
99
],
1010
"scripts": {
11-
"start": "node ./scripts/start.js",
11+
"start": "node ./scripts/dist/start.js",
1212
"prestart": "npm run build",
13-
"build": "npm run build --workspace @asynkron/openagent-core && npm run build --workspaces --if-present",
13+
"build": "npm run build --workspace @asynkron/openagent-core && npm run build --workspaces --if-present && npm run build:scripts",
14+
"build:scripts": "tsc -p tsconfig.scripts.json",
1415
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
1516
"pretest": "npm run build",
1617
"typecheck": "tsc --noEmit -p tsconfig.typecheck.json",
@@ -22,7 +23,7 @@
2223
"prelint": "",
2324
"prepare": "",
2425
"postinstall": "",
25-
"release:verify-tag": "node ./scripts/verify-release-tag.js"
26+
"release:verify-tag": "npm run build:scripts && node ./scripts/dist/verify-release-tag.js"
2627
},
2728
"keywords": [],
2829
"author": "",

packages/cli/src/__tests__/loadCoreModule.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { jest } from '@jest/globals';
22

3-
const loaderPath = '../loadCoreModule.js';
3+
const loaderPath = '../loadCoreModule.ts';
44
const loaderUrl = new URL(loaderPath, import.meta.url);
5-
const fallbackSpecifier = new URL('../../core/index.js', loaderUrl).href;
5+
const fallbackSpecifier = new URL('../../core/index.ts', loaderUrl).href;
66

77
async function importLoader() {
88
return import(loaderPath);

packages/cli/src/__tests__/runner.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { jest } from '@jest/globals';
22

3-
const RUNNER_MODULE = '../runner.js';
3+
const RUNNER_MODULE = '../runner.ts';
44

55
describe('runCli', () => {
66
const envBackup = { ...process.env };
@@ -25,7 +25,7 @@ describe('runCli', () => {
2525
// The real runtime spins up Ink's render loop which keeps timers and streams
2626
// alive even when the CLI exits early. Mock it so the test process can
2727
// terminate without leaking handles while still verifying the guard clause.
28-
await jest.unstable_mockModule('../runtime.js', () => ({
28+
await jest.unstable_mockModule('../runtime.ts', () => ({
2929
__esModule: true,
3030
agentLoop: agentLoopMock,
3131
runCommandAndTrack: runCommandAndTrackMock,

schemas/context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## Positive Signals
1212

13-
- Schema is consumed by `scripts/validate-json-assets.js` and Jest tests, catching prompt regressions early.
13+
- Schema is consumed by `scripts/validate-json-assets.ts` (compiled to `scripts/dist/`) and Jest tests, catching prompt regressions early.
1414

1515
## Risks / Gaps
1616

scripts/context.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
## Key Files
88

9-
- `replace-node.js` — jscodeshift transform for structural refactors that still lives at the repo root.
10-
- `start.js` — orchestrates `npm start` modes. Defaults to the CLI but adds a `web` target that builds the frontend bundle before launching the web backend.
11-
- `validate-json-assets.js` — validates prompt JSON against `schemas/prompts.schema.json`.
12-
- `verify-release-tag.js` — ensures release tags align with package metadata before publishing.
9+
- `replace-node.cts`thin wrapper that re-exports the compiled jscodeshift transform from `@asynkron/openagent-core`, keeping legacy CLI invocations working while the source lives alongside the core package.
10+
- `start.ts` — orchestrates `npm start` modes. Defaults to the CLI but adds a `web` target that builds the frontend bundle before launching the web backend. Emits to `scripts/dist/start.js` during the root build.
11+
- `validate-json-assets.ts` — validates prompt JSON against `schemas/prompts.schema.json`, guarding against schema drift. Compiled output lives under `scripts/dist/`.
12+
- `verify-release-tag.ts` — ensures release tags align with package metadata before publishing (also compiled into `scripts/dist/`).
1313
- `babel/plugins/replaceJsExtensions.cjs` — Babel helper used by Jest to rewrite the CLI's `.js`
1414
import specifiers (including dynamic `import()` calls) to `.ts` during test transforms so the
1515
TypeScript sources load without bundling.

0 commit comments

Comments
 (0)