Skip to content

Commit 1583ed4

Browse files
refactor: remove spec-layer tool/skill instances, keep single source in service-ai
Addresses architectural review: tool instances (concrete data) and skill instances don't belong in @objectstack/spec (protocol layer). Tool definitions + handlers are co-located in service-ai/src/tools/metadata-tools.ts (matching data-tools.ts pattern). Removed: - packages/spec/src/ai/metadata-tools.zod.ts - packages/spec/src/ai/metadata-skill.zod.ts - packages/spec/src/ai/metadata-tools.test.ts - packages/spec/src/ai/metadata-skill.test.ts - Reverted packages/spec/src/ai/index.ts to original Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/9ff609c9-f085-43bf-8f1f-3aaa3cad09f6 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent a1194c5 commit 1583ed4

7 files changed

Lines changed: 10 additions & 761 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
absent, fixing the CI `@objectstack/client#test` failure.
1616

1717
### Added
18-
- **Metadata Management Tools & Skill (Tool→Skill→Agent)** — Added 6 platform built-in AI
19-
tools for metadata operations (`create_object`, `add_field`, `modify_field`, `delete_field`,
20-
`list_objects`, `describe_object`):
21-
- **Protocol definitions** in `packages/spec/src/ai/metadata-tools.zod.ts` and
22-
`metadata-skill.zod.ts` — Zod-validated tool schemas with JSON Schema parameters,
23-
output schemas, permission controls, and `metadata_management` skill aggregation.
24-
- **Runtime implementation** in `packages/services/service-ai/src/tools/metadata-tools.ts`
25-
Actual `ToolHandler` functions that call `IMetadataService` CRUD methods (`register`,
26-
`getObject`, `listObjects`) to create objects, add/modify/delete fields, and inspect
27-
schemas. Registered via `registerMetadataTools(registry, { metadataService })`.
28-
- 55 unit tests across spec (26) and service-ai (29) covering schema validation, handler
29-
execution, error handling, full create→add→modify→delete lifecycle, and edge cases.
18+
- **Metadata Management Tools (`service-ai`)** — Added 6 built-in AI tools for metadata
19+
CRUD operations in `packages/services/service-ai/src/tools/metadata-tools.ts`:
20+
`create_object`, `add_field`, `modify_field`, `delete_field`, `list_objects`,
21+
`describe_object`. Tool definitions (`AIToolDefinition`) and `ToolHandler` implementations
22+
live together in a single file (matching the `data-tools.ts` pattern). Handlers call
23+
`IMetadataService` CRUD methods (`register`, `getObject`, `listObjects`).
24+
Registered via `registerMetadataTools(registry, { metadataService })`.
25+
29 unit tests covering handler execution, input validation, error handling, and a full
26+
create→add→modify→delete→describe lifecycle.
3027
- **Agent Skills — `skills/` directory (agentskills.io)** — Created `skills/` folder at
3128
repository root following the [agentskills.io specification](https://agentskills.io/specification).
3229
Five expert-knowledge skills with hand-written `SKILL.md` files and `references/` quick-lookup

ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ Objects now declare `namespace: 'sys'` and a short `name` (e.g., `name: 'user'`)
663663
- [ ] Agent runtime — execute AI agents defined in spec schemas
664664
- [x] Tool registry — connect agents to ObjectQL operations, APIs, and workflows (initial implementation in `service-ai`)
665665
- [x] Conversation management — persistent chat with context windows (initial implementation in `service-ai`)
666-
- [x] Metadata management tools — 6 built-in tools (`create_object`, `add_field`, `modify_field`, `delete_field`, `list_objects`, `describe_object`) with protocol definitions (`@objectstack/spec`) and runtime handlers (`@objectstack/service-ai`) registered via `registerMetadataTools()`
666+
- [x] Metadata management tools — 6 built-in tools (`create_object`, `add_field`, `modify_field`, `delete_field`, `list_objects`, `describe_object`) with tool definitions and runtime handlers co-located in `service-ai/src/tools/metadata-tools.ts`, registered via `registerMetadataTools()`
667667

668668
### 7.3 RAG Pipeline
669669

packages/spec/src/ai/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
export * from './agent.zod';
2424
export * from './tool.zod';
2525
export * from './skill.zod';
26-
export * from './metadata-tools.zod';
27-
export * from './metadata-skill.zod';
2826
export * from './agent-action.zod';
2927
export * from './devops-agent.zod';
3028
export * from './plugin-development.zod';

packages/spec/src/ai/metadata-skill.test.ts

Lines changed: 0 additions & 73 deletions
This file was deleted.

packages/spec/src/ai/metadata-skill.zod.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

packages/spec/src/ai/metadata-tools.test.ts

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)