@treeseed/core 0.4.10 → 0.4.11
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.
- package/dist/api/auth/rbac.d.ts +2 -2
- package/dist/api/auth/rbac.js +2 -1
- package/dist/components/site/RouteNotFound.astro +25 -0
- package/dist/content-config.d.ts +1 -0
- package/dist/content.d.ts +1 -0
- package/dist/content.js +177 -1
- package/dist/dev.d.ts +7 -2
- package/dist/dev.js +59 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -1
- package/dist/middleware/editorial-preview.d.ts +26 -0
- package/dist/middleware/editorial-preview.js +37 -0
- package/dist/middleware/starlightRouteData.js +15 -4
- package/dist/pages/[slug].astro +12 -10
- package/dist/pages/agents/[slug].astro +28 -21
- package/dist/pages/books/[slug].astro +19 -12
- package/dist/pages/feed.xml.js +6 -4
- package/dist/pages/index.astro +43 -14
- package/dist/pages/notes/[slug].astro +19 -12
- package/dist/pages/objectives/[slug].astro +30 -23
- package/dist/pages/people/[slug].astro +28 -21
- package/dist/pages/questions/[slug].astro +30 -23
- package/dist/scripts/build-dist.js +6 -1
- package/dist/scripts/dev-platform.js +9 -1
- package/dist/services/agents.d.ts +22 -0
- package/dist/services/agents.js +29 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/index.js +11 -0
- package/dist/services/manager.d.ts +247 -0
- package/dist/services/manager.js +1129 -0
- package/dist/services/remote-runner.d.ts +7 -0
- package/dist/services/remote-runner.js +6 -0
- package/dist/services/workday-content.d.ts +53 -0
- package/dist/services/workday-content.js +190 -0
- package/dist/services/workday-report.d.ts +160 -2
- package/dist/services/workday-report.js +3 -26
- package/dist/services/workday-start.d.ts +170 -1
- package/dist/services/workday-start.js +3 -7
- package/dist/services/worker-pool-scaler.d.ts +27 -0
- package/dist/services/worker-pool-scaler.js +109 -0
- package/dist/services/worker.d.ts +7 -0
- package/dist/services/worker.js +3 -0
- package/dist/site.js +43 -27
- package/dist/templates.d.ts +98 -0
- package/dist/templates.js +170 -0
- package/dist/tenant/runtime-config.d.ts +4 -0
- package/dist/tenant/runtime-config.js +34 -1
- package/dist/utils/hub-content.js +35 -0
- package/dist/utils/published-content.js +60 -0
- package/dist/utils/site-models.d.ts +6 -0
- package/dist/utils/site-models.js +16 -0
- package/dist/utils/starlight-nav.js +50 -0
- package/package.json +20 -2
- package/templates/github/deploy.workflow.yml +404 -9
- package/templates/github/hosted-project.workflow.yml +77 -0
package/dist/pages/feed.xml.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getPublishedNotes } from "../utils/hub-content.js";
|
|
2
|
+
import { siteModelRendered } from "../utils/site-models.js";
|
|
2
3
|
async function GET(context) {
|
|
3
|
-
|
|
4
|
-
(
|
|
5
|
-
|
|
4
|
+
if (!siteModelRendered("notes")) {
|
|
5
|
+
return new Response("Not found", { status: 404 });
|
|
6
|
+
}
|
|
7
|
+
const notes = await getPublishedNotes();
|
|
6
8
|
const origin = context.site?.origin ?? "https://treeseed.dev";
|
|
7
9
|
const items = notes.map(
|
|
8
10
|
(note) => `
|
package/dist/pages/index.astro
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { getCollection } from 'astro:content';
|
|
3
2
|
import MainLayout from '../layouts/MainLayout.astro';
|
|
4
3
|
import Hero from '../components/site/Hero.astro';
|
|
5
4
|
import StageBanner from '../components/site/StageBanner.astro';
|
|
@@ -11,18 +10,36 @@ import NotesList from '../components/site/NotesList.astro';
|
|
|
11
10
|
import ChronicleList from '../components/site/ChronicleList.astro';
|
|
12
11
|
import ProfileList from '../components/site/ProfileList.astro';
|
|
13
12
|
import BookList from '../components/site/BookList.astro';
|
|
14
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
getPublishedAgents,
|
|
15
|
+
getPublishedBooks,
|
|
16
|
+
getPublishedNotes,
|
|
17
|
+
getPublishedObjectives,
|
|
18
|
+
getPublishedPeople,
|
|
19
|
+
getPublishedQuestions,
|
|
20
|
+
resolveContributorsForEntries,
|
|
21
|
+
} from '../utils/hub-content';
|
|
22
|
+
import { siteModelRendered } from '../utils/site-models.js';
|
|
15
23
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
const
|
|
24
|
+
const notesRendered = siteModelRendered('notes');
|
|
25
|
+
const questionsRendered = siteModelRendered('questions');
|
|
26
|
+
const objectivesRendered = siteModelRendered('objectives');
|
|
27
|
+
const peopleRendered = siteModelRendered('people');
|
|
28
|
+
const agentsRendered = siteModelRendered('agents');
|
|
29
|
+
const booksRendered = siteModelRendered('books');
|
|
30
|
+
|
|
31
|
+
const notes = notesRendered ? (await getPublishedNotes()).slice(0, 3) : [];
|
|
32
|
+
const questions = questionsRendered ? (await getPublishedQuestions()).slice(0, 2) : [];
|
|
33
|
+
const objectives = objectivesRendered ? (await getPublishedObjectives()).slice(0, 2) : [];
|
|
21
34
|
const questionContributors = await resolveContributorsForEntries(questions);
|
|
22
35
|
const objectiveContributors = await resolveContributorsForEntries(objectives);
|
|
23
|
-
const people = (await
|
|
24
|
-
const agents = (await
|
|
25
|
-
const books =
|
|
36
|
+
const people = peopleRendered ? (await getPublishedPeople()).slice(0, 2) : [];
|
|
37
|
+
const agents = agentsRendered ? (await getPublishedAgents()).slice(0, 2) : [];
|
|
38
|
+
const books = booksRendered ? await getPublishedBooks() : [];
|
|
39
|
+
const ctaPrimaryHref = questionsRendered ? '/questions/' : objectivesRendered ? '/objectives/' : '/status/';
|
|
40
|
+
const ctaPrimaryLabel = questionsRendered ? 'Browse questions' : objectivesRendered ? 'Browse objectives' : 'View status';
|
|
41
|
+
const ctaSecondaryHref = booksRendered ? '/books/' : notesRendered ? '/notes/' : '/vision/';
|
|
42
|
+
const ctaSecondaryLabel = booksRendered ? 'Explore books' : notesRendered ? 'Read notes' : 'Read vision';
|
|
26
43
|
---
|
|
27
44
|
|
|
28
45
|
<MainLayout
|
|
@@ -178,6 +195,7 @@ const books = (await getCollection('books')).sort((a, b) => a.data.order - b.dat
|
|
|
178
195
|
</div>
|
|
179
196
|
</section>
|
|
180
197
|
|
|
198
|
+
{notesRendered && (
|
|
181
199
|
<section class="space-y-6 border-t border-[color:var(--site-border)] pt-10">
|
|
182
200
|
<SectionIntro
|
|
183
201
|
eyebrow="Notes"
|
|
@@ -186,7 +204,9 @@ const books = (await getCollection('books')).sort((a, b) => a.data.order - b.dat
|
|
|
186
204
|
/>
|
|
187
205
|
<NotesList notes={notes} />
|
|
188
206
|
</section>
|
|
207
|
+
)}
|
|
189
208
|
|
|
209
|
+
{(questionsRendered || objectivesRendered || peopleRendered || agentsRendered || booksRendered) && (
|
|
190
210
|
<section class="space-y-8 border-t border-[color:var(--site-border)] pt-10">
|
|
191
211
|
<SectionIntro
|
|
192
212
|
eyebrow="TreeSeed"
|
|
@@ -194,6 +214,7 @@ const books = (await getCollection('books')).sort((a, b) => a.data.order - b.dat
|
|
|
194
214
|
description="The fixture shows how humans and agents can publish questions, anchor them to objectives, and connect that work to books and contributor profiles."
|
|
195
215
|
/>
|
|
196
216
|
<div class="grid gap-10 lg:grid-cols-2">
|
|
217
|
+
{questionsRendered && (
|
|
197
218
|
<div class="space-y-6">
|
|
198
219
|
<SectionIntro
|
|
199
220
|
eyebrow="Questions"
|
|
@@ -212,6 +233,8 @@ const books = (await getCollection('books')).sort((a, b) => a.data.order - b.dat
|
|
|
212
233
|
}))}
|
|
213
234
|
/>
|
|
214
235
|
</div>
|
|
236
|
+
)}
|
|
237
|
+
{objectivesRendered && (
|
|
215
238
|
<div class="space-y-6">
|
|
216
239
|
<SectionIntro
|
|
217
240
|
eyebrow="Objectives"
|
|
@@ -230,8 +253,10 @@ const books = (await getCollection('books')).sort((a, b) => a.data.order - b.dat
|
|
|
230
253
|
}))}
|
|
231
254
|
/>
|
|
232
255
|
</div>
|
|
256
|
+
)}
|
|
233
257
|
</div>
|
|
234
258
|
<div class="grid gap-10 lg:grid-cols-2">
|
|
259
|
+
{(peopleRendered || agentsRendered) && (
|
|
235
260
|
<div class="space-y-6">
|
|
236
261
|
<SectionIntro
|
|
237
262
|
eyebrow="Contributors"
|
|
@@ -258,6 +283,8 @@ const books = (await getCollection('books')).sort((a, b) => a.data.order - b.dat
|
|
|
258
283
|
]}
|
|
259
284
|
/>
|
|
260
285
|
</div>
|
|
286
|
+
)}
|
|
287
|
+
{booksRendered && (
|
|
261
288
|
<div class="space-y-6">
|
|
262
289
|
<SectionIntro
|
|
263
290
|
eyebrow="Books"
|
|
@@ -275,16 +302,18 @@ const books = (await getCollection('books')).sort((a, b) => a.data.order - b.dat
|
|
|
275
302
|
}))}
|
|
276
303
|
/>
|
|
277
304
|
</div>
|
|
305
|
+
)}
|
|
278
306
|
</div>
|
|
279
307
|
</section>
|
|
308
|
+
)}
|
|
280
309
|
|
|
281
310
|
<CTASection
|
|
282
311
|
title="Follow the Treeseed from question to objective to book"
|
|
283
312
|
body="If you are new here, start with current questions and objectives, then use the books and contributor pages to understand how TreeSeed organizes work across the platform."
|
|
284
|
-
primaryHref=
|
|
285
|
-
primaryLabel=
|
|
286
|
-
secondaryHref=
|
|
287
|
-
secondaryLabel=
|
|
313
|
+
primaryHref={ctaPrimaryHref}
|
|
314
|
+
primaryLabel={ctaPrimaryLabel}
|
|
315
|
+
secondaryHref={ctaSecondaryHref}
|
|
316
|
+
secondaryLabel={ctaSecondaryLabel}
|
|
288
317
|
/>
|
|
289
318
|
</div>
|
|
290
319
|
</MainLayout>
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { getCollection, render } from 'astro:content';
|
|
3
3
|
import NoteLayout from '../../layouts/NoteLayout.astro';
|
|
4
|
+
import RouteNotFound from '../../components/site/RouteNotFound.astro';
|
|
4
5
|
|
|
5
|
-
export
|
|
6
|
-
const notes = await getCollection('notes', ({ data }) => !data.draft);
|
|
7
|
-
return notes.map((note) => ({
|
|
8
|
-
params: { slug: note.id },
|
|
9
|
-
props: { note },
|
|
10
|
-
}));
|
|
11
|
-
}
|
|
6
|
+
export const prerender = false;
|
|
12
7
|
|
|
13
|
-
const
|
|
14
|
-
const
|
|
8
|
+
const slug = String(Astro.params.slug ?? '');
|
|
9
|
+
const notes = await getCollection('notes', ({ data }) => !data.draft);
|
|
10
|
+
const note = notes.find((candidate) => candidate.id === slug) ?? null;
|
|
11
|
+
if (!note) {
|
|
12
|
+
Astro.response.status = 404;
|
|
13
|
+
}
|
|
14
|
+
const rendered = note ? await render(note) : null;
|
|
15
|
+
const Content = rendered?.Content ?? null;
|
|
15
16
|
---
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
{
|
|
19
|
+
!note || !Content ? (
|
|
20
|
+
<RouteNotFound title="Note not found" description="The requested note could not be found in this Treeseed." currentPath="/notes/" />
|
|
21
|
+
) : (
|
|
22
|
+
<NoteLayout note={note.data}>
|
|
23
|
+
<Content />
|
|
24
|
+
</NoteLayout>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
@@ -2,30 +2,37 @@
|
|
|
2
2
|
import { getCollection, render } from 'astro:content';
|
|
3
3
|
import AuthoredEntryLayout from '../../layouts/AuthoredEntryLayout.astro';
|
|
4
4
|
import { resolveContributor, resolveReferences } from '../../utils/hub-content';
|
|
5
|
+
import RouteNotFound from '../../components/site/RouteNotFound.astro';
|
|
5
6
|
|
|
6
|
-
export
|
|
7
|
-
const objectives = await getCollection('objectives', ({ data }) => !data.draft);
|
|
8
|
-
return objectives.map((objective) => ({
|
|
9
|
-
params: { slug: objective.id },
|
|
10
|
-
props: { objective },
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
7
|
+
export const prerender = false;
|
|
13
8
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
const slug = String(Astro.params.slug ?? '');
|
|
10
|
+
const objectives = await getCollection('objectives', ({ data }) => !data.draft);
|
|
11
|
+
const objective = objectives.find((candidate) => candidate.id === slug) ?? null;
|
|
12
|
+
if (!objective) {
|
|
13
|
+
Astro.response.status = 404;
|
|
14
|
+
}
|
|
15
|
+
const rendered = objective ? await render(objective) : null;
|
|
16
|
+
const Content = rendered?.Content ?? null;
|
|
17
|
+
const contributor = objective ? await resolveContributor(objective.data.primaryContributor) : null;
|
|
18
|
+
const relatedQuestions = objective ? await resolveReferences(objective.data.relatedQuestions) : [];
|
|
19
|
+
const relatedBooks = objective ? await resolveReferences(objective.data.relatedBooks) : [];
|
|
19
20
|
---
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
{
|
|
23
|
+
!objective || !Content ? (
|
|
24
|
+
<RouteNotFound title="Objective not found" description="The requested objective could not be found in this Treeseed." currentPath="/objectives/" />
|
|
25
|
+
) : (
|
|
26
|
+
<AuthoredEntryLayout
|
|
27
|
+
entry={objective.data}
|
|
28
|
+
currentPath="/objectives/"
|
|
29
|
+
contributor={contributor}
|
|
30
|
+
metaLabel="Time horizon"
|
|
31
|
+
metaValue={objective.data.timeHorizon}
|
|
32
|
+
relatedQuestions={relatedQuestions}
|
|
33
|
+
relatedBooks={relatedBooks}
|
|
34
|
+
>
|
|
35
|
+
<Content />
|
|
36
|
+
</AuthoredEntryLayout>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -2,28 +2,35 @@
|
|
|
2
2
|
import { getCollection, render } from 'astro:content';
|
|
3
3
|
import ProfileLayout from '../../layouts/ProfileLayout.astro';
|
|
4
4
|
import { resolveReferences } from '../../utils/hub-content';
|
|
5
|
+
import RouteNotFound from '../../components/site/RouteNotFound.astro';
|
|
5
6
|
|
|
6
|
-
export
|
|
7
|
-
const people = await getCollection('people');
|
|
8
|
-
return people.map((person) => ({
|
|
9
|
-
params: { slug: person.id },
|
|
10
|
-
props: { person },
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
7
|
+
export const prerender = false;
|
|
13
8
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
9
|
+
const slug = String(Astro.params.slug ?? '');
|
|
10
|
+
const people = await getCollection('people');
|
|
11
|
+
const person = people.find((candidate) => candidate.id === slug) ?? null;
|
|
12
|
+
if (!person) {
|
|
13
|
+
Astro.response.status = 404;
|
|
14
|
+
}
|
|
15
|
+
const rendered = person ? await render(person) : null;
|
|
16
|
+
const Content = rendered?.Content ?? null;
|
|
17
|
+
const relatedQuestions = person ? await resolveReferences(person.data.relatedQuestions) : [];
|
|
18
|
+
const relatedObjectives = person ? await resolveReferences(person.data.relatedObjectives) : [];
|
|
18
19
|
---
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
{
|
|
22
|
+
!person || !Content ? (
|
|
23
|
+
<RouteNotFound title="Profile not found" description="The requested person profile could not be found in this Treeseed." currentPath="/people/" />
|
|
24
|
+
) : (
|
|
25
|
+
<ProfileLayout
|
|
26
|
+
entry={person.data}
|
|
27
|
+
currentPath="/people/"
|
|
28
|
+
metaLabel="Role"
|
|
29
|
+
metaValue={`${person.data.role} · ${person.data.affiliation}`}
|
|
30
|
+
relatedQuestions={relatedQuestions}
|
|
31
|
+
relatedObjectives={relatedObjectives}
|
|
32
|
+
>
|
|
33
|
+
<Content />
|
|
34
|
+
</ProfileLayout>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -2,30 +2,37 @@
|
|
|
2
2
|
import { getCollection, render } from 'astro:content';
|
|
3
3
|
import AuthoredEntryLayout from '../../layouts/AuthoredEntryLayout.astro';
|
|
4
4
|
import { resolveContributor, resolveReferences } from '../../utils/hub-content';
|
|
5
|
+
import RouteNotFound from '../../components/site/RouteNotFound.astro';
|
|
5
6
|
|
|
6
|
-
export
|
|
7
|
-
const questions = await getCollection('questions', ({ data }) => !data.draft);
|
|
8
|
-
return questions.map((question) => ({
|
|
9
|
-
params: { slug: question.id },
|
|
10
|
-
props: { question },
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
7
|
+
export const prerender = false;
|
|
13
8
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
const slug = String(Astro.params.slug ?? '');
|
|
10
|
+
const questions = await getCollection('questions', ({ data }) => !data.draft);
|
|
11
|
+
const question = questions.find((candidate) => candidate.id === slug) ?? null;
|
|
12
|
+
if (!question) {
|
|
13
|
+
Astro.response.status = 404;
|
|
14
|
+
}
|
|
15
|
+
const rendered = question ? await render(question) : null;
|
|
16
|
+
const Content = rendered?.Content ?? null;
|
|
17
|
+
const contributor = question ? await resolveContributor(question.data.primaryContributor) : null;
|
|
18
|
+
const relatedObjectives = question ? await resolveReferences(question.data.relatedObjectives) : [];
|
|
19
|
+
const relatedBooks = question ? await resolveReferences(question.data.relatedBooks) : [];
|
|
19
20
|
---
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
{
|
|
23
|
+
!question || !Content ? (
|
|
24
|
+
<RouteNotFound title="Question not found" description="The requested question could not be found in this Treeseed." currentPath="/questions/" />
|
|
25
|
+
) : (
|
|
26
|
+
<AuthoredEntryLayout
|
|
27
|
+
entry={question.data}
|
|
28
|
+
currentPath="/questions/"
|
|
29
|
+
contributor={contributor}
|
|
30
|
+
metaLabel="Question type"
|
|
31
|
+
metaValue={question.data.questionType}
|
|
32
|
+
relatedObjectives={relatedObjectives}
|
|
33
|
+
relatedBooks={relatedBooks}
|
|
34
|
+
>
|
|
35
|
+
<Content />
|
|
36
|
+
</AuthoredEntryLayout>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -204,7 +204,10 @@ function rewriteDeclarations() {
|
|
|
204
204
|
}
|
|
205
205
|
function emitTypeDeclarations() {
|
|
206
206
|
const sourceFiles = [
|
|
207
|
+
resolve(srcRoot, 'types/astro-build.d.ts'),
|
|
207
208
|
resolve(srcRoot, 'types/cloudflare.ts'),
|
|
209
|
+
resolve(srcRoot, 'utils/site-models.ts'),
|
|
210
|
+
resolve(srcRoot, 'middleware/editorial-preview.ts'),
|
|
208
211
|
resolve(srcRoot, 'site-resources.ts'),
|
|
209
212
|
resolve(srcRoot, 'platform-resources.ts'),
|
|
210
213
|
resolve(srcRoot, 'api.ts'),
|
|
@@ -212,6 +215,7 @@ function emitTypeDeclarations() {
|
|
|
212
215
|
resolve(srcRoot, 'agent-runtime.ts'),
|
|
213
216
|
resolve(srcRoot, 'railway.ts'),
|
|
214
217
|
resolve(srcRoot, 'platform.ts'),
|
|
218
|
+
resolve(srcRoot, 'templates.ts'),
|
|
215
219
|
resolve(srcRoot, 'services/index.ts'),
|
|
216
220
|
resolve(srcRoot, 'plugin-default.ts'),
|
|
217
221
|
resolve(srcRoot, 'index.ts'),
|
|
@@ -370,8 +374,9 @@ async function main() {
|
|
|
370
374
|
}
|
|
371
375
|
writeCompatibilityEntrypoint(resolve(distRoot, 'config.js'), "import starlight from './vendor/starlight/index.js';\nimport { loadTreeseedManifest } from '@treeseed/sdk/platform/tenant-config';\nimport { createTreeseedSite } from './site.js';\n\nexport function createTreeseedTenantSite(manifestPath) {\n\tconst tenant = loadTreeseedManifest(manifestPath);\n\treturn createTreeseedSite(tenant, { starlight });\n}");
|
|
372
376
|
writeCompatibilityEntrypoint(resolve(distRoot, 'config.d.ts'), "export declare function createTreeseedTenantSite(manifestPath?: string): import('astro').AstroUserConfig<never, never, never>;");
|
|
377
|
+
writeCompatibilityEntrypoint(resolve(distRoot, 'content.d.ts'), "export declare function createTreeseedCollections(tenantConfig: any, dependencies: any): Record<string, any>;");
|
|
373
378
|
writeCompatibilityEntrypoint(resolve(distRoot, 'content-config.js'), "import { loadTreeseedManifest } from '@treeseed/sdk/platform/tenant-config';\nimport { docsLoader } from './vendor/starlight/loaders.js';\nimport { docsSchema } from './vendor/starlight/schema.js';\nimport { createTreeseedCollections } from './content.js';\n\nexport function createTreeseedTenantCollections(manifestPath) {\n\tconst tenant = loadTreeseedManifest(manifestPath);\n\treturn createTreeseedCollections(tenant, { docsLoader, docsSchema });\n}");
|
|
374
|
-
writeCompatibilityEntrypoint(resolve(distRoot, 'content-config.d.ts'), "export declare function createTreeseedTenantCollections(manifestPath?: string): {\n\tpages: any;\n\tnotes: any;\n\tquestions: any;\n\tobjectives: any;\n\tpeople: any;\n\tagents: any;\n\tbooks: any;\n\tdocs: any;\n};");
|
|
379
|
+
writeCompatibilityEntrypoint(resolve(distRoot, 'content-config.d.ts'), "export declare function createTreeseedTenantCollections(manifestPath?: string): {\n\tpages: any;\n\tnotes: any;\n\tquestions: any;\n\tobjectives: any;\n\tpeople: any;\n\tagents: any;\n\tbooks: any;\n\tdocs: any;\n\tworkdays?: any;\n};");
|
|
375
380
|
rmSync(resolve(distRoot, 'config.d.js'), { force: true });
|
|
376
381
|
rmSync(resolve(distRoot, 'content-config.d.js'), { force: true });
|
|
377
382
|
writeCompatibilityEntrypoint(resolve(vendoredStarlightRoot, 'utils', 'routing.js'), "export * from './routing/index.js';");
|
|
@@ -12,7 +12,13 @@ function readOption(name) {
|
|
|
12
12
|
return args[index + 1];
|
|
13
13
|
}
|
|
14
14
|
function parseSurface(value) {
|
|
15
|
-
if (value === 'web'
|
|
15
|
+
if (value === 'web'
|
|
16
|
+
|| value === 'api'
|
|
17
|
+
|| value === 'manager'
|
|
18
|
+
|| value === 'worker'
|
|
19
|
+
|| value === 'agents'
|
|
20
|
+
|| value === 'services'
|
|
21
|
+
|| value === 'integrated') {
|
|
16
22
|
return value;
|
|
17
23
|
}
|
|
18
24
|
return 'integrated';
|
|
@@ -20,5 +26,7 @@ function parseSurface(value) {
|
|
|
20
26
|
const exitCode = await runTreeseedIntegratedDev({
|
|
21
27
|
surface: parseSurface(readOption('--surface')),
|
|
22
28
|
watch: readFlag('--watch'),
|
|
29
|
+
projectId: readOption('--project-id'),
|
|
30
|
+
teamId: readOption('--team-id'),
|
|
23
31
|
});
|
|
24
32
|
process.exit(exitCode);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export declare function resolveAgentsServiceConfig(): {
|
|
3
|
+
serviceName: string;
|
|
4
|
+
marketBaseUrl: string;
|
|
5
|
+
projectId: string;
|
|
6
|
+
runnerToken: string;
|
|
7
|
+
runnerId: string;
|
|
8
|
+
batchSize: number;
|
|
9
|
+
pollIntervalMs: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function runAgentsCycle(): Promise<{
|
|
12
|
+
ok: boolean;
|
|
13
|
+
processed: number;
|
|
14
|
+
idle: boolean;
|
|
15
|
+
reason: string;
|
|
16
|
+
} | {
|
|
17
|
+
ok: boolean;
|
|
18
|
+
processed: number;
|
|
19
|
+
idle?: undefined;
|
|
20
|
+
reason?: undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function startAgentsLoop(): Promise<void>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { runRemoteRunnerCycle, startRemoteRunnerLoop, resolveRemoteRunnerConfig } from "./remote-runner.js";
|
|
4
|
+
function resolveAgentsServiceConfig() {
|
|
5
|
+
return {
|
|
6
|
+
...resolveRemoteRunnerConfig(),
|
|
7
|
+
serviceName: process.env.TREESEED_AGENTS_SERVICE_NAME?.trim() || "agents"
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
async function runAgentsCycle() {
|
|
11
|
+
return runRemoteRunnerCycle({
|
|
12
|
+
config: resolveAgentsServiceConfig()
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async function startAgentsLoop() {
|
|
16
|
+
return startRemoteRunnerLoop({
|
|
17
|
+
config: resolveAgentsServiceConfig()
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
21
|
+
const entryFile = process.argv[1] ?? "";
|
|
22
|
+
if (entryFile === currentFile) {
|
|
23
|
+
await startAgentsLoop();
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
resolveAgentsServiceConfig,
|
|
27
|
+
runAgentsCycle,
|
|
28
|
+
startAgentsLoop
|
|
29
|
+
};
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
export { runManagerAction, runManagerCycle, startManagerLoop } from './manager.ts';
|
|
1
2
|
export { runWorkerCycle, startWorkerLoop } from './worker.ts';
|
|
2
3
|
export { runRemoteRunnerCycle, startRemoteRunnerLoop } from './remote-runner.ts';
|
|
4
|
+
export { runAgentsCycle, startAgentsLoop } from './agents.ts';
|
|
3
5
|
export { runWorkdayStart } from './workday-start.ts';
|
|
4
6
|
export { runWorkdayReport } from './workday-report.ts';
|
|
7
|
+
export { createWorkerPoolScaler, RailwayWorkerPoolScaler, NoopWorkerPoolScaler } from './worker-pool-scaler.ts';
|
package/dist/services/index.js
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
import { runManagerAction, runManagerCycle, startManagerLoop } from "./manager.js";
|
|
1
2
|
import { runWorkerCycle, startWorkerLoop } from "./worker.js";
|
|
2
3
|
import { runRemoteRunnerCycle, startRemoteRunnerLoop } from "./remote-runner.js";
|
|
4
|
+
import { runAgentsCycle, startAgentsLoop } from "./agents.js";
|
|
3
5
|
import { runWorkdayStart } from "./workday-start.js";
|
|
4
6
|
import { runWorkdayReport } from "./workday-report.js";
|
|
7
|
+
import { createWorkerPoolScaler, RailwayWorkerPoolScaler, NoopWorkerPoolScaler } from "./worker-pool-scaler.js";
|
|
5
8
|
export {
|
|
9
|
+
NoopWorkerPoolScaler,
|
|
10
|
+
RailwayWorkerPoolScaler,
|
|
11
|
+
createWorkerPoolScaler,
|
|
12
|
+
runAgentsCycle,
|
|
13
|
+
runManagerAction,
|
|
14
|
+
runManagerCycle,
|
|
6
15
|
runRemoteRunnerCycle,
|
|
7
16
|
runWorkdayReport,
|
|
8
17
|
runWorkdayStart,
|
|
9
18
|
runWorkerCycle,
|
|
19
|
+
startAgentsLoop,
|
|
20
|
+
startManagerLoop,
|
|
10
21
|
startRemoteRunnerLoop,
|
|
11
22
|
startWorkerLoop
|
|
12
23
|
};
|