EXTENSION for TreeOS
starter-types
When the AI creates a node it needs to assign a type. Without guidance it guesses, and every land ends up with a different vocabulary. One land calls them tasks, another calls them action-items, a third uses todos. Starter types injects a consistent set of suggested node types into every AI context via enrichContext: goal, plan, task, knowledge, resource, identity. These are suggestions, not constraints. The AI can still use custom types when the situation calls for it. But the defaults give every tree on the land a shared structural vocabulary from day one. Land operators override the default list through land config. Set starterTypes to an array of strings and every tree on that land inherits the custom vocabulary. A software shop might use epic, story, bug, spike, doc. A school might use course, lesson, assignment, reading, project. The types are loaded once at boot and injected into every enrichContext call. The get-available-types tool lets the AI query the current list at runtime. No models, no routes, no jobs. Pure context injection. The lightest extension in the system, but it shapes every tree that grows on the land.
v1.0.1 by TreeOS Site 0 downloads 2 files 98 lines 3.4 KB published 38d ago
treeos ext install starter-types
View changelog

Manifest

Provides

  • tools

Requires

  • services: hooks

Optional

  • extensions: treeos-base
SHA256: 0936dac9d382a776b047be99605b9e2c64f4edabc05be2c20f454d40a3507407

Dependents

1 package depend on this

PackageTypeRelationship
treeos v1.0.1osstandalone

Source Code

1import log from "../../seed/log.js";
2
3const DEFAULT_TYPES = ["goal", "plan", "task", "knowledge", "resource", "identity"];
4
5let configuredTypes = [...DEFAULT_TYPES];
6
7export async function init(core) {
8  // Land operators can override via land config: starterTypes = ["goal", "plan", ...]
9  try {
10    const { getLandConfigValue } = await import("../../seed/landConfig.js");
11    const custom = getLandConfigValue("starterTypes");
12    if (Array.isArray(custom) && custom.length > 0) {
13      configuredTypes = custom;
14    }
15  } catch (err) {
16    log.debug("StarterTypes", "Custom types config not found, using defaults");
17  }
18
19  // Inject suggested types into AI context at every node
20  core.hooks.register("enrichContext", async ({ context }) => {
21    context.suggestedTypes = configuredTypes;
22  }, "starter-types");
23
24  // Register type options on node detail page
25  try {
26    const { getExtension } = await import("../loader.js");
27    const treeos = getExtension("treeos-base");
28    treeos?.exports?.registerSlot?.("node-type-options", "starter-types", ({ nodeType }) => {
29      return configuredTypes.map(t =>
30        `<option value="${t}" ${nodeType === t ? "selected" : ""}>${t}</option>`
31      ).join("\n");
32    }, { priority: 10 });
33  } catch {}
34
35  log.info("StarterTypes", `Loaded ${configuredTypes.length} type suggestions`);
36
37  const tools = [
38    {
39      name: "get-available-types",
40      description: "Get the list of suggested node types for this land.",
41      inputSchema: { type: "object", properties: {} },
42      annotations: { readOnlyHint: true },
43      async handler() {
44        return {
45          content: [{
46            type: "text",
47            text: `Available node types: ${configuredTypes.join(", ")}. Custom types are also allowed.`,
48          }],
49        };
50      },
51    },
52  ];
53
54  return { tools };
55}
56
1export default {
2  name: "starter-types",
3  version: "1.0.1",
4  builtFor: "TreeOS",
5  description:
6    "When the AI creates a node it needs to assign a type. Without guidance it guesses, and " +
7    "every land ends up with a different vocabulary. One land calls them tasks, another calls " +
8    "them action-items, a third uses todos. Starter types injects a consistent set of " +
9    "suggested node types into every AI context via enrichContext: goal, plan, task, " +
10    "knowledge, resource, identity. These are suggestions, not constraints. The AI can still " +
11    "use custom types when the situation calls for it. But the defaults give every tree on " +
12    "the land a shared structural vocabulary from day one." +
13    "\n\n" +
14    "Land operators override the default list through land config. Set starterTypes to an " +
15    "array of strings and every tree on that land inherits the custom vocabulary. A software " +
16    "shop might use epic, story, bug, spike, doc. A school might use course, lesson, " +
17    "assignment, reading, project. The types are loaded once at boot and injected into every " +
18    "enrichContext call. The get-available-types tool lets the AI query the current list at " +
19    "runtime. No models, no routes, no jobs. Pure context injection. The lightest extension " +
20    "in the system, but it shapes every tree that grows on the land.",
21
22  needs: {
23    services: ["hooks"],
24  },
25
26  optional: {
27    extensions: ["treeos-base"],
28  },
29
30  provides: {
31    models: {},
32    routes: false,
33    tools: true,
34    modes: false,
35    jobs: false,
36    orchestrator: false,
37    energyActions: {},
38    sessionTypes: {},
39    cli: [],
40  },
41};
42

Versions

Version Published Downloads
1.0.1 38d ago 0
1.0.0 48d ago 0
0 stars
0 flags
React from the CLI: treeos ext star starter-types

Comments

Loading comments...

Post comments from the CLI: treeos ext comment starter-types "your comment"
Max 3 comments per extension. One star and one flag per user.