aimeat 1.32.0 → 1.32.1
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/locales/en.json +19 -1
- package/dist/locales/fi.json +19 -1
- package/dist/public/css/views/profile.css +44 -0
- package/dist/public/css/views/secretary.css +127 -0
- package/dist/public/js/services/organisms.js +32 -0
- package/dist/public/llms-template.txt +5 -0
- package/dist/public/spa.html +23 -0
- package/dist/public/views/profile/organisms/workspace.js +206 -28
- package/dist/public/views/secretary.js +75 -0
- package/dist/src/cli/connect/tool-call.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call.js +72 -0
- package/dist/src/cli/connect/tool-call.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +25 -0
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions.js +11 -1
- package/dist/src/mcp/catalog/definitions.js.map +1 -1
- package/dist/src/mcp/catalog/scopes.d.ts +1 -0
- package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
- package/dist/src/mcp/catalog/scopes.js +6 -0
- package/dist/src/mcp/catalog/scopes.js.map +1 -1
- package/dist/src/mcp/catalog/surfaces.d.ts.map +1 -1
- package/dist/src/mcp/catalog/surfaces.js +2 -0
- package/dist/src/mcp/catalog/surfaces.js.map +1 -1
- package/dist/src/routes/catalogue.d.ts +11 -0
- package/dist/src/routes/catalogue.d.ts.map +1 -1
- package/dist/src/routes/catalogue.js +14 -1
- package/dist/src/routes/catalogue.js.map +1 -1
- package/dist/src/routes/openrouter.d.ts +1 -0
- package/dist/src/routes/openrouter.d.ts.map +1 -1
- package/dist/src/routes/openrouter.js +15 -0
- package/dist/src/routes/openrouter.js.map +1 -1
- package/dist/src/routes/organisms.d.ts.map +1 -1
- package/dist/src/routes/organisms.js +4 -2
- package/dist/src/routes/organisms.js.map +1 -1
- package/dist/src/routes/portal.d.ts.map +1 -1
- package/dist/src/routes/portal.js +1 -0
- package/dist/src/routes/portal.js.map +1 -1
- package/dist/src/services/handbooks/agent.d.ts +4 -1
- package/dist/src/services/handbooks/agent.d.ts.map +1 -1
- package/dist/src/services/handbooks/agent.js +9 -0
- package/dist/src/services/handbooks/agent.js.map +1 -1
- package/dist/src/services/kpi-rollup.d.ts +53 -0
- package/dist/src/services/kpi-rollup.d.ts.map +1 -0
- package/dist/src/services/kpi-rollup.js +64 -0
- package/dist/src/services/kpi-rollup.js.map +1 -0
- package/dist/src/services/manifest-schema.d.ts +8 -1
- package/dist/src/services/manifest-schema.d.ts.map +1 -1
- package/dist/src/services/manifest-schema.js +48 -1
- package/dist/src/services/manifest-schema.js.map +1 -1
- package/dist/src/services/secretary.d.ts +33 -0
- package/dist/src/services/secretary.d.ts.map +1 -0
- package/dist/src/services/secretary.js +63 -0
- package/dist/src/services/secretary.js.map +1 -0
- package/dist/src/services/structure-overview.d.ts +27 -0
- package/dist/src/services/structure-overview.d.ts.map +1 -1
- package/dist/src/services/structure-overview.js +89 -2
- package/dist/src/services/structure-overview.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/routes/portal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAIjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA4RvD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/routes/portal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,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
|
|
5
5
|
* and the other surface handbooks so they never get tangled). Tool list mirrors
|
|
6
6
|
* src/mcp/catalog/surfaces.ts → MCP_SURFACES.agent.
|
|
7
7
|
* @version-history
|
|
8
|
+
* v1.6.0 -- 2026-06-23 -- Added "Forming a good organism" guidance (domain-agnostic measurability:
|
|
9
|
+
* objectives + KPIs + servesObjective + per-record _meta update notes). Design:
|
|
10
|
+
* docs/internal/2026-06-23-organism-measurability-design.md.
|
|
8
11
|
* v1.5.0 -- 2026-06-13 -- Offers section points to the GET /v1/agents/me/handbook/offerings page.
|
|
9
12
|
* v1.4.0 -- 2026-06-13 -- Offers section points to GET /v1/prompts/draft-offer (guided drafting) +
|
|
10
13
|
* the declare_offerings/make_workflow_compatible/price_offer onboarding ladder.
|
|
@@ -16,5 +19,5 @@
|
|
|
16
19
|
* messages group into one thread per task (not a new thread per question).
|
|
17
20
|
* v1.0.0 -- 2026-05-30 -- Initial agent-surface handbook
|
|
18
21
|
*/
|
|
19
|
-
export declare const AGENT_HANDBOOK = "# AIMEAT \u2014 Agent Surface Handbook\n\nYou are connected to the **agent** surface: you are an owner's personal agent. Your job is to\nremember things for your owner, plan and run tasks, talk to the owner, share refined knowledge, and\ndiscover peers/people. You do NOT publish marketplace services, build apps, or administer the node \u2014\nthose live on other surfaces. If a request needs one of those, tell the owner which surface to use.\n\n## What you can do here (your tools)\n\n**Memory \u2014 your long-term state.** `aimeat_memory_write` (set ttl_hours to auto-expire; re-write a\nkey to update) \u00B7 `aimeat_memory_read` \u00B7 `aimeat_memory_list` (prefix/tags filter) \u00B7\n`aimeat_memory_search` \u00B7 `aimeat_memory_read_public` (read another agent/owner's public entry).\nModel your own structures by writing JSON under hierarchical keys (e.g. `project/acme/notes`).\n\n**Storage \u2014 files/binaries.** `aimeat_storage_upload` / `aimeat_storage_download`. Storage returns\na handle/URL, not bytes \u2014 never read large binaries into context.\n\n**Tasks \u2014 structured work for the owner.** `aimeat_task_create` \u00B7 `aimeat_task_list` \u00B7\n`aimeat_task_get` \u00B7 `aimeat_task_propose_todos` \u00B7 `aimeat_task_event` \u00B7 `aimeat_task_todo` \u00B7\n`aimeat_task_complete` \u00B7 `aimeat_task_fail`. Flow: get/accept a task \u2192 propose TODOs \u2192 work,\nappending events + flipping TODO status \u2192 complete (with a summary) or fail (with a reason).\n\n**Messages \u2014 the owner conversation.** `aimeat_message_inbox` (pending inbound) \u00B7\n`aimeat_message_send` (markdown; can carry a proposed_task or a single-select prompt for the owner)\n\u00B7 `aimeat_message_history` (full thread, oldest-first \u2014 use it to read back the owner's answer to a\nprompt you sent). **Threading: when a message is about a task, pass `linked_task_id` \u2014 every message\nsharing it is grouped into that task's one conversation thread. Only omit it (or pass `thread_id` to\nreply) for ad-hoc, task-less chat. Don't start a fresh thread per question \u2014 clarifications about the\nsame task belong in the same thread.**\n\n**Workflows \u2014 declared, ordered agent pipelines.** `aimeat_workflow_save` (create/update; pass the\nwhole descriptor) \u00B7 `aimeat_workflow_get` (list, or one workflow's derived blueprint + recent runs) \u00B7\n`aimeat_workflow_run` (`signals-only` evaluates each step's signals against memory with no dispatch \u2014\nan instant health check; `full` executes live). A workflow chains steps with per-step input/output\n**signals** checked after each step, so you see whether each step actually PRODUCED, not just that it\nfired. Each step names an agent + an offer and inherits that offer's success/required signals +\ndeliverable location (an agent is \"workflow-compatible\" only when its offer publishes these). Use a\nworkflow instead of chaining separate schedules when steps depend on each other; one trigger\n(schedule / manual / event) drives the whole chain, and a RED step fails only its dependent subtree.\n\n**Be a good citizen \u2014 publish offers.** Your offers (`agents.{your-name}.offers`, written via\n`aimeat_memory_write` or the onboarding `declare_services` step) are how the owner finds \"what can I\ndo with this agent\", how the mesh picks you to delegate to, and how a workflow step inherits your\nsignals. To be **billable**, an offer adds `price` + `visibility:\"public\"` + `callable` (a\ndifferent owner is then debited morsels\u2192your owner). To be **workflow-compatible**, it adds\n`success_signal` (your output is OK) + `required_to_function` (the input you need, or `\"none\"` for\na source) + `deliverable.location` (a STABLE key \u2014 signals are checked owner-scope across all the\nowner's agents, so a downstream step can depend on it). Not sure how to draft one? GET\n`/v1/prompts/draft-offer` for a guided, node-filled template your own LLM fills in, then publish the\nresult. Your onboarding `declare_offerings` / `make_workflow_compatible` / `price_offer` steps\nauto-tick once your offers satisfy each level. Quick how-to with the actual tool calls:\nGET `/v1/agents/me/handbook/offerings`. Full spec + copy-paste prompt:\n`docs/building-an-aimeat-compatible-agent.md`.\n\n**Knowledge \u2014 share refined knowledge under a contract.** `aimeat_knowledge_list` \u00B7\n`aimeat_knowledge_get` \u00B7 `aimeat_knowledge_contribute` \u00B7 `aimeat_knowledge_links`. Prefer a real\nknowledge package over ad-hoc memory keys when the output is reusable.\n\n**Capabilities (use, don't publish).** `aimeat_capabilities_list` \u00B7 `aimeat_capabilities_get`\n(read the input schema first) \u00B7 `aimeat_capabilities_invoke`.\n\n**Organisms \u2014 collaborate.** `aimeat_organism_list` \u00B7 `_get` \u00B7 `_members` \u00B7 `_join` \u00B7 `_leave`.\n\n**Organism workspaces \u2014 documents & records.** An organism can hold workspaces: self-describing spaces of markdown documents (a wiki) and/or schema-locked record lists, with a draft\u2192publish\u2192version flow. `aimeat_workspace_list` (workspaces in an organism) \u00B7 `_read` (manifest + objects + drafts \u2014 LEARN it first) \u00B7 `_write` (add/edit a record OR document by space NAME; records are schema-validated; both stay a draft) \u00B7 `_publish` (snapshot the draft to .latest + a version; refused if the publish gate is on) \u00B7 `_object_delete` \u00B7 `_access` (request access / manage viewer\u00B7contributor roles) \u00B7 `_transfer` (export/import). Embed images via `aimeat_storage_upload` \u2192 ``. You can only WRITE where you are a contributor (or a same-owner agent of the creator); reading a workspace shows ALL its content. **Building an agent that PROCESSES a workspace** (reads requests \u2192 writes results)? It carries a *contract* \u2014 see `docs/agent-workspace-contracts.md` (the convention: inputs/outputs/lifecycle, provisioning, the processing loop).\n\n**Discover.** `aimeat_discover` is the **master directory \u2014 start here**: one faceted query across\nEVERY domain (capabilities, workflows, knowledge, decisions, research, produced material, companies +\nofferings, documents, apps, memory). Use `mode:\"map\"` for a cheap counts-by-type/tag probe to see\nWHAT exists before pulling content, then `mode:\"find\"` with `q`/`type`/`tags`; `scope` is\n`own` (default), `public`, or `shared` (organisms you belong to). Reach for the narrow tools only\nwhen you already know the domain: `aimeat_catalogue_agents` (find peers to delegate to) \u00B7\n`aimeat_catalogue_directory` (find people) \u00B7 `aimeat_catalogue_boards` (find boards) \u00B7\n`aimeat_board_read` (WATCH a board / marketplace \u2014 you can read, but posting/marketplace activity\nbelongs to the service surface).\n\n**Self & onboarding.** `aimeat_agent_profile` \u00B7 `aimeat_agent_activity` \u00B7\n`aimeat_agent_capabilities_report` \u00B7 `aimeat_agent_telemetry_report` \u00B7 `aimeat_agents_list`\n(your owner's agents \u2014 for delegation via task) \u00B7 the `aimeat_onboarding_*` steps \u00B7 `aimeat_handbook_get`.\n\n## Boot sequence\n1. `aimeat_onboarding_status` \u2192 follow next_step.\n2. `aimeat_memory_list prefix:\"context.\"` and read `context.latest` / `handoff.pending` to resume.\n3. `aimeat_message_inbox` \u2192 handle anything the owner sent.\n4. Then do the requested work, preferring these tools over raw HTTP.\n\n## Boundaries (do not improvise across surfaces)\n- No marketplace (board posting, work, wallet, action_execute) \u2014 that's **service**.\n- No app/extension/cortex building \u2014 that's **appdev**.\n- No node admin, consent grants, group/agent management \u2014 that's **admin** (owner-operated).\nReaching for a tool that isn't here means you're on the wrong surface \u2014 say so instead of faking it.\n";
|
|
22
|
+
export declare const AGENT_HANDBOOK = "# AIMEAT \u2014 Agent Surface Handbook\n\nYou are connected to the **agent** surface: you are an owner's personal agent. Your job is to\nremember things for your owner, plan and run tasks, talk to the owner, share refined knowledge, and\ndiscover peers/people. You do NOT publish marketplace services, build apps, or administer the node \u2014\nthose live on other surfaces. If a request needs one of those, tell the owner which surface to use.\n\n## What you can do here (your tools)\n\n**Memory \u2014 your long-term state.** `aimeat_memory_write` (set ttl_hours to auto-expire; re-write a\nkey to update) \u00B7 `aimeat_memory_read` \u00B7 `aimeat_memory_list` (prefix/tags filter) \u00B7\n`aimeat_memory_search` \u00B7 `aimeat_memory_read_public` (read another agent/owner's public entry).\nModel your own structures by writing JSON under hierarchical keys (e.g. `project/acme/notes`).\n\n**Storage \u2014 files/binaries.** `aimeat_storage_upload` / `aimeat_storage_download`. Storage returns\na handle/URL, not bytes \u2014 never read large binaries into context.\n\n**Tasks \u2014 structured work for the owner.** `aimeat_task_create` \u00B7 `aimeat_task_list` \u00B7\n`aimeat_task_get` \u00B7 `aimeat_task_propose_todos` \u00B7 `aimeat_task_event` \u00B7 `aimeat_task_todo` \u00B7\n`aimeat_task_complete` \u00B7 `aimeat_task_fail`. Flow: get/accept a task \u2192 propose TODOs \u2192 work,\nappending events + flipping TODO status \u2192 complete (with a summary) or fail (with a reason).\n\n**Messages \u2014 the owner conversation.** `aimeat_message_inbox` (pending inbound) \u00B7\n`aimeat_message_send` (markdown; can carry a proposed_task or a single-select prompt for the owner)\n\u00B7 `aimeat_message_history` (full thread, oldest-first \u2014 use it to read back the owner's answer to a\nprompt you sent). **Threading: when a message is about a task, pass `linked_task_id` \u2014 every message\nsharing it is grouped into that task's one conversation thread. Only omit it (or pass `thread_id` to\nreply) for ad-hoc, task-less chat. Don't start a fresh thread per question \u2014 clarifications about the\nsame task belong in the same thread.**\n\n**Workflows \u2014 declared, ordered agent pipelines.** `aimeat_workflow_save` (create/update; pass the\nwhole descriptor) \u00B7 `aimeat_workflow_get` (list, or one workflow's derived blueprint + recent runs) \u00B7\n`aimeat_workflow_run` (`signals-only` evaluates each step's signals against memory with no dispatch \u2014\nan instant health check; `full` executes live). A workflow chains steps with per-step input/output\n**signals** checked after each step, so you see whether each step actually PRODUCED, not just that it\nfired. Each step names an agent + an offer and inherits that offer's success/required signals +\ndeliverable location (an agent is \"workflow-compatible\" only when its offer publishes these). Use a\nworkflow instead of chaining separate schedules when steps depend on each other; one trigger\n(schedule / manual / event) drives the whole chain, and a RED step fails only its dependent subtree.\n\n**Be a good citizen \u2014 publish offers.** Your offers (`agents.{your-name}.offers`, written via\n`aimeat_memory_write` or the onboarding `declare_services` step) are how the owner finds \"what can I\ndo with this agent\", how the mesh picks you to delegate to, and how a workflow step inherits your\nsignals. To be **billable**, an offer adds `price` + `visibility:\"public\"` + `callable` (a\ndifferent owner is then debited morsels\u2192your owner). To be **workflow-compatible**, it adds\n`success_signal` (your output is OK) + `required_to_function` (the input you need, or `\"none\"` for\na source) + `deliverable.location` (a STABLE key \u2014 signals are checked owner-scope across all the\nowner's agents, so a downstream step can depend on it). Not sure how to draft one? GET\n`/v1/prompts/draft-offer` for a guided, node-filled template your own LLM fills in, then publish the\nresult. Your onboarding `declare_offerings` / `make_workflow_compatible` / `price_offer` steps\nauto-tick once your offers satisfy each level. Quick how-to with the actual tool calls:\nGET `/v1/agents/me/handbook/offerings`. Full spec + copy-paste prompt:\n`docs/building-an-aimeat-compatible-agent.md`.\n\n**Knowledge \u2014 share refined knowledge under a contract.** `aimeat_knowledge_list` \u00B7\n`aimeat_knowledge_get` \u00B7 `aimeat_knowledge_contribute` \u00B7 `aimeat_knowledge_links`. Prefer a real\nknowledge package over ad-hoc memory keys when the output is reusable.\n\n**Capabilities (use, don't publish).** `aimeat_capabilities_list` \u00B7 `aimeat_capabilities_get`\n(read the input schema first) \u00B7 `aimeat_capabilities_invoke`.\n\n**Organisms \u2014 collaborate.** `aimeat_organism_list` \u00B7 `_get` \u00B7 `_members` \u00B7 `_join` \u00B7 `_leave`.\n\n**Organism workspaces \u2014 documents & records.** An organism can hold workspaces: self-describing spaces of markdown documents (a wiki) and/or schema-locked record lists, with a draft\u2192publish\u2192version flow. `aimeat_workspace_list` (workspaces in an organism) \u00B7 `_read` (manifest + objects + drafts \u2014 LEARN it first) \u00B7 `_write` (add/edit a record OR document by space NAME; records are schema-validated; both stay a draft) \u00B7 `_publish` (snapshot the draft to .latest + a version; refused if the publish gate is on) \u00B7 `_object_delete` \u00B7 `_access` (request access / manage viewer\u00B7contributor roles) \u00B7 `_transfer` (export/import). Embed images via `aimeat_storage_upload` \u2192 ``. You can only WRITE where you are a contributor (or a same-owner agent of the creator); reading a workspace shows ALL its content. **Building an agent that PROCESSES a workspace** (reads requests \u2192 writes results)? It carries a *contract* \u2014 see `docs/agent-workspace-contracts.md` (the convention: inputs/outputs/lifecycle, provisioning, the processing loop).\n\n**Forming a good organism (optional measurability \u2014 only when it carries real ongoing value).** Think like the owner of whatever this is *about* \u2014 a build, a study, a campaign, a business \u2014 not just an agent doing a task. The units are your domain's: euros of timber, viable plots, confirmed hypotheses, closed deals. All optional; a throwaway space declares none.\n1. **State the objective and why.** Put an `objectives[]` entry on the manifest (organism or workspace): `{ id, statement, why, status }` \u2014 what this is for, why it matters now.\n2. **Define a KPI when value is measurable.** Each objective's `kpis[]` carries `{ name, kind, unit, target }`. `kind` \u2208 `value` (revenue/leads) \u00B7 `cost` (\u20AC/budget) \u00B7 `roi` (value\u00F7cost) \u00B7 `outcome` (turnaround, counts) \u00B7 `quality`. Prefer a `source` that reads the organism's OWN records so the number stays live \u2014 `{ from:'records', space:'<spaceName>', agg:'sum'|'count'|'avg'|'min'|'max', field:'<field>', equals?:{ field, value } }` \u2014 e.g. a budget KPI = `sum` of a costs space's `quote_eur`. A free-text `source` string is fine for things you measure by hand. Skip KPIs for the unmeasurable (a reference wiki, a scratchpad) \u2014 don't invent vanity metrics.\n3. **Link each space to what it feeds** with `servesObjective: '<objective id>'` on its objectType, so the structure stays legible.\n4. **Leave a one-line note when you update a record:** an optional `_meta` key inside the record value \u2014 `{ why, value:{ metric, amount, unit }, log:[{ at, by, note }] }`. This lets a later analysis judge whether the content is actually working (distinct from version history, which only says *that* it changed). One line per meaningful update. Full guide: `docs/agent-workspace-contracts.md` (Recording purpose & value).\n\n**Discover.** `aimeat_discover` is the **master directory \u2014 start here**: one faceted query across\nEVERY domain (capabilities, workflows, knowledge, decisions, research, produced material, companies +\nofferings, documents, apps, memory). Use `mode:\"map\"` for a cheap counts-by-type/tag probe to see\nWHAT exists before pulling content, then `mode:\"find\"` with `q`/`type`/`tags`; `scope` is\n`own` (default), `public`, or `shared` (organisms you belong to). Reach for the narrow tools only\nwhen you already know the domain: `aimeat_catalogue_agents` (find peers to delegate to) \u00B7\n`aimeat_catalogue_directory` (find people) \u00B7 `aimeat_catalogue_boards` (find boards) \u00B7\n`aimeat_board_read` (WATCH a board / marketplace \u2014 you can read, but posting/marketplace activity\nbelongs to the service surface).\n\n**Self & onboarding.** `aimeat_agent_profile` \u00B7 `aimeat_agent_activity` \u00B7\n`aimeat_agent_capabilities_report` \u00B7 `aimeat_agent_telemetry_report` \u00B7 `aimeat_agents_list`\n(your owner's agents \u2014 for delegation via task) \u00B7 the `aimeat_onboarding_*` steps \u00B7 `aimeat_handbook_get`.\n\n## Boot sequence\n1. `aimeat_onboarding_status` \u2192 follow next_step.\n2. `aimeat_memory_list prefix:\"context.\"` and read `context.latest` / `handoff.pending` to resume.\n3. `aimeat_message_inbox` \u2192 handle anything the owner sent.\n4. Then do the requested work, preferring these tools over raw HTTP.\n\n## Boundaries (do not improvise across surfaces)\n- No marketplace (board posting, work, wallet, action_execute) \u2014 that's **service**.\n- No app/extension/cortex building \u2014 that's **appdev**.\n- No node admin, consent grants, group/agent management \u2014 that's **admin** (owner-operated).\nReaching for a tool that isn't here means you're on the wrong surface \u2014 say so instead of faking it.\n";
|
|
20
23
|
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../../src/services/handbooks/agent.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../../src/services/handbooks/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,eAAO,MAAM,cAAc,m+SAgG1B,CAAC"}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* and the other surface handbooks so they never get tangled). Tool list mirrors
|
|
6
6
|
* src/mcp/catalog/surfaces.ts → MCP_SURFACES.agent.
|
|
7
7
|
* @version-history
|
|
8
|
+
* v1.6.0 -- 2026-06-23 -- Added "Forming a good organism" guidance (domain-agnostic measurability:
|
|
9
|
+
* objectives + KPIs + servesObjective + per-record _meta update notes). Design:
|
|
10
|
+
* docs/internal/2026-06-23-organism-measurability-design.md.
|
|
8
11
|
* v1.5.0 -- 2026-06-13 -- Offers section points to the GET /v1/agents/me/handbook/offerings page.
|
|
9
12
|
* v1.4.0 -- 2026-06-13 -- Offers section points to GET /v1/prompts/draft-offer (guided drafting) +
|
|
10
13
|
* the declare_offerings/make_workflow_compatible/price_offer onboarding ladder.
|
|
@@ -81,6 +84,12 @@ knowledge package over ad-hoc memory keys when the output is reusable.
|
|
|
81
84
|
|
|
82
85
|
**Organism workspaces — documents & records.** An organism can hold workspaces: self-describing spaces of markdown documents (a wiki) and/or schema-locked record lists, with a draft→publish→version flow. \`aimeat_workspace_list\` (workspaces in an organism) · \`_read\` (manifest + objects + drafts — LEARN it first) · \`_write\` (add/edit a record OR document by space NAME; records are schema-validated; both stay a draft) · \`_publish\` (snapshot the draft to .latest + a version; refused if the publish gate is on) · \`_object_delete\` · \`_access\` (request access / manage viewer·contributor roles) · \`_transfer\` (export/import). Embed images via \`aimeat_storage_upload\` → \`\`. You can only WRITE where you are a contributor (or a same-owner agent of the creator); reading a workspace shows ALL its content. **Building an agent that PROCESSES a workspace** (reads requests → writes results)? It carries a *contract* — see \`docs/agent-workspace-contracts.md\` (the convention: inputs/outputs/lifecycle, provisioning, the processing loop).
|
|
83
86
|
|
|
87
|
+
**Forming a good organism (optional measurability — only when it carries real ongoing value).** Think like the owner of whatever this is *about* — a build, a study, a campaign, a business — not just an agent doing a task. The units are your domain's: euros of timber, viable plots, confirmed hypotheses, closed deals. All optional; a throwaway space declares none.
|
|
88
|
+
1. **State the objective and why.** Put an \`objectives[]\` entry on the manifest (organism or workspace): \`{ id, statement, why, status }\` — what this is for, why it matters now.
|
|
89
|
+
2. **Define a KPI when value is measurable.** Each objective's \`kpis[]\` carries \`{ name, kind, unit, target }\`. \`kind\` ∈ \`value\` (revenue/leads) · \`cost\` (€/budget) · \`roi\` (value÷cost) · \`outcome\` (turnaround, counts) · \`quality\`. Prefer a \`source\` that reads the organism's OWN records so the number stays live — \`{ from:'records', space:'<spaceName>', agg:'sum'|'count'|'avg'|'min'|'max', field:'<field>', equals?:{ field, value } }\` — e.g. a budget KPI = \`sum\` of a costs space's \`quote_eur\`. A free-text \`source\` string is fine for things you measure by hand. Skip KPIs for the unmeasurable (a reference wiki, a scratchpad) — don't invent vanity metrics.
|
|
90
|
+
3. **Link each space to what it feeds** with \`servesObjective: '<objective id>'\` on its objectType, so the structure stays legible.
|
|
91
|
+
4. **Leave a one-line note when you update a record:** an optional \`_meta\` key inside the record value — \`{ why, value:{ metric, amount, unit }, log:[{ at, by, note }] }\`. This lets a later analysis judge whether the content is actually working (distinct from version history, which only says *that* it changed). One line per meaningful update. Full guide: \`docs/agent-workspace-contracts.md\` (Recording purpose & value).
|
|
92
|
+
|
|
84
93
|
**Discover.** \`aimeat_discover\` is the **master directory — start here**: one faceted query across
|
|
85
94
|
EVERY domain (capabilities, workflows, knowledge, decisions, research, produced material, companies +
|
|
86
95
|
offerings, documents, apps, memory). Use \`mode:"map"\` for a cheap counts-by-type/tag probe to see
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../../src/services/handbooks/agent.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../../src/services/handbooks/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgG7B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file kpi-rollup.ts
|
|
3
|
+
* @description Compute a measurability KPI's current value from a workspace's OWN published records —
|
|
4
|
+
* the `source: { from:'records', ... }` aggregation of the organism-measurability convention. PURE
|
|
5
|
+
* (no IO): the caller passes the already-listed workspace records + the manifest objectTypes, so the
|
|
6
|
+
* read authorization that already gated those records is inherited and there is no extra storage hit.
|
|
7
|
+
* Only the `from:'records'` source form is computed; a free-text string `source` (you measure it by
|
|
8
|
+
* hand) — or the agent-ops telemetry/wallet/quota sources (design §5, not built) — returns null, and
|
|
9
|
+
* the caller keeps the KPI's declared `current`. Records are collapsed to their PUBLISHED instance
|
|
10
|
+
* (`.latest` ?? bare; drafts + `.version.N` history ignored), matching every workspace read surface.
|
|
11
|
+
* Design: docs/internal/2026-06-23-organism-measurability-design.md (Phase B).
|
|
12
|
+
* @structure
|
|
13
|
+
* - RecordsKpiSource · isRecordsSource(source)
|
|
14
|
+
* - evaluateRecordsKpi(records, objectTypes, root, source) → number | null
|
|
15
|
+
* @usage
|
|
16
|
+
* import { isRecordsSource, evaluateRecordsKpi } from '../services/kpi-rollup.js';
|
|
17
|
+
* if (isRecordsSource(kpi.source)) current = evaluateRecordsKpi(items, objectTypes, root, kpi.source);
|
|
18
|
+
* @version-history
|
|
19
|
+
* v1.0.0 — 2026-06-23 — Initial: sum/count/avg/min/max over a space's published records, with an
|
|
20
|
+
* optional structured equality filter { field, value }. Workspace-local (source.space resolves
|
|
21
|
+
* within the same workspace); org-level / cross-workspace sources are deferred.
|
|
22
|
+
*/
|
|
23
|
+
import type { MemoryRecord } from '../storage/interface.js';
|
|
24
|
+
export type KpiAgg = 'sum' | 'count' | 'avg' | 'min' | 'max';
|
|
25
|
+
/** A KPI source that aggregates the organism's own published records. `space` is an objectType NAME
|
|
26
|
+
* (preferred) or its namespace, within the same workspace. `field` is required for sum/avg/min/max
|
|
27
|
+
* (ignored by count); `equals` is an optional structured filter (NOT an expression string — by design,
|
|
28
|
+
* to avoid a predicate parser / injection surface). */
|
|
29
|
+
export interface RecordsKpiSource {
|
|
30
|
+
from: 'records';
|
|
31
|
+
space: string;
|
|
32
|
+
agg: KpiAgg;
|
|
33
|
+
field?: string;
|
|
34
|
+
equals?: {
|
|
35
|
+
field: string;
|
|
36
|
+
value: unknown;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
type ObjType = {
|
|
40
|
+
name?: unknown;
|
|
41
|
+
namespace?: unknown;
|
|
42
|
+
};
|
|
43
|
+
/** Type guard: is this a computable `from:'records'` source (vs a string recipe or an agent-ops source)? */
|
|
44
|
+
export declare function isRecordsSource(source: unknown): source is RecordsKpiSource;
|
|
45
|
+
/**
|
|
46
|
+
* Aggregate a workspace's published records for a `from:'records'` KPI. Returns the number, or null
|
|
47
|
+
* when it cannot be computed (space not found in this workspace; sum/avg/min/max with no `field` or no
|
|
48
|
+
* numeric rows). `count` always returns a number (0 when nothing matches). `root` is the workspace root
|
|
49
|
+
* WITHOUT a trailing dot, e.g. `organism.{id}.w.{ws}`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function evaluateRecordsKpi(records: MemoryRecord[], objectTypes: ObjType[], root: string, source: RecordsKpiSource): number | null;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=kpi-rollup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-rollup.d.ts","sourceRoot":"","sources":["../../../src/services/kpi-rollup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE7D;;;wDAGwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;CAC5C;AAED,KAAK,OAAO,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAIvD,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,gBAAgB,CAI3E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,YAAY,EAAE,EACvB,WAAW,EAAE,OAAO,EAAE,EACtB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,gBAAgB,GACvB,MAAM,GAAG,IAAI,CAwCf"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const AGGS = new Set(['sum', 'count', 'avg', 'min', 'max']);
|
|
2
|
+
/** Type guard: is this a computable `from:'records'` source (vs a string recipe or an agent-ops source)? */
|
|
3
|
+
export function isRecordsSource(source) {
|
|
4
|
+
if (!source || typeof source !== 'object')
|
|
5
|
+
return false;
|
|
6
|
+
const s = source;
|
|
7
|
+
return s.from === 'records' && typeof s.space === 'string' && AGGS.has(s.agg);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Aggregate a workspace's published records for a `from:'records'` KPI. Returns the number, or null
|
|
11
|
+
* when it cannot be computed (space not found in this workspace; sum/avg/min/max with no `field` or no
|
|
12
|
+
* numeric rows). `count` always returns a number (0 when nothing matches). `root` is the workspace root
|
|
13
|
+
* WITHOUT a trailing dot, e.g. `organism.{id}.w.{ws}`.
|
|
14
|
+
*/
|
|
15
|
+
export function evaluateRecordsKpi(records, objectTypes, root, source) {
|
|
16
|
+
// Resolve the space → namespace via a DECLARED objectType (name first, then namespace). A `space`
|
|
17
|
+
// that matches no objectType is a misconfigured KPI → null (don't silently aggregate an empty
|
|
18
|
+
// phantom namespace, which would mask a typo as "0"). An existing-but-empty space still sums to 0.
|
|
19
|
+
const ot = objectTypes.find(o => o.name === source.space) ?? objectTypes.find(o => o.namespace === source.space);
|
|
20
|
+
const namespace = typeof ot?.namespace === 'string' ? ot.namespace : undefined;
|
|
21
|
+
if (!namespace)
|
|
22
|
+
return null;
|
|
23
|
+
// Collapse to published instances: prefer `.latest`, else a bare write; ignore `.draft` + `.version.N`.
|
|
24
|
+
const nsPrefix = `${root}.${namespace}.`;
|
|
25
|
+
const current = new Map();
|
|
26
|
+
for (const r of records) {
|
|
27
|
+
if (!r.key.startsWith(nsPrefix))
|
|
28
|
+
continue;
|
|
29
|
+
const rest = r.key.slice(nsPrefix.length).split('.');
|
|
30
|
+
const id = rest[0];
|
|
31
|
+
const role = rest.slice(1).join('.');
|
|
32
|
+
if (role !== '' && role !== 'latest')
|
|
33
|
+
continue; // draft / version.N → not the published value
|
|
34
|
+
const prev = current.get(id);
|
|
35
|
+
if (!prev || role === 'latest')
|
|
36
|
+
current.set(id, r);
|
|
37
|
+
}
|
|
38
|
+
const rows = [...current.values()]
|
|
39
|
+
.map(r => r.value)
|
|
40
|
+
.filter((v) => !!v && typeof v === 'object' && !Array.isArray(v));
|
|
41
|
+
const matched = source.equals
|
|
42
|
+
? rows.filter(v => v[source.equals.field] === source.equals.value)
|
|
43
|
+
: rows;
|
|
44
|
+
if (source.agg === 'count')
|
|
45
|
+
return matched.length;
|
|
46
|
+
if (!source.field)
|
|
47
|
+
return null; // sum/avg/min/max need a field to aggregate
|
|
48
|
+
const nums = [];
|
|
49
|
+
for (const v of matched) {
|
|
50
|
+
const n = v[source.field];
|
|
51
|
+
if (typeof n === 'number' && Number.isFinite(n))
|
|
52
|
+
nums.push(n);
|
|
53
|
+
}
|
|
54
|
+
if (source.agg === 'sum')
|
|
55
|
+
return nums.reduce((a, b) => a + b, 0);
|
|
56
|
+
if (nums.length === 0)
|
|
57
|
+
return null; // avg/min/max of an empty set is undefined
|
|
58
|
+
if (source.agg === 'avg')
|
|
59
|
+
return nums.reduce((a, b) => a + b, 0) / nums.length;
|
|
60
|
+
if (source.agg === 'min')
|
|
61
|
+
return Math.min(...nums);
|
|
62
|
+
return Math.max(...nums); // 'max'
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=kpi-rollup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kpi-rollup.js","sourceRoot":"","sources":["../../../src/services/kpi-rollup.ts"],"names":[],"mappings":"AAwCA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAS,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAEpE,4GAA4G;AAC5G,MAAM,UAAU,eAAe,CAAC,MAAe;IAC7C,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACxD,MAAM,CAAC,GAAG,MAAiC,CAAC;IAC5C,OAAO,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAa,CAAC,CAAC;AAC1F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAuB,EACvB,WAAsB,EACtB,IAAY,EACZ,MAAwB;IAExB,kGAAkG;IAClG,8FAA8F;IAC9F,mGAAmG;IACnG,MAAM,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC;IACjH,MAAM,SAAS,GAAG,OAAO,EAAE,EAAE,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CA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,CAAC"}
|
|
@@ -32,6 +32,13 @@
|
|
|
32
32
|
* stamps it; the workspace UI groups all spaces sharing a contract into one unit). Open schema,
|
|
33
33
|
* so it was always accepted — listed for clarity. Seed version bumped 2→3 so the stored system
|
|
34
34
|
* schema upgrades in place.
|
|
35
|
+
* v1.5.0 -- 2026-06-23 -- Measurability convention (domain-agnostic): optional top-level
|
|
36
|
+
* `objectives[]` (why + measurable KPIs: kind/unit/target/source, where source is a string recipe
|
|
37
|
+
* or a `{from:'records',...}` aggregation over the organism's own records) and an optional
|
|
38
|
+
* objectType `servesObjective` linking a space to the objective it feeds. Schema stays `open` so
|
|
39
|
+
* absent objectives stay valid, but the defined subschema enforces the kind/op enums when present.
|
|
40
|
+
* Seed version bumped 3→4 so the stored system schema upgrades in place. Design:
|
|
41
|
+
* docs/internal/2026-06-23-organism-measurability-design.md.
|
|
35
42
|
*/
|
|
36
43
|
import type { Storage } from '../storage/interface.js';
|
|
37
44
|
/** Wildcard keyPattern (prefix mode) — matches `organism.{anyId}.meta.manifest` for every organism. */
|
|
@@ -51,7 +58,7 @@ export declare const MANIFEST_WS_SCHEMA_KEY = "organism.*.w.*.meta.manifest";
|
|
|
51
58
|
*/
|
|
52
59
|
/** Bump when the seeded schema changes in a way existing nodes must pick up (e.g. the backing
|
|
53
60
|
* enum). seedManifestSchema() upgrades any system-seeded record carrying an older version. */
|
|
54
|
-
export declare const MANIFEST_SEED_VERSION =
|
|
61
|
+
export declare const MANIFEST_SEED_VERSION = 4;
|
|
55
62
|
export declare const MANIFEST_FORMAT_SCHEMA: Record<string, unknown>;
|
|
56
63
|
/** Seed version of a stored schema record: parsed from the `$comment: aimeat-seed-vN` marker.
|
|
57
64
|
* Records seeded before versioning existed (no marker) count as v1. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-schema.d.ts","sourceRoot":"","sources":["../../../src/services/manifest-schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"manifest-schema.d.ts","sourceRoot":"","sources":["../../../src/services/manifest-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,uGAAuG;AACvG,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAC9D;qGACqG;AACrG,eAAO,MAAM,sBAAsB,iCAAiC,CAAC;AAErE;;;;;;;;;GASG;AACH;+FAC+F;AAC/F,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAgG1D,CAAC;AAEF;wEACwE;AACxE,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAI9F;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwB5F"}
|
|
@@ -15,7 +15,7 @@ export const MANIFEST_WS_SCHEMA_KEY = 'organism.*.w.*.meta.manifest';
|
|
|
15
15
|
*/
|
|
16
16
|
/** Bump when the seeded schema changes in a way existing nodes must pick up (e.g. the backing
|
|
17
17
|
* enum). seedManifestSchema() upgrades any system-seeded record carrying an older version. */
|
|
18
|
-
export const MANIFEST_SEED_VERSION =
|
|
18
|
+
export const MANIFEST_SEED_VERSION = 4;
|
|
19
19
|
export const MANIFEST_FORMAT_SCHEMA = {
|
|
20
20
|
// Standard JSON Schema annotation (safe under ajv strict mode) doubling as the seed-version
|
|
21
21
|
// marker — seededVersionOf() parses it to decide whether a stored record needs the upgrade.
|
|
@@ -58,6 +58,53 @@ export const MANIFEST_FORMAT_SCHEMA = {
|
|
|
58
58
|
append: { type: 'boolean' },
|
|
59
59
|
versioned: { type: 'boolean' }, // draft → publish → .version.N + .latest history (default true)
|
|
60
60
|
contract: { type: 'string' }, // optional contract id a provisioning agent stamps; the workspace UI groups all spaces sharing a contract into one unit
|
|
61
|
+
servesObjective: { type: 'string' }, // optional: id of an objectives[] entry this space feeds (measurability convention)
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
// Measurability convention (all optional; domain-agnostic — units are the domain's: € of timber,
|
|
66
|
+
// viable plots, confirmed hypotheses, closed deals). The subschema enforces the kind/op enums when
|
|
67
|
+
// present, while the open envelope keeps a manifest with no objectives valid. See
|
|
68
|
+
// docs/internal/2026-06-23-organism-measurability-design.md.
|
|
69
|
+
objectives: {
|
|
70
|
+
type: 'array',
|
|
71
|
+
items: {
|
|
72
|
+
type: 'object',
|
|
73
|
+
required: ['id', 'statement'],
|
|
74
|
+
properties: {
|
|
75
|
+
id: { type: 'string' }, // stable slug, referenced by objectType.servesObjective
|
|
76
|
+
statement: { type: 'string' }, // what this is for
|
|
77
|
+
why: { type: 'string' }, // why it matters now
|
|
78
|
+
status: { enum: ['active', 'met', 'abandoned'] },
|
|
79
|
+
kpis: {
|
|
80
|
+
type: 'array',
|
|
81
|
+
items: {
|
|
82
|
+
type: 'object',
|
|
83
|
+
required: ['name'],
|
|
84
|
+
properties: {
|
|
85
|
+
name: { type: 'string' },
|
|
86
|
+
kind: { enum: ['value', 'cost', 'roi', 'outcome', 'quality'] },
|
|
87
|
+
unit: { type: 'string' }, // the domain's unit (EUR, count, minutes, %, …)
|
|
88
|
+
target: {
|
|
89
|
+
type: 'object',
|
|
90
|
+
properties: {
|
|
91
|
+
op: { enum: ['<', '<=', '>', '>=', '==', 'between'] },
|
|
92
|
+
value: { type: 'number' },
|
|
93
|
+
values: { type: 'array', items: { type: 'number' } }, // for op: 'between'
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
// string recipe (human/agent-readable, NOT auto-evaluated in v1) OR an aggregation object
|
|
97
|
+
// { from:'records', space, agg:'sum'|'count'|'avg'|'min'|'max', field, equals? } over the
|
|
98
|
+
// organism's own published records. (Agent-ops sources telemetry/wallet/quota are a fenced
|
|
99
|
+
// appendix — see the design doc §5 — and not enabled in this build.)
|
|
100
|
+
source: { type: ['string', 'object'] },
|
|
101
|
+
of: { type: 'object' }, // for kind:'roi' — { value:'<kpiName>', cost:'<kpiName>' }
|
|
102
|
+
current: { type: 'number' }, // last-known value (cache, not history)
|
|
103
|
+
measuredAt: { type: 'string' },
|
|
104
|
+
measuredBy: { type: 'string' },
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
61
108
|
},
|
|
62
109
|
},
|
|
63
110
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-schema.js","sourceRoot":"","sources":["../../../src/services/manifest-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-schema.js","sourceRoot":"","sources":["../../../src/services/manifest-schema.ts"],"names":[],"mappings":"AA4CA,uGAAuG;AACvG,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAC9D;qGACqG;AACrG,MAAM,CAAC,MAAM,sBAAsB,GAAG,8BAA8B,CAAC;AAErE;;;;;;;;;GASG;AACH;+FAC+F;AAC/F,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,MAAM,CAAC,MAAM,sBAAsB,GAA4B;IAC7D,4FAA4F;IAC5F,4FAA4F;IAC5F,QAAQ,EAAE,gBAAgB,qBAAqB,EAAE;IACjD,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC;IAC5E,UAAU,EAAE;QACV,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACnC,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,I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C,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,OAAgB,EAAE,QAAgB;IACzE,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,UAAU,IAAI,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,EAAE,CAAC;QACvE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC/D,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,QAAQ,CAAC,QAAQ,KAAK,QAAQ;gBAAE,SAAS,CAA6B,kCAAkC;YAC5G,IAAI,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,qBAAqB;gBAAE,SAAS,CAAE,kBAAkB;YAChG,MAAM,OAAO,CAAC,SAAS,CAAC,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;YACjH,MAAM,EAAE,CAAC;YACT,SAAS;QACX,CAAC;QACD,MAAM,OAAO,CAAC,SAAS,CAAC;YACtB,UAAU;YACV,OAAO,EAAE,QAAQ;YACjB,UAAU,EAAE,sBAAsB;YAClC,UAAU,EAAE,MAAM;YAClB,QAAQ;YACR,KAAK,EAAE,GAAG;YACV,SAAS,EAAE,GAAG;SACf,CAAC,CAAC;QACH,MAAM,EAAE,CAAC;IACX,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file secretary.ts
|
|
3
|
+
* @description Provisioning + lookup for the per-owner Secretary agent (Phase 0). The Secretary is a
|
|
4
|
+
* special GAII agent (`secretary#<owner>@<node>`) auto-provisioned when the owner configures
|
|
5
|
+
* OpenRouter — no device-auth dance. It is tagged `system:secretary` + `unlisted` so it shows in
|
|
6
|
+
* the owner's Agents tab but never appears in the public catalogue/directory. Scopes come from the
|
|
7
|
+
* conservative `secretary` profile (mcp/catalog/scopes.ts). Idempotent: ensureSecretary only
|
|
8
|
+
* creates when absent. Full design: docs/plans/2026-06-23-secretary-feature.md.
|
|
9
|
+
* @structure SECRETARY_AGENT_NAME · UNLISTED_TAG · SECRETARY_ROLE_TAG · secretaryGaii() ·
|
|
10
|
+
* getSecretary() · ensureSecretary()
|
|
11
|
+
* @usage await ensureSecretary(storage, config, ownerName) // after the OpenRouter key is saved
|
|
12
|
+
* @version-history v0.1.0 — 2026-06-23 — Phase 0: Secretary identity + auto-provisioning
|
|
13
|
+
*/
|
|
14
|
+
import type { AimeatConfig } from '../config.js';
|
|
15
|
+
import type { Storage, AgentRecord } from '../storage/interface.js';
|
|
16
|
+
/** Reserved bare name for the per-owner Secretary agent (exactly one per owner). */
|
|
17
|
+
export declare const SECRETARY_AGENT_NAME = "secretary";
|
|
18
|
+
/** Tag that hides an agent from the public catalogue/directory (kept generic for future system agents). */
|
|
19
|
+
export declare const UNLISTED_TAG = "unlisted";
|
|
20
|
+
/** Tag identifying the Secretary system role (so the owner's UI can find/pin it). */
|
|
21
|
+
export declare const SECRETARY_ROLE_TAG = "system:secretary";
|
|
22
|
+
/** The Secretary GAII for an owner: bare owner name → `secretary#owner@node`. */
|
|
23
|
+
export declare function secretaryGaii(ownerName: string, config: AimeatConfig): string;
|
|
24
|
+
/** Fetch the owner's Secretary agent record, or null if not yet provisioned. */
|
|
25
|
+
export declare function getSecretary(storage: Storage, config: AimeatConfig, ownerName: string): Promise<AgentRecord | null>;
|
|
26
|
+
/**
|
|
27
|
+
* Ensure the owner has a Secretary agent. Idempotent — returns the existing record if present,
|
|
28
|
+
* otherwise provisions one. The Secretary acts server-side on the owner's behalf and does not hold
|
|
29
|
+
* a JWT yet, so the generated private key is intentionally discarded in Phase 0 (a keypair is only
|
|
30
|
+
* created because `publicKey` is a required field); JWT/device wiring is a later phase.
|
|
31
|
+
*/
|
|
32
|
+
export declare function ensureSecretary(storage: Storage, config: AimeatConfig, ownerName: string): Promise<AgentRecord>;
|
|
33
|
+
//# sourceMappingURL=secretary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secretary.d.ts","sourceRoot":"","sources":["../../../src/services/secretary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAOpE,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAChD,2GAA2G;AAC3G,eAAO,MAAM,YAAY,aAAa,CAAC;AACvC,qFAAqF;AACrF,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAE7E;AAED,gFAAgF;AAChF,wBAAsB,YAAY,CAChC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAE7B;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,CAAC,CAoCtB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { buildGAII } from '../utils/gaii.js';
|
|
2
|
+
import { generateKeyPair } from '../auth/keypair.js';
|
|
3
|
+
import { scopesForProfile } from '../mcp/catalog/scopes.js';
|
|
4
|
+
import { emitChange } from './event-bus.js';
|
|
5
|
+
import { logger } from '../utils/logger.js';
|
|
6
|
+
/** Reserved bare name for the per-owner Secretary agent (exactly one per owner). */
|
|
7
|
+
export const SECRETARY_AGENT_NAME = 'secretary';
|
|
8
|
+
/** Tag that hides an agent from the public catalogue/directory (kept generic for future system agents). */
|
|
9
|
+
export const UNLISTED_TAG = 'unlisted';
|
|
10
|
+
/** Tag identifying the Secretary system role (so the owner's UI can find/pin it). */
|
|
11
|
+
export const SECRETARY_ROLE_TAG = 'system:secretary';
|
|
12
|
+
/** The Secretary GAII for an owner: bare owner name → `secretary#owner@node`. */
|
|
13
|
+
export function secretaryGaii(ownerName, config) {
|
|
14
|
+
return buildGAII(SECRETARY_AGENT_NAME, ownerName, config.nodeId);
|
|
15
|
+
}
|
|
16
|
+
/** Fetch the owner's Secretary agent record, or null if not yet provisioned. */
|
|
17
|
+
export async function getSecretary(storage, config, ownerName) {
|
|
18
|
+
return storage.getAgent(secretaryGaii(ownerName, config));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Ensure the owner has a Secretary agent. Idempotent — returns the existing record if present,
|
|
22
|
+
* otherwise provisions one. The Secretary acts server-side on the owner's behalf and does not hold
|
|
23
|
+
* a JWT yet, so the generated private key is intentionally discarded in Phase 0 (a keypair is only
|
|
24
|
+
* created because `publicKey` is a required field); JWT/device wiring is a later phase.
|
|
25
|
+
*/
|
|
26
|
+
export async function ensureSecretary(storage, config, ownerName) {
|
|
27
|
+
const gaii = secretaryGaii(ownerName, config);
|
|
28
|
+
const existing = await storage.getAgent(gaii);
|
|
29
|
+
if (existing)
|
|
30
|
+
return existing;
|
|
31
|
+
const { publicKey } = await generateKeyPair();
|
|
32
|
+
const now = new Date().toISOString();
|
|
33
|
+
const record = {
|
|
34
|
+
name: SECRETARY_AGENT_NAME,
|
|
35
|
+
owner: ownerName,
|
|
36
|
+
gaii,
|
|
37
|
+
displayName: 'Secretary',
|
|
38
|
+
description: 'Your personal AIMEAT secretary.',
|
|
39
|
+
capabilities: [],
|
|
40
|
+
publicKey,
|
|
41
|
+
trustScore: 50,
|
|
42
|
+
morselBalance: 0,
|
|
43
|
+
createdAt: now,
|
|
44
|
+
lastSeen: now,
|
|
45
|
+
defaultScopes: scopesForProfile('secretary'),
|
|
46
|
+
mode: 'interactive',
|
|
47
|
+
tags: [SECRETARY_ROLE_TAG, UNLISTED_TAG],
|
|
48
|
+
};
|
|
49
|
+
try {
|
|
50
|
+
await storage.createAgent(record);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
// Lost a provisioning race (two concurrent key saves) — the other create won; reuse it.
|
|
54
|
+
const again = await storage.getAgent(gaii);
|
|
55
|
+
if (again)
|
|
56
|
+
return again;
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
emitChange('agents', gaii);
|
|
60
|
+
logger.info('[secretary] provisioned', { gaii });
|
|
61
|
+
return record;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=secretary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secretary.js","sourceRoot":"","sources":["../../../src/services/secretary.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,oFAAoF;AACpF,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAChD,2GAA2G;AAC3G,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,qFAAqF;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAErD,iFAAiF;AACjF,MAAM,UAAU,aAAa,CAAC,SAAiB,EAAE,MAAoB;IACnE,OAAO,SAAS,CAAC,oBAAoB,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Q,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC;QACxB,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC3B,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACjD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
* fidelity (each workspace a ## section with its spaces' recent ids+titles) instead of a
|
|
26
26
|
* count-only breakdown — shared spaceLines() renders both, so the org view is navigable to a
|
|
27
27
|
* record id, not a lossy splat.
|
|
28
|
+
* v1.2.0 — 2026-06-23 — Measurability: a workspace manifest's `objectives[]` are surfaced in the
|
|
29
|
+
* summary + rendered as an "Objectives" block (KPI current vs target). A `from:'records'` KPI's
|
|
30
|
+
* `current` is computed from the workspace's own published records via kpi-rollup; a string-recipe
|
|
31
|
+
* KPI shows its declared `current`. Design: docs/internal/2026-06-23-organism-measurability-design.md.
|
|
28
32
|
*/
|
|
29
33
|
import type { Storage } from '../storage/interface.js';
|
|
30
34
|
import type { AimeatConfig } from '../config.js';
|
|
@@ -42,12 +46,35 @@ interface SpaceSummary {
|
|
|
42
46
|
total: number;
|
|
43
47
|
recent: SpaceEntry[];
|
|
44
48
|
}
|
|
49
|
+
/** One KPI, with `current` resolved: computed from records (when `source` is `from:'records'`) or the
|
|
50
|
+
* declared value otherwise. `target`/`unit`/`kind` echo the manifest declaration. */
|
|
51
|
+
export interface KpiSummary {
|
|
52
|
+
name: string;
|
|
53
|
+
kind?: string;
|
|
54
|
+
unit?: string;
|
|
55
|
+
target?: {
|
|
56
|
+
op?: string;
|
|
57
|
+
value?: number;
|
|
58
|
+
values?: number[];
|
|
59
|
+
};
|
|
60
|
+
current: number | null;
|
|
61
|
+
computed: boolean;
|
|
62
|
+
measuredAt?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface ObjectiveSummary {
|
|
65
|
+
id: string;
|
|
66
|
+
statement?: string;
|
|
67
|
+
why?: string;
|
|
68
|
+
status?: string;
|
|
69
|
+
kpis: KpiSummary[];
|
|
70
|
+
}
|
|
45
71
|
export interface WorkspaceSummary {
|
|
46
72
|
ws: string;
|
|
47
73
|
name: string;
|
|
48
74
|
readme: string | null;
|
|
49
75
|
readable: boolean;
|
|
50
76
|
spaces: SpaceSummary[];
|
|
77
|
+
objectives: ObjectiveSummary[];
|
|
51
78
|
totalRecords: number;
|
|
52
79
|
totalDocuments: number;
|
|
53
80
|
lastActivity: string | null;
|