@treeseed/core 0.8.3 → 0.8.5

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 (133) hide show
  1. package/README.md +7 -11
  2. package/dist/dev-watch.js +1 -1
  3. package/dist/dev.d.ts +2 -4
  4. package/dist/dev.js +4 -124
  5. package/dist/env.yaml +23 -175
  6. package/dist/index.d.ts +0 -4
  7. package/dist/index.js +0 -6
  8. package/dist/scripts/build-dist.js +3 -3
  9. package/dist/scripts/dev-platform.js +1 -7
  10. package/dist/scripts/run-fixture-astro-command.js +25 -51
  11. package/dist/scripts/test-smoke.js +50 -7
  12. package/package.json +5 -78
  13. package/templates/github/deploy-web.workflow.yml +111 -0
  14. package/templates/github/hosted-project.workflow.yml +4 -4
  15. package/dist/agent-runtime.d.ts +0 -17
  16. package/dist/agent-runtime.js +0 -117
  17. package/dist/agent.d.ts +0 -11
  18. package/dist/agent.js +0 -25
  19. package/dist/agents/adapters/execution.d.ts +0 -41
  20. package/dist/agents/adapters/execution.js +0 -73
  21. package/dist/agents/adapters/mutations.d.ts +0 -22
  22. package/dist/agents/adapters/mutations.js +0 -30
  23. package/dist/agents/adapters/notification.d.ts +0 -26
  24. package/dist/agents/adapters/notification.js +0 -46
  25. package/dist/agents/adapters/repository.d.ts +0 -23
  26. package/dist/agents/adapters/repository.js +0 -61
  27. package/dist/agents/adapters/research.d.ts +0 -26
  28. package/dist/agents/adapters/research.js +0 -59
  29. package/dist/agents/adapters/verification.d.ts +0 -36
  30. package/dist/agents/adapters/verification.js +0 -62
  31. package/dist/agents/cli-tools.d.ts +0 -1
  32. package/dist/agents/cli-tools.js +0 -5
  33. package/dist/agents/cli.d.ts +0 -15
  34. package/dist/agents/cli.js +0 -109
  35. package/dist/agents/contracts/messages.d.ts +0 -88
  36. package/dist/agents/contracts/messages.js +0 -138
  37. package/dist/agents/contracts/run.d.ts +0 -21
  38. package/dist/agents/contracts/run.js +0 -0
  39. package/dist/agents/index.d.ts +0 -1
  40. package/dist/agents/index.js +0 -5
  41. package/dist/agents/kernel/agent-kernel.d.ts +0 -51
  42. package/dist/agents/kernel/agent-kernel.js +0 -292
  43. package/dist/agents/kernel/trigger-resolver.d.ts +0 -19
  44. package/dist/agents/kernel/trigger-resolver.js +0 -157
  45. package/dist/agents/registry-helper.d.ts +0 -4
  46. package/dist/agents/registry-helper.js +0 -14
  47. package/dist/agents/registry.d.ts +0 -6
  48. package/dist/agents/registry.js +0 -98
  49. package/dist/agents/runtime-types.d.ts +0 -118
  50. package/dist/agents/runtime-types.js +0 -0
  51. package/dist/agents/spec-loader.d.ts +0 -18
  52. package/dist/agents/spec-loader.js +0 -55
  53. package/dist/agents/spec-normalizer.d.ts +0 -2
  54. package/dist/agents/spec-normalizer.js +0 -327
  55. package/dist/agents/spec-types.d.ts +0 -64
  56. package/dist/agents/spec-types.js +0 -0
  57. package/dist/agents/testing/agents-smoke.d.ts +0 -1
  58. package/dist/agents/testing/agents-smoke.js +0 -32
  59. package/dist/agents/testing/e2e-harness.d.ts +0 -44
  60. package/dist/agents/testing/e2e-harness.js +0 -504
  61. package/dist/api/agent-routes.d.ts +0 -13
  62. package/dist/api/agent-routes.js +0 -327
  63. package/dist/api/app.d.ts +0 -5
  64. package/dist/api/app.js +0 -361
  65. package/dist/api/auth/d1-database.d.ts +0 -3
  66. package/dist/api/auth/d1-database.js +0 -20
  67. package/dist/api/auth/d1-provider.d.ts +0 -79
  68. package/dist/api/auth/d1-provider.js +0 -92
  69. package/dist/api/auth/d1-store.d.ts +0 -114
  70. package/dist/api/auth/d1-store.js +0 -895
  71. package/dist/api/auth/memory-provider.d.ts +0 -77
  72. package/dist/api/auth/memory-provider.js +0 -249
  73. package/dist/api/auth/rbac.d.ts +0 -22
  74. package/dist/api/auth/rbac.js +0 -162
  75. package/dist/api/auth/tokens.d.ts +0 -18
  76. package/dist/api/auth/tokens.js +0 -56
  77. package/dist/api/capabilities.d.ts +0 -9
  78. package/dist/api/capabilities.js +0 -33
  79. package/dist/api/config.d.ts +0 -2
  80. package/dist/api/config.js +0 -77
  81. package/dist/api/http.d.ts +0 -28
  82. package/dist/api/http.js +0 -51
  83. package/dist/api/index.d.ts +0 -9
  84. package/dist/api/index.js +0 -18
  85. package/dist/api/operations-routes.d.ts +0 -11
  86. package/dist/api/operations-routes.js +0 -87
  87. package/dist/api/operations.d.ts +0 -3
  88. package/dist/api/operations.js +0 -26
  89. package/dist/api/project-routes.d.ts +0 -8
  90. package/dist/api/project-routes.js +0 -586
  91. package/dist/api/providers.d.ts +0 -2
  92. package/dist/api/providers.js +0 -62
  93. package/dist/api/railway.d.ts +0 -50
  94. package/dist/api/railway.js +0 -69
  95. package/dist/api/sdk-dispatch.d.ts +0 -5
  96. package/dist/api/sdk-dispatch.js +0 -13
  97. package/dist/api/sdk-routes.d.ts +0 -11
  98. package/dist/api/sdk-routes.js +0 -29
  99. package/dist/api/server.d.ts +0 -2
  100. package/dist/api/server.js +0 -10
  101. package/dist/api/templates.d.ts +0 -3
  102. package/dist/api/templates.js +0 -31
  103. package/dist/api/types.d.ts +0 -231
  104. package/dist/api/types.js +0 -0
  105. package/dist/api.d.ts +0 -1
  106. package/dist/api.js +0 -1
  107. package/dist/railway.d.ts +0 -1
  108. package/dist/railway.js +0 -4
  109. package/dist/services/agents.d.ts +0 -11
  110. package/dist/services/agents.js +0 -48
  111. package/dist/services/common.d.ts +0 -66
  112. package/dist/services/common.js +0 -212
  113. package/dist/services/index.d.ts +0 -6
  114. package/dist/services/index.js +0 -19
  115. package/dist/services/manager.d.ts +0 -267
  116. package/dist/services/manager.js +0 -1368
  117. package/dist/services/remote-runner.d.ts +0 -30
  118. package/dist/services/remote-runner.js +0 -230
  119. package/dist/services/workday-content.d.ts +0 -53
  120. package/dist/services/workday-content.js +0 -190
  121. package/dist/services/workday-manager.d.ts +0 -279
  122. package/dist/services/workday-manager.js +0 -163
  123. package/dist/services/workday-report.d.ts +0 -195
  124. package/dist/services/workday-report.js +0 -17
  125. package/dist/services/workday-start.d.ts +0 -195
  126. package/dist/services/workday-start.js +0 -17
  127. package/dist/services/worker-capacity.d.ts +0 -58
  128. package/dist/services/worker-capacity.js +0 -208
  129. package/dist/services/worker-pool-scaler.d.ts +0 -27
  130. package/dist/services/worker-pool-scaler.js +0 -127
  131. package/dist/services/worker.d.ts +0 -19
  132. package/dist/services/worker.js +0 -436
  133. package/templates/github/deploy.workflow.yml +0 -577
@@ -20,12 +20,7 @@ function readNumberOption(name) {
20
20
  return Number.isInteger(parsed) && parsed > 0 ? parsed : undefined;
21
21
  }
22
22
  function parseSurface(value) {
23
- if (value === 'web'
24
- || value === 'api'
25
- || value === 'manager'
26
- || value === 'worker'
27
- || value === 'services'
28
- || value === 'integrated') {
23
+ if (value === 'web' || value === 'integrated') {
29
24
  return value;
30
25
  }
31
26
  return 'integrated';
@@ -55,7 +50,6 @@ const exitCode = await runTreeseedIntegratedDev({
55
50
  webPort: readNumberOption('--port'),
56
51
  apiHost: readOption('--api-host'),
57
52
  apiPort: readNumberOption('--api-port'),
58
- managerPort: readNumberOption('--manager-port'),
59
53
  setupMode: parseSetupMode(readOption('--setup')),
60
54
  feedbackMode: parseFeedbackMode(readOption('--feedback')),
61
55
  openMode: parseOpenMode(readOption('--open')),
@@ -1,62 +1,36 @@
1
- import { existsSync, mkdirSync, rmSync, symlinkSync } from 'node:fs';
2
1
  import { spawnSync } from 'node:child_process';
3
- import { dirname, resolve } from 'node:path';
4
- import { createRequire } from 'node:module';
2
+ import { resolve } from 'node:path';
5
3
  import { tmpdir } from 'node:os';
4
+ import { prepareFixturePackages } from '@treeseed/sdk/fixture-support';
6
5
  import { fixtureRoot, packageRoot } from './paths.js';
7
6
  const [command, ...rest] = process.argv.slice(2);
8
- const require = createRequire(import.meta.url);
9
7
  if (!command) {
10
8
  console.error('Usage: node ./scripts/run-fixture-astro-command.mjs <check|build|preview|dev> [...args]');
11
9
  process.exit(1);
12
10
  }
13
- function resolveInstalledPackageRoot(packageName) {
14
- const packageJsonCandidate = (() => {
15
- try {
16
- return require.resolve(`${packageName}/package.json`);
17
- }
18
- catch {
19
- return null;
20
- }
21
- })();
22
- if (packageJsonCandidate) {
23
- return dirname(packageJsonCandidate);
24
- }
25
- const moduleEntryCandidate = (() => {
26
- try {
27
- return require.resolve(packageName);
28
- }
29
- catch {
30
- return null;
31
- }
32
- })();
33
- if (!moduleEntryCandidate) {
34
- return null;
35
- }
36
- let currentDir = dirname(moduleEntryCandidate);
37
- while (currentDir !== dirname(currentDir)) {
38
- if (existsSync(resolve(currentDir, 'package.json'))) {
39
- return currentDir;
40
- }
41
- currentDir = dirname(currentDir);
42
- }
43
- return null;
44
- }
45
- function ensureFixtureWorkspacePackage(packageName, workspaceDir) {
46
- const packageDir = resolve(fixtureRoot, 'node_modules', ...packageName.split('/'));
47
- const resolvedPackageRoot = [
48
- workspaceDir,
49
- resolveInstalledPackageRoot(packageName),
50
- ].find((candidate) => Boolean(candidate) && existsSync(candidate));
51
- if (!resolvedPackageRoot) {
52
- throw new Error(`Unable to resolve the ${packageName} package root for the fixture runtime.`);
53
- }
54
- mkdirSync(dirname(packageDir), { recursive: true });
55
- rmSync(packageDir, { recursive: true, force: true });
56
- symlinkSync(resolvedPackageRoot, packageDir, 'dir');
57
- }
58
- ensureFixtureWorkspacePackage('@treeseed/sdk', resolve(packageRoot, '..', 'sdk'));
59
- ensureFixtureWorkspacePackage('@treeseed/core', packageRoot);
11
+ prepareFixturePackages({
12
+ fixtureRoot,
13
+ packageRoot,
14
+ declarations: [
15
+ {
16
+ packageName: '@treeseed/sdk',
17
+ workspaceDirName: 'sdk',
18
+ modes: ['workspace-link', 'installed-link'],
19
+ },
20
+ {
21
+ packageName: '@treeseed/agent',
22
+ workspaceDirName: 'agent',
23
+ entrySpecifier: '@treeseed/agent/runtime-types',
24
+ contractsShim: 'agent-contracts',
25
+ modes: ['workspace-link', 'installed-link', 'contracts-only'],
26
+ },
27
+ {
28
+ packageName: '@treeseed/core',
29
+ workspaceDirName: 'core',
30
+ modes: ['workspace-link', 'installed-link'],
31
+ },
32
+ ],
33
+ });
60
34
  const result = spawnSync('npx', ['astro', command, '--root', fixtureRoot, ...rest], {
61
35
  cwd: packageRoot,
62
36
  stdio: 'inherit',
@@ -114,6 +114,54 @@ function mirrorDependencies(tempRoot, excludedPackages = new Set()) {
114
114
  packageRoot,
115
115
  ...resolveWorkspaceRuntimePackageRoots().values(),
116
116
  ];
117
+ const sharedNodeModules = (() => {
118
+ let lastCandidate = null;
119
+ let current = packageRoot;
120
+ while (true) {
121
+ const candidate = resolve(current, 'node_modules');
122
+ if (existsSync(candidate)) {
123
+ lastCandidate = candidate;
124
+ }
125
+ const parent = dirname(current);
126
+ if (parent === current) {
127
+ if (lastCandidate) {
128
+ return lastCandidate;
129
+ }
130
+ throw new Error(`Unable to locate shared node_modules from ${packageRoot}.`);
131
+ }
132
+ current = parent;
133
+ }
134
+ })();
135
+ for (const entry of readdirSync(sharedNodeModules, { withFileTypes: true })) {
136
+ if (entry.name === '.bin' || entry.name === '@treeseed') {
137
+ continue;
138
+ }
139
+ const sourcePath = resolve(sharedNodeModules, entry.name);
140
+ if (entry.name.startsWith('@')) {
141
+ for (const scopedEntry of readdirSync(sourcePath, { withFileTypes: true })) {
142
+ const packageName = `${entry.name}/${scopedEntry.name}`;
143
+ if (excludedPackages.has(packageName)) {
144
+ continue;
145
+ }
146
+ const targetPath = resolve(tempRoot, 'node_modules', entry.name, scopedEntry.name);
147
+ if (existsSync(targetPath)) {
148
+ continue;
149
+ }
150
+ mkdirSync(dirname(targetPath), { recursive: true });
151
+ symlinkSync(resolve(sourcePath, scopedEntry.name), targetPath, scopedEntry.isDirectory() ? 'dir' : 'file');
152
+ }
153
+ continue;
154
+ }
155
+ if (excludedPackages.has(entry.name)) {
156
+ continue;
157
+ }
158
+ const targetPath = resolve(tempRoot, 'node_modules', entry.name);
159
+ if (existsSync(targetPath)) {
160
+ continue;
161
+ }
162
+ mkdirSync(dirname(targetPath), { recursive: true });
163
+ symlinkSync(sourcePath, targetPath, entry.isDirectory() ? 'dir' : 'file');
164
+ }
117
165
  for (const packageName of runtimeDependencies) {
118
166
  if (excludedPackages.has(packageName) || packageName === '@treeseed/core') {
119
167
  continue;
@@ -185,13 +233,8 @@ try {
185
233
  '-e',
186
234
  [
187
235
  'await import("@treeseed/core");',
188
- 'await import("@treeseed/core/agent/cli");',
189
- 'await import("@treeseed/core/runtime-types");',
190
- 'await import("@treeseed/core/contracts/messages");',
191
- 'await import("@treeseed/core/contracts/run");',
192
- 'await import("@treeseed/core/services/worker");',
193
- 'await import("@treeseed/core/services/workday-start");',
194
- 'await import("@treeseed/core/services/workday-report");',
236
+ 'await import("@treeseed/core/site");',
237
+ 'await import("@treeseed/core/config");',
195
238
  ].join(' '),
196
239
  ], installRoot);
197
240
  console.log('Core packed-install smoke passed.');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@treeseed/core",
3
- "version": "0.8.3",
4
- "description": "Treeseed integrated platform starter for Astro/Starlight web runtimes and Hono API runtimes.",
3
+ "version": "0.8.5",
4
+ "description": "Treeseed web framework package for Astro/Starlight site runtimes.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
7
7
  "type": "git",
@@ -30,7 +30,6 @@
30
30
  "access": "public"
31
31
  },
32
32
  "bin": {
33
- "treeseed-agents": "./dist/agents/cli.js",
34
33
  "treeseed-workspace-bootstrap": "./dist/scripts/workspace-bootstrap.js"
35
34
  },
36
35
  "scripts": {
@@ -41,15 +40,6 @@
41
40
  "prepack": "npm run build:dist",
42
41
  "dev": "node ./scripts/run-ts.mjs ./scripts/dev-platform.ts",
43
42
  "dev:web": "node ./scripts/run-ts.mjs ./scripts/dev-platform.ts --surface web",
44
- "dev:api": "node ./scripts/run-ts.mjs ./scripts/dev-platform.ts --surface api",
45
- "dev:workday-manager": "node ./scripts/run-ts.mjs ./src/services/workday-manager.ts",
46
- "dev:worker-runner": "node ./scripts/run-ts.mjs ./src/services/worker.ts",
47
- "dev:manager": "npm run dev:workday-manager",
48
- "dev:worker": "npm run dev:worker-runner",
49
- "dev:agents": "node ./scripts/run-ts.mjs ./src/services/agents.ts",
50
- "dev:remote-runner": "node ./scripts/run-ts.mjs ./src/services/remote-runner.ts",
51
- "dev:workday-start": "npm run dev:workday-manager",
52
- "dev:workday-report": "npm run dev:workday-manager",
53
43
  "dev:watch": "node ./scripts/run-ts.mjs ./scripts/dev-platform.ts --watch",
54
44
  "starlight:patch": "node ./scripts/run-ts.mjs ./scripts/patch-starlight-content-path.ts",
55
45
  "precheck": "npm run starlight:patch",
@@ -75,13 +65,14 @@
75
65
  "dependencies": {
76
66
  "@astrojs/check": "^0.9.8",
77
67
  "@astrojs/cloudflare": "^12.6.13",
68
+ "@astrojs/markdown-remark": "^6.3.11",
69
+ "@astrojs/mdx": "^4.3.14",
78
70
  "@astrojs/sitemap": "3.7.0",
79
71
  "@astrojs/starlight": "0.37.6",
80
72
  "@tailwindcss/vite": "^4.1.4",
81
- "@treeseed/sdk": "0.8.3",
73
+ "@treeseed/sdk": "0.8.5",
82
74
  "astro": "^5.6.1",
83
75
  "esbuild": "^0.28.0",
84
- "hono": "^4.8.2",
85
76
  "katex": "^0.16.22",
86
77
  "nodemailer": "^8.0.4",
87
78
  "rehype-katex": "^7.0.1",
@@ -114,34 +105,6 @@
114
105
  "types": "./dist/config.d.ts",
115
106
  "default": "./dist/config.js"
116
107
  },
117
- "./api": {
118
- "types": "./dist/api.d.ts",
119
- "default": "./dist/api.js"
120
- },
121
- "./agent": {
122
- "types": "./dist/agent.d.ts",
123
- "default": "./dist/agent.js"
124
- },
125
- "./agent/cli": {
126
- "types": "./dist/agents/cli.d.ts",
127
- "default": "./dist/agents/cli.js"
128
- },
129
- "./runtime-types": {
130
- "types": "./dist/agents/runtime-types.d.ts",
131
- "default": "./dist/agents/runtime-types.js"
132
- },
133
- "./contracts/messages": {
134
- "types": "./dist/agents/contracts/messages.d.ts",
135
- "default": "./dist/agents/contracts/messages.js"
136
- },
137
- "./contracts/run": {
138
- "types": "./dist/agents/contracts/run.d.ts",
139
- "default": "./dist/agents/contracts/run.js"
140
- },
141
- "./railway": {
142
- "types": "./dist/railway.d.ts",
143
- "default": "./dist/railway.js"
144
- },
145
108
  "./platform": {
146
109
  "types": "./dist/platform.d.ts",
147
110
  "default": "./dist/platform.js"
@@ -173,42 +136,6 @@
173
136
  "./tenant": "./dist/tenant/bridge.js",
174
137
  "./scripts/dev-platform": "./dist/scripts/dev-platform.js",
175
138
  "./scripts/workspace-bootstrap": "./dist/scripts/workspace-bootstrap.js",
176
- "./services/worker": {
177
- "types": "./dist/services/worker.d.ts",
178
- "default": "./dist/services/worker.js"
179
- },
180
- "./services/manager": {
181
- "types": "./dist/services/manager.d.ts",
182
- "default": "./dist/services/manager.js"
183
- },
184
- "./services/agents": {
185
- "types": "./dist/services/agents.d.ts",
186
- "default": "./dist/services/agents.js"
187
- },
188
- "./services/remote-runner": {
189
- "types": "./dist/services/remote-runner.d.ts",
190
- "default": "./dist/services/remote-runner.js"
191
- },
192
- "./services/workday-manager": {
193
- "types": "./dist/services/workday-manager.d.ts",
194
- "default": "./dist/services/workday-manager.js"
195
- },
196
- "./services/workday-start": {
197
- "types": "./dist/services/workday-start.d.ts",
198
- "default": "./dist/services/workday-start.js"
199
- },
200
- "./services/workday-report": {
201
- "types": "./dist/services/workday-report.d.ts",
202
- "default": "./dist/services/workday-report.js"
203
- },
204
- "./api/app": {
205
- "types": "./dist/api/app.d.ts",
206
- "default": "./dist/api/app.js"
207
- },
208
- "./api/auth/d1-provider": {
209
- "types": "./dist/api/auth/d1-provider.d.ts",
210
- "default": "./dist/api/auth/d1-provider.js"
211
- },
212
139
  "./launch": {
213
140
  "types": "./dist/launch.d.ts",
214
141
  "default": "./dist/launch.js"
@@ -0,0 +1,111 @@
1
+ name: Treeseed Web Deploy
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ environment:
7
+ required: true
8
+ type: string
9
+ action_kind:
10
+ required: true
11
+ type: string
12
+ project_id:
13
+ required: false
14
+ type: string
15
+ preview_id:
16
+ required: false
17
+ type: string
18
+ workflow_dispatch:
19
+ inputs:
20
+ environment:
21
+ required: true
22
+ default: staging
23
+ type: choice
24
+ options:
25
+ - staging
26
+ - prod
27
+ action_kind:
28
+ required: true
29
+ default: deploy_web
30
+ type: choice
31
+ options:
32
+ - deploy_web
33
+ - publish_content
34
+ - monitor
35
+ project_id:
36
+ required: false
37
+ type: string
38
+ preview_id:
39
+ required: false
40
+ type: string
41
+
42
+ jobs:
43
+ __WORKING_DIRECTORY_BLOCK__ web:
44
+ runs-on: ubuntu-latest
45
+ permissions:
46
+ contents: read
47
+ environment: ${{ inputs.environment == 'prod' && 'production' || 'staging' }}
48
+ env:
49
+ TREESEED_BOOTSTRAP_MODE: auto
50
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
51
+ CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
52
+ TREESEED_CLOUDFLARE_PAGES_PROJECT_NAME: ${{ vars.TREESEED_CLOUDFLARE_PAGES_PROJECT_NAME }}
53
+ TREESEED_CLOUDFLARE_PAGES_PREVIEW_PROJECT_NAME: ${{ vars.TREESEED_CLOUDFLARE_PAGES_PREVIEW_PROJECT_NAME }}
54
+ TREESEED_CONTENT_BUCKET_NAME: ${{ vars.TREESEED_CONTENT_BUCKET_NAME }}
55
+ TREESEED_CONTENT_BUCKET_BINDING: ${{ vars.TREESEED_CONTENT_BUCKET_BINDING }}
56
+ TREESEED_FORM_TOKEN_SECRET: ${{ secrets.TREESEED_FORM_TOKEN_SECRET }}
57
+ TREESEED_EDITORIAL_PREVIEW_SECRET: ${{ secrets.TREESEED_EDITORIAL_PREVIEW_SECRET }}
58
+ TREESEED_PUBLIC_TURNSTILE_SITE_KEY: ${{ vars.TREESEED_PUBLIC_TURNSTILE_SITE_KEY }}
59
+ TREESEED_TURNSTILE_SECRET_KEY: ${{ secrets.TREESEED_TURNSTILE_SECRET_KEY }}
60
+ TREESEED_SMTP_HOST: ${{ vars.TREESEED_SMTP_HOST }}
61
+ TREESEED_SMTP_PORT: ${{ vars.TREESEED_SMTP_PORT }}
62
+ TREESEED_SMTP_USERNAME: ${{ vars.TREESEED_SMTP_USERNAME }}
63
+ TREESEED_SMTP_PASSWORD: ${{ secrets.TREESEED_SMTP_PASSWORD }}
64
+ TREESEED_SMTP_FROM: ${{ vars.TREESEED_SMTP_FROM }}
65
+ TREESEED_SMTP_REPLY_TO: ${{ vars.TREESEED_SMTP_REPLY_TO }}
66
+ TREESEED_PROJECT_DOMAINS: ${{ vars.TREESEED_PROJECT_DOMAINS }}
67
+ TREESEED_CENTRAL_MARKET_API_BASE_URL: ${{ vars.TREESEED_CENTRAL_MARKET_API_BASE_URL || 'https://api.treeseed.ai' }}
68
+ TREESEED_MARKET_API_BASE_URL: ${{ vars.TREESEED_MARKET_API_BASE_URL || vars.TREESEED_CENTRAL_MARKET_API_BASE_URL || 'https://api.treeseed.ai' }}
69
+ TREESEED_CATALOG_MARKET_API_BASE_URLS: ${{ vars.TREESEED_CATALOG_MARKET_API_BASE_URLS || vars.TREESEED_MARKET_API_BASE_URL || vars.TREESEED_CENTRAL_MARKET_API_BASE_URL || 'https://api.treeseed.ai' }}
70
+ TREESEED_HOSTING_KIND: ${{ vars.TREESEED_HOSTING_KIND }}
71
+ TREESEED_HOSTING_REGISTRATION: ${{ vars.TREESEED_HOSTING_REGISTRATION }}
72
+ TREESEED_HOSTING_TEAM_ID: ${{ vars.TREESEED_HOSTING_TEAM_ID }}
73
+ TREESEED_PROJECT_ID: ${{ inputs.project_id || vars.TREESEED_PROJECT_ID }}
74
+ TREESEED_WORKFLOW_ACTION: ${{ inputs.action_kind }}
75
+ TREESEED_WORKFLOW_ENVIRONMENT: ${{ inputs.environment }}
76
+ TREESEED_WORKFLOW_PROJECT: ${{ inputs.project_id || vars.TREESEED_PROJECT_ID }}
77
+ TREESEED_WORKFLOW_PREVIEW_ID: ${{ inputs.preview_id }}
78
+ steps:
79
+ - uses: actions/checkout@v4
80
+ with:
81
+ submodules: recursive
82
+
83
+ - uses: actions/setup-node@v4
84
+ with:
85
+ node-version: 22
86
+ cache: npm
87
+ cache-dependency-path: __CACHE_DEPENDENCY_PATH__
88
+
89
+ - name: Install dependencies
90
+ shell: bash
91
+ run: |
92
+ set -euo pipefail
93
+ node -e "const fs = require('fs'); for (const file of ['packages/sdk/package.json', 'packages/agent/package.json', 'packages/core/package.json', 'packages/cli/package.json']) { if (!fs.existsSync(file)) continue; const p = JSON.parse(fs.readFileSync(file, 'utf8')); if (p.scripts) delete p.scripts.prepare; fs.writeFileSync(file, JSON.stringify(p, null, '\t') + '\n'); }"
94
+ npm ci --ignore-scripts
95
+
96
+ - name: Build package artifacts
97
+ shell: bash
98
+ run: |
99
+ set -euo pipefail
100
+ for dir in packages/sdk packages/core packages/cli; do
101
+ if test -f "${dir}/package.json"; then npm --prefix "${dir}" run build:dist; fi
102
+ done
103
+
104
+ - name: Run web workflow action
105
+ shell: bash
106
+ run: |
107
+ set -euo pipefail
108
+ EXTRA_ARGS=()
109
+ if [[ -n "${TREESEED_WORKFLOW_PROJECT:-}" ]]; then EXTRA_ARGS+=(--project-id "${TREESEED_WORKFLOW_PROJECT}"); fi
110
+ if [[ -n "${TREESEED_WORKFLOW_PREVIEW_ID:-}" ]]; then EXTRA_ARGS+=(--preview-id "${TREESEED_WORKFLOW_PREVIEW_ID}"); fi
111
+ node ./packages/sdk/scripts/run-ts.mjs ./packages/sdk/scripts/tenant-workflow-action.ts --action "${TREESEED_WORKFLOW_ACTION}" --environment "${TREESEED_WORKFLOW_ENVIRONMENT}" "${EXTRA_ARGS[@]}"
@@ -14,7 +14,7 @@ on:
14
14
  workflow_file:
15
15
  description: Workflow file to dispatch in the tenant repository
16
16
  required: false
17
- default: deploy.yml
17
+ default: deploy-web.yml
18
18
  type: string
19
19
  project_id:
20
20
  description: Treeseed project id recorded in the market control plane
@@ -31,11 +31,11 @@ on:
31
31
  action_kind:
32
32
  description: Requested orchestration action
33
33
  required: true
34
- default: deploy_code
34
+ default: deploy_web
35
35
  type: choice
36
36
  options:
37
- - provision
38
- - deploy_code
37
+ - deploy_web
38
+ - deploy_processing
39
39
  - publish_content
40
40
  - monitor
41
41
 
@@ -1,17 +0,0 @@
1
- import type { AgentExecutionAdapter, AgentHandler, AgentMutationAdapter, AgentNotificationAdapter, AgentRepositoryInspectionAdapter, AgentResearchAdapter, AgentVerificationAdapter } from './agents/runtime-types.ts';
2
- export declare function resolveAgentRuntimeProviders(repoRoot: string, selections: {
3
- execution: string;
4
- mutation: string;
5
- repository: string;
6
- verification: string;
7
- notification: string;
8
- research: string;
9
- }): {
10
- execution: AgentExecutionAdapter;
11
- mutations: AgentMutationAdapter;
12
- repository: AgentRepositoryInspectionAdapter;
13
- verification: AgentVerificationAdapter;
14
- notifications: AgentNotificationAdapter;
15
- research: AgentResearchAdapter;
16
- handlers: Map<string, AgentHandler<unknown, unknown>>;
17
- };
@@ -1,117 +0,0 @@
1
- import { loadTreeseedPluginRuntime } from "@treeseed/sdk/platform/plugins";
2
- import {
3
- CopilotExecutionAdapter,
4
- ManualExecutionAdapter,
5
- StubExecutionAdapter
6
- } from "./agents/adapters/execution.js";
7
- import { LocalBranchMutationAdapter } from "./agents/adapters/mutations.js";
8
- import { SdkMessageNotificationAdapter, StubNotificationAdapter } from "./agents/adapters/notification.js";
9
- import { GitRepositoryInspectionAdapter, StubRepositoryInspectionAdapter } from "./agents/adapters/repository.js";
10
- import { ProjectGraphResearchAdapter, StubResearchAdapter } from "./agents/adapters/research.js";
11
- import { LocalVerificationAdapter, StubVerificationAdapter } from "./agents/adapters/verification.js";
12
- let cachedAgentRuntime = null;
13
- function readPluginRecord(pluginEntry, key) {
14
- const value = pluginEntry.plugin[key];
15
- return value && typeof value === "object" && !Array.isArray(value) ? value : {};
16
- }
17
- function assertUniqueProvider(registry, id, owner) {
18
- if (registry.has(id)) {
19
- throw new Error(`Treeseed plugin runtime found duplicate provider "${id}" from ${owner}.`);
20
- }
21
- }
22
- function collectAgentHandlersFromPlugin(pluginEntry, registry) {
23
- const contributedHandlers = readPluginRecord(pluginEntry, "agentHandlers");
24
- for (const [id, handler] of Object.entries(contributedHandlers)) {
25
- assertUniqueProvider(registry, id, pluginEntry.package);
26
- registry.set(id, handler);
27
- }
28
- }
29
- function buildAgentRuntime() {
30
- const runtime = loadTreeseedPluginRuntime();
31
- const execution = /* @__PURE__ */ new Map([
32
- ["stub", () => new StubExecutionAdapter()],
33
- ["manual", () => new ManualExecutionAdapter()],
34
- ["copilot", () => new CopilotExecutionAdapter()]
35
- ]);
36
- const mutation = /* @__PURE__ */ new Map([
37
- ["local_branch", (repoRoot) => new LocalBranchMutationAdapter(repoRoot)]
38
- ]);
39
- const repository = /* @__PURE__ */ new Map([
40
- ["stub", () => new StubRepositoryInspectionAdapter()],
41
- ["git", () => new GitRepositoryInspectionAdapter()]
42
- ]);
43
- const verification = /* @__PURE__ */ new Map([
44
- ["stub", () => new StubVerificationAdapter()],
45
- ["local", () => new LocalVerificationAdapter()]
46
- ]);
47
- const notification = /* @__PURE__ */ new Map([
48
- ["stub", () => new StubNotificationAdapter()],
49
- ["sdk_message", () => new SdkMessageNotificationAdapter()]
50
- ]);
51
- const research = /* @__PURE__ */ new Map([
52
- ["stub", () => new StubResearchAdapter()],
53
- ["project_graph", () => new ProjectGraphResearchAdapter()]
54
- ]);
55
- const handlers = /* @__PURE__ */ new Map();
56
- for (const pluginEntry of runtime.plugins) {
57
- const agentProviders = readPluginRecord(pluginEntry, "agentProviders");
58
- for (const [id, factory] of Object.entries(agentProviders.execution ?? {})) {
59
- assertUniqueProvider(execution, id, pluginEntry.package);
60
- execution.set(id, factory);
61
- }
62
- for (const [id, factory] of Object.entries(agentProviders.mutation ?? {})) {
63
- assertUniqueProvider(mutation, id, pluginEntry.package);
64
- mutation.set(id, factory);
65
- }
66
- for (const [id, factory] of Object.entries(agentProviders.repository ?? {})) {
67
- assertUniqueProvider(repository, id, pluginEntry.package);
68
- repository.set(id, factory);
69
- }
70
- for (const [id, factory] of Object.entries(agentProviders.verification ?? {})) {
71
- assertUniqueProvider(verification, id, pluginEntry.package);
72
- verification.set(id, factory);
73
- }
74
- for (const [id, factory] of Object.entries(agentProviders.notification ?? {})) {
75
- assertUniqueProvider(notification, id, pluginEntry.package);
76
- notification.set(id, factory);
77
- }
78
- for (const [id, factory] of Object.entries(agentProviders.research ?? {})) {
79
- assertUniqueProvider(research, id, pluginEntry.package);
80
- research.set(id, factory);
81
- }
82
- collectAgentHandlersFromPlugin(pluginEntry, handlers);
83
- }
84
- return {
85
- providers: { execution, mutation, repository, verification, notification, research },
86
- handlers
87
- };
88
- }
89
- function resolveAgentRuntimeProviders(repoRoot, selections) {
90
- if (!cachedAgentRuntime) {
91
- cachedAgentRuntime = buildAgentRuntime();
92
- }
93
- const executionFactory = cachedAgentRuntime.providers.execution.get(selections.execution);
94
- const mutationFactory = cachedAgentRuntime.providers.mutation.get(selections.mutation);
95
- const repositoryFactory = cachedAgentRuntime.providers.repository.get(selections.repository);
96
- const verificationFactory = cachedAgentRuntime.providers.verification.get(selections.verification);
97
- const notificationFactory = cachedAgentRuntime.providers.notification.get(selections.notification);
98
- const researchFactory = cachedAgentRuntime.providers.research.get(selections.research);
99
- if (!executionFactory) throw new Error(`Treeseed agent execution provider "${selections.execution}" is not registered.`);
100
- if (!mutationFactory) throw new Error(`Treeseed agent mutation provider "${selections.mutation}" is not registered.`);
101
- if (!repositoryFactory) throw new Error(`Treeseed agent repository provider "${selections.repository}" is not registered.`);
102
- if (!verificationFactory) throw new Error(`Treeseed agent verification provider "${selections.verification}" is not registered.`);
103
- if (!notificationFactory) throw new Error(`Treeseed agent notification provider "${selections.notification}" is not registered.`);
104
- if (!researchFactory) throw new Error(`Treeseed agent research provider "${selections.research}" is not registered.`);
105
- return {
106
- execution: executionFactory(),
107
- mutations: mutationFactory(repoRoot),
108
- repository: repositoryFactory(),
109
- verification: verificationFactory(),
110
- notifications: notificationFactory(),
111
- research: researchFactory(),
112
- handlers: cachedAgentRuntime.handlers
113
- };
114
- }
115
- export {
116
- resolveAgentRuntimeProviders
117
- };
package/dist/agent.d.ts DELETED
@@ -1,11 +0,0 @@
1
- export { AgentKernel } from './agents/kernel/agent-kernel.ts';
2
- export { listTreeseedAgentCommands, renderTreeseedAgentHelp, runTreeseedAgentCli } from './agents/cli.ts';
3
- export { resolveAgentHandler, listRegisteredAgentHandlers } from './agents/registry.ts';
4
- export { resolveAgentRuntimeProviders } from './agent-runtime.ts';
5
- export { runWorkerCycle, startWorkerLoop } from './services/worker.ts';
6
- export { runScheduledWorkdayManager } from './services/workday-manager.ts';
7
- export { runWorkdayStart } from './services/workday-start.ts';
8
- export { runWorkdayReport } from './services/workday-report.ts';
9
- export { parseAgentMessagePayload, AGENT_MESSAGE_TYPES } from './agents/contracts/messages.ts';
10
- export type * from './agents/runtime-types.ts';
11
- export type * from './agents/contracts/run.ts';
package/dist/agent.js DELETED
@@ -1,25 +0,0 @@
1
- import { AgentKernel } from "./agents/kernel/agent-kernel.js";
2
- import { listTreeseedAgentCommands, renderTreeseedAgentHelp, runTreeseedAgentCli } from "./agents/cli.js";
3
- import { resolveAgentHandler, listRegisteredAgentHandlers } from "./agents/registry.js";
4
- import { resolveAgentRuntimeProviders } from "./agent-runtime.js";
5
- import { runWorkerCycle, startWorkerLoop } from "./services/worker.js";
6
- import { runScheduledWorkdayManager } from "./services/workday-manager.js";
7
- import { runWorkdayStart } from "./services/workday-start.js";
8
- import { runWorkdayReport } from "./services/workday-report.js";
9
- import { parseAgentMessagePayload, AGENT_MESSAGE_TYPES } from "./agents/contracts/messages.js";
10
- export {
11
- AGENT_MESSAGE_TYPES,
12
- AgentKernel,
13
- listRegisteredAgentHandlers,
14
- listTreeseedAgentCommands,
15
- parseAgentMessagePayload,
16
- renderTreeseedAgentHelp,
17
- resolveAgentHandler,
18
- resolveAgentRuntimeProviders,
19
- runScheduledWorkdayManager,
20
- runTreeseedAgentCli,
21
- runWorkdayReport,
22
- runWorkdayStart,
23
- runWorkerCycle,
24
- startWorkerLoop
25
- };
@@ -1,41 +0,0 @@
1
- import type { AgentExecutionAdapter } from '../runtime-types.ts';
2
- export declare class StubExecutionAdapter implements AgentExecutionAdapter {
3
- runTask(input: {
4
- prompt: string;
5
- runId: string;
6
- }): Promise<{
7
- status: "completed";
8
- summary: string;
9
- stdout: string;
10
- stderr: string;
11
- }>;
12
- }
13
- export declare class CopilotExecutionAdapter implements AgentExecutionAdapter {
14
- runTask(input: {
15
- agent: {
16
- cli?: {
17
- model?: string;
18
- allowTools?: string[];
19
- additionalArgs?: string[];
20
- };
21
- };
22
- prompt: string;
23
- }): Promise<{
24
- stderr: string;
25
- status: "completed" | "failed";
26
- summary: string;
27
- stdout: string;
28
- }>;
29
- }
30
- export declare class ManualExecutionAdapter implements AgentExecutionAdapter {
31
- runTask(input: {
32
- prompt: string;
33
- runId: string;
34
- }): Promise<{
35
- status: "completed";
36
- summary: string;
37
- stdout: string;
38
- stderr: string;
39
- }>;
40
- }
41
- export declare function createExecutionAdapter(): StubExecutionAdapter | CopilotExecutionAdapter | ManualExecutionAdapter;