Goal
Create the package skeleton for @codespar/session-contract inside codespar-core/packages/session-contract/. No logic yet — just the scaffold so the workspace resolves the package and turbo includes it in the build pipeline. Subsequent issues add types, the type guard, and the contract test suite.
Context
The codespar runtime needs a shared session interface contract that both the core runtime and any downstream consumers can import without circular dependencies. This package will be the single source of truth for that contract. It's MIT-licensed, ships as an ES module, and will eventually export the Session interface, a isSession type guard, and a portable contract test suite under the ./testing export condition.
This issue covers only the scaffold: package.json, tsconfig.json, a stub src/index.ts, and wiring into the workspace and turbo pipeline. The package must build cleanly and appear in turbo's task graph before any downstream packages can depend on it.
Acceptance Criteria
Required file contents
packages/session-contract/package.json
{
"name": "@codespar/session-contract",
"version": "0.1.0",
"description": "Shared session interface contract for codespar runtimes",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./testing": {
"development": {
"import": "./dist/testing/contract-suite.js",
"types": "./dist/testing/contract-suite.d.ts"
}
}
},
"scripts": {
"build": "tsc",
"typecheck": "tsc --noEmit"
},
"dependencies": {},
"devDependencies": {
"typescript": "workspace:*",
"vitest": "workspace:*"
},
"license": "MIT"
}
packages/session-contract/tsconfig.json
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src"]
}
packages/session-contract/src/index.ts
// Types and type guard exported in Phase 2
export {};
Dependencies
None. This is the first issue in the milestone and has no blockers.
Downstream Dependencies
All three are blocked until this scaffold exists and builds cleanly.
Goal
Create the package skeleton for
@codespar/session-contractinsidecodespar-core/packages/session-contract/. No logic yet — just the scaffold so the workspace resolves the package and turbo includes it in the build pipeline. Subsequent issues add types, the type guard, and the contract test suite.Context
The codespar runtime needs a shared session interface contract that both the core runtime and any downstream consumers can import without circular dependencies. This package will be the single source of truth for that contract. It's MIT-licensed, ships as an ES module, and will eventually export the
Sessioninterface, aisSessiontype guard, and a portable contract test suite under the./testingexport condition.This issue covers only the scaffold:
package.json,tsconfig.json, a stubsrc/index.ts, and wiring into the workspace and turbo pipeline. The package must build cleanly and appear in turbo's task graph before any downstream packages can depend on it.Acceptance Criteria
packages/session-contract/package.jsonexists withname: "@codespar/session-contract",version: "0.1.0", and the exports map as specified belowpackages/session-contract/tsconfig.jsonextends../../tsconfig.base.jsonand pointsoutDirto./dist,rootDirto./srcpackages/session-contract/src/index.tsexists with a stubexport {}pnpm-workspace.yaml(or equivalent workspace manifest) includespackages/session-contract/— if it uses a glob likepackages/*this is automatic; verify withpnpm lsturbo.jsonincludes@codespar/session-contractin any explicit package lists; if turbo autodiscovers from the workspace manifest no change is needed — verify withturbo run build --filter=@codespar/session-contract(should succeed with no tasks if nothing depends on it yet, or build the stub cleanly)pnpm run build --filter=@codespar/session-contractexits 0pnpm run typecheck --filter=@codespar/session-contractexits 0Required file contents
packages/session-contract/package.json{ "name": "@codespar/session-contract", "version": "0.1.0", "description": "Shared session interface contract for codespar runtimes", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" }, "./testing": { "development": { "import": "./dist/testing/contract-suite.js", "types": "./dist/testing/contract-suite.d.ts" } } }, "scripts": { "build": "tsc", "typecheck": "tsc --noEmit" }, "dependencies": {}, "devDependencies": { "typescript": "workspace:*", "vitest": "workspace:*" }, "license": "MIT" }packages/session-contract/tsconfig.json{ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "./dist", "rootDir": "./src" }, "include": ["src"] }packages/session-contract/src/index.tsDependencies
None. This is the first issue in the milestone and has no blockers.
Downstream Dependencies
Sessioninterface andisSessiontype guard to this package./testingexport condition@codespar/session-contractAll three are blocked until this scaffold exists and builds cleanly.