Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/docs/references/ai/agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const result = AIKnowledge.parse(data);
| **instructions** | `string` | ✅ | System Prompt / Prime Directives |
| **model** | `Object` | optional | |
| **lifecycle** | `Object` | optional | State machine defining the agent conversation follow and constraints |
| **surface** | `Enum<'ask' \| 'build'>` | ✅ | Product surface this agent binds ('ask' | 'build') — ADR-0063 §1 |
| **surface** | `Enum<'ask' \| 'build'>` | ✅ | Product surface this agent binds ('ask' \| 'build') — ADR-0063 §1 |
| **skills** | `string[]` | optional | Skill names to attach (Agent→Skill→Tool architecture) |
| **tools** | `Object[]` | optional | Direct tool references (legacy fallback) |
| **knowledge** | `Object` | optional | RAG access |
Expand All @@ -92,8 +92,8 @@ const result = AIKnowledge.parse(data);
| **protection** | `Object` | optional | Package author protection block — lock policy for this agent. |
| **_lock** | `Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>` | optional | Item-level lock — controls overlay & delete (ADR-0010). |
| **_lockReason** | `string` | optional | Human-readable reason shown when a write is refused by _lock. |
| **_lockSource** | `Enum<'artifact' \| 'package' \| 'env-forced'>` | optional | Layer that set _lock (artifact | package | env-forced). |
| **_provenance** | `Enum<'package' \| 'org' \| 'env-forced'>` | optional | Origin of the item (package | org | env-forced). |
| **_lockSource** | `Enum<'artifact' \| 'package' \| 'env-forced'>` | optional | Layer that set _lock (artifact \| package \| env-forced). |
| **_provenance** | `Enum<'package' \| 'org' \| 'env-forced'>` | optional | Origin of the item (package \| org \| env-forced). |
| **_packageId** | `string` | optional | Owning package machine id. |
| **_packageVersion** | `string` | optional | Owning package version. |
| **_lockDocsUrl** | `string` | optional | Optional documentation link surfaced next to _lockReason. |
Expand Down
48 changes: 46 additions & 2 deletions content/docs/references/ai/model-registry.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Enables AI-powered ObjectStack applications to discover and use LLMs consistentl
## TypeScript Usage

```typescript
import { ModelCapability, ModelConfig, ModelLimits, ModelPricing, ModelProvider, ModelRegistryEntry, ModelSelectionCriteria, PromptVariable } from '@objectstack/spec/ai';
import type { ModelCapability, ModelConfig, ModelLimits, ModelPricing, ModelProvider, ModelRegistryEntry, ModelSelectionCriteria, PromptVariable } from '@objectstack/spec/ai';
import { ModelCapability, ModelConfig, ModelLimits, ModelPricing, ModelProvider, ModelRegistry, ModelRegistryEntry, ModelSelectionCriteria, PromptTemplate, PromptVariable } from '@objectstack/spec/ai';
import type { ModelCapability, ModelConfig, ModelLimits, ModelPricing, ModelProvider, ModelRegistry, ModelRegistryEntry, ModelSelectionCriteria, PromptTemplate, PromptVariable } from '@objectstack/spec/ai';

// Validate data
const result = ModelCapability.parse(data);
Expand Down Expand Up @@ -111,6 +111,21 @@ const result = ModelCapability.parse(data);
* `custom`


---

## ModelRegistry

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **name** | `string` | ✅ | Registry name |
| **models** | `Record<string, Object>` | ✅ | Model entries by ID |
| **promptTemplates** | `Record<string, Object>` | optional | Prompt templates by name |
| **defaultModel** | `string` | optional | Default model ID |
| **enableAutoFallback** | `boolean` | optional | Auto-fallback on errors |


---

## ModelRegistryEntry
Expand Down Expand Up @@ -142,6 +157,35 @@ const result = ModelCapability.parse(data);
| **excludeDeprecated** | `boolean` | ✅ | |


---

## PromptTemplate

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique template identifier |
| **name** | `string` | ✅ | Template name (snake_case) |
| **label** | `string` | ✅ | Display name |
| **system** | `string \| Object` | optional | System prompt — supports `{{var}`} interpolation |
| **user** | `string \| Object` | ✅ | User prompt template — supports `{{var}`} interpolation |
| **assistant** | `string` | optional | Assistant message prefix |
| **variables** | `Object[]` | optional | Template variables |
| **modelId** | `string` | optional | Recommended model ID |
| **temperature** | `number` | optional | |
| **maxTokens** | `number` | optional | |
| **topP** | `number` | optional | |
| **frequencyPenalty** | `number` | optional | |
| **presencePenalty** | `number` | optional | |
| **stopSequences** | `string[]` | optional | |
| **version** | `string` | optional | |
| **description** | `string` | optional | |
| **category** | `string` | optional | Template category (e.g., "code_generation", "support") |
| **tags** | `string[]` | optional | |
| **examples** | `Object[]` | optional | |


---

## PromptVariable
Expand Down
6 changes: 3 additions & 3 deletions content/docs/references/ai/skill.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const result = Skill.parse(data);
| **name** | `string` | ✅ | Skill unique identifier (snake_case) |
| **label** | `string` | ✅ | Skill display name |
| **description** | `string` | optional | Skill description |
| **surface** | `Enum<'ask' \| 'build' \| 'both'>` | ✅ | Agent surface this skill binds to ('ask' | 'build' | 'both') — ADR-0063 §3 |
| **surface** | `Enum<'ask' \| 'build' \| 'both'>` | ✅ | Agent surface this skill binds to ('ask' \| 'build' \| 'both') — ADR-0063 §3 |
| **instructions** | `string` | optional | LLM instructions when skill is active |
| **tools** | `string[]` | ✅ | Tool names belonging to this skill (supports trailing wildcard, e.g. `action_*`) |
| **triggerPhrases** | `string[]` | optional | Phrases that activate this skill |
Expand All @@ -46,8 +46,8 @@ const result = Skill.parse(data);
| **protection** | `Object` | optional | Package author protection block — lock policy for this skill. |
| **_lock** | `Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>` | optional | Item-level lock — controls overlay & delete (ADR-0010). |
| **_lockReason** | `string` | optional | Human-readable reason shown when a write is refused by _lock. |
| **_lockSource** | `Enum<'artifact' \| 'package' \| 'env-forced'>` | optional | Layer that set _lock (artifact | package | env-forced). |
| **_provenance** | `Enum<'package' \| 'org' \| 'env-forced'>` | optional | Origin of the item (package | org | env-forced). |
| **_lockSource** | `Enum<'artifact' \| 'package' \| 'env-forced'>` | optional | Layer that set _lock (artifact \| package \| env-forced). |
| **_provenance** | `Enum<'package' \| 'org' \| 'env-forced'>` | optional | Origin of the item (package \| org \| env-forced). |
| **_packageId** | `string` | optional | Owning package machine id. |
| **_packageVersion** | `string` | optional | Owning package version. |
| **_lockDocsUrl** | `string` | optional | Optional documentation link surfaced next to _lockReason. |
Expand Down
4 changes: 2 additions & 2 deletions content/docs/references/ai/tool.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const result = Tool.parse(data);
| **protection** | `Object` | optional | Package author protection block — lock policy for this tool. |
| **_lock** | `Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>` | optional | Item-level lock — controls overlay & delete (ADR-0010). |
| **_lockReason** | `string` | optional | Human-readable reason shown when a write is refused by _lock. |
| **_lockSource** | `Enum<'artifact' \| 'package' \| 'env-forced'>` | optional | Layer that set _lock (artifact | package | env-forced). |
| **_provenance** | `Enum<'package' \| 'org' \| 'env-forced'>` | optional | Origin of the item (package | org | env-forced). |
| **_lockSource** | `Enum<'artifact' \| 'package' \| 'env-forced'>` | optional | Layer that set _lock (artifact \| package \| env-forced). |
| **_provenance** | `Enum<'package' \| 'org' \| 'env-forced'>` | optional | Origin of the item (package \| org \| env-forced). |
| **_packageId** | `string` | optional | Owning package machine id. |
| **_packageVersion** | `string` | optional | Owning package version. |
| **_lockDocsUrl** | `string` | optional | Optional documentation link surfaced next to _lockReason. |
Expand Down
91 changes: 89 additions & 2 deletions content/docs/references/api/automation-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ GET /api/automation/:name/runs/:runId — Get single execution run
## TypeScript Usage

```typescript
import { AutomationApiErrorCode, AutomationFlowPathParams, AutomationRunPathParams, DeleteFlowRequest, DeleteFlowResponse, FlowSummary, GetFlowRequest, GetRunRequest, GetRunResponse, ListFlowsRequest, ListFlowsResponse, ListRunsRequest, ListRunsResponse, ToggleFlowRequest, ToggleFlowResponse, TriggerFlowRequest, TriggerFlowResponse } from '@objectstack/spec/api';
import type { AutomationApiErrorCode, AutomationFlowPathParams, AutomationRunPathParams, DeleteFlowRequest, DeleteFlowResponse, FlowSummary, GetFlowRequest, GetRunRequest, GetRunResponse, ListFlowsRequest, ListFlowsResponse, ListRunsRequest, ListRunsResponse, ToggleFlowRequest, ToggleFlowResponse, TriggerFlowRequest, TriggerFlowResponse } from '@objectstack/spec/api';
import { AutomationApiErrorCode, AutomationFlowPathParams, AutomationRunPathParams, CreateFlowRequest, CreateFlowResponse, DeleteFlowRequest, DeleteFlowResponse, FlowSummary, GetFlowRequest, GetFlowResponse, GetRunRequest, GetRunResponse, ListFlowsRequest, ListFlowsResponse, ListRunsRequest, ListRunsResponse, ToggleFlowRequest, ToggleFlowResponse, TriggerFlowRequest, TriggerFlowResponse, UpdateFlowRequest, UpdateFlowResponse } from '@objectstack/spec/api';
import type { AutomationApiErrorCode, AutomationFlowPathParams, AutomationRunPathParams, CreateFlowRequest, CreateFlowResponse, DeleteFlowRequest, DeleteFlowResponse, FlowSummary, GetFlowRequest, GetFlowResponse, GetRunRequest, GetRunResponse, ListFlowsRequest, ListFlowsResponse, ListRunsRequest, ListRunsResponse, ToggleFlowRequest, ToggleFlowResponse, TriggerFlowRequest, TriggerFlowResponse, UpdateFlowRequest, UpdateFlowResponse } from '@objectstack/spec/api';

// Validate data
const result = AutomationApiErrorCode.parse(data);
Expand Down Expand Up @@ -87,6 +87,53 @@ const result = AutomationApiErrorCode.parse(data);
| **runId** | `string` | ✅ | Execution run ID |


---

## CreateFlowRequest

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **name** | `string` | ✅ | Machine name |
| **label** | `string` | ✅ | Flow label |
| **description** | `string` | optional | |
| **successMessage** | `string` | optional | Toast shown when a screen flow completes (defaults to a generic "Done"). |
| **errorMessage** | `string` | optional | Toast shown when a screen flow fails (defaults to the raw error). |
| **version** | `integer` | optional | Version number |
| **status** | `Enum<'draft' \| 'active' \| 'obsolete' \| 'invalid'>` | optional | Deployment status |
| **template** | `boolean` | optional | Is logic template (Subflow) |
| **type** | `Enum<'autolaunched' \| 'record_change' \| 'schedule' \| 'screen' \| 'api'>` | ✅ | Flow type |
| **variables** | `Object[]` | optional | Flow variables |
| **nodes** | `Object[]` | ✅ | Flow nodes |
| **edges** | `Object[]` | ✅ | Flow connections |
| **active** | `boolean` | optional | Is active (Deprecated: use status) |
| **runAs** | `Enum<'system' \| 'user'>` | optional | Execution identity for the run: system = elevated (bypasses RLS), user = the triggering user (RLS-respecting). A schedule-triggered run has no trigger user, so under user it runs UNSCOPED (elevated) — declare system to make that explicit. |
| **errorHandling** | `Object` | optional | Flow-level error handling configuration |
| **protection** | `Object` | optional | Package author protection block — lock policy for this flow. |
| **_lock** | `Enum<'none' \| 'no-overlay' \| 'no-delete' \| 'full'>` | optional | Item-level lock — controls overlay & delete (ADR-0010). |
| **_lockReason** | `string` | optional | Human-readable reason shown when a write is refused by _lock. |
| **_lockSource** | `Enum<'artifact' \| 'package' \| 'env-forced'>` | optional | Layer that set _lock (artifact \| package \| env-forced). |
| **_provenance** | `Enum<'package' \| 'org' \| 'env-forced'>` | optional | Origin of the item (package \| org \| env-forced). |
| **_packageId** | `string` | optional | Owning package machine id. |
| **_packageVersion** | `string` | optional | Owning package version. |
| **_lockDocsUrl** | `string` | optional | Optional documentation link surfaced next to _lockReason. |


---

## CreateFlowResponse

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **success** | `boolean` | ✅ | Operation success status |
| **error** | `Object` | optional | Error details if success is false |
| **meta** | `Object` | optional | Response metadata |
| **data** | `Object` | ✅ | The created flow definition |


---

## DeleteFlowRequest
Expand Down Expand Up @@ -141,6 +188,20 @@ const result = AutomationApiErrorCode.parse(data);
| **name** | `string` | ✅ | Flow machine name (snake_case) |


---

## GetFlowResponse

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **success** | `boolean` | ✅ | Operation success status |
| **error** | `Object` | optional | Error details if success is false |
| **meta** | `Object` | optional | Response metadata |
| **data** | `Object` | ✅ | Full flow definition |


---

## GetRunRequest
Expand Down Expand Up @@ -281,3 +342,29 @@ const result = AutomationApiErrorCode.parse(data);

---

## UpdateFlowRequest

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **name** | `string` | ✅ | Flow machine name (snake_case) |
| **definition** | `Object` | ✅ | Partial flow definition to update |


---

## UpdateFlowResponse

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **success** | `boolean` | ✅ | Operation success status |
| **error** | `Object` | optional | Error details if success is false |
| **meta** | `Object` | optional | Response metadata |
| **data** | `Object` | ✅ | The updated flow definition |


---

48 changes: 46 additions & 2 deletions content/docs/references/api/export.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Base path: /api/v1/data/\{object\}/export
## TypeScript Usage

```typescript
import { CreateExportJobRequest, CreateExportJobResponse, CreateImportJobRequest, CreateImportJobResponse, DeduplicationStrategy, ExportFormat, ExportImportTemplate, ExportJobProgress, ExportJobStatus, ExportJobSummary, FieldMappingEntry, GetExportJobDownloadRequest, GetExportJobDownloadResponse, ImportJobProgress, ImportJobResults, ImportJobStatus, ImportJobSummary, ImportMapping, ImportRequest, ImportResponse, ImportRowResult, ImportValidationConfig, ImportValidationMode, ImportValidationResult, ImportWriteMode, ListExportJobsRequest, ListExportJobsResponse, ListImportJobsRequest, ListImportJobsResponse, ScheduleExportResponse, UndoImportJobResponse } from '@objectstack/spec/api';
import type { CreateExportJobRequest, CreateExportJobResponse, CreateImportJobRequest, CreateImportJobResponse, DeduplicationStrategy, ExportFormat, ExportImportTemplate, ExportJobProgress, ExportJobStatus, ExportJobSummary, FieldMappingEntry, GetExportJobDownloadRequest, GetExportJobDownloadResponse, ImportJobProgress, ImportJobResults, ImportJobStatus, ImportJobSummary, ImportMapping, ImportRequest, ImportResponse, ImportRowResult, ImportValidationConfig, ImportValidationMode, ImportValidationResult, ImportWriteMode, ListExportJobsRequest, ListExportJobsResponse, ListImportJobsRequest, ListImportJobsResponse, ScheduleExportResponse, UndoImportJobResponse } from '@objectstack/spec/api';
import { CreateExportJobRequest, CreateExportJobResponse, CreateImportJobRequest, CreateImportJobResponse, DeduplicationStrategy, ExportFormat, ExportImportTemplate, ExportJobProgress, ExportJobStatus, ExportJobSummary, FieldMappingEntry, GetExportJobDownloadRequest, GetExportJobDownloadResponse, ImportJobProgress, ImportJobResults, ImportJobStatus, ImportJobSummary, ImportMapping, ImportRequest, ImportResponse, ImportRowResult, ImportValidationConfig, ImportValidationMode, ImportValidationResult, ImportWriteMode, ListExportJobsRequest, ListExportJobsResponse, ListImportJobsRequest, ListImportJobsResponse, ScheduleExportRequest, ScheduleExportResponse, ScheduledExport, UndoImportJobResponse } from '@objectstack/spec/api';
import type { CreateExportJobRequest, CreateExportJobResponse, CreateImportJobRequest, CreateImportJobResponse, DeduplicationStrategy, ExportFormat, ExportImportTemplate, ExportJobProgress, ExportJobStatus, ExportJobSummary, FieldMappingEntry, GetExportJobDownloadRequest, GetExportJobDownloadResponse, ImportJobProgress, ImportJobResults, ImportJobStatus, ImportJobSummary, ImportMapping, ImportRequest, ImportResponse, ImportRowResult, ImportValidationConfig, ImportValidationMode, ImportValidationResult, ImportWriteMode, ListExportJobsRequest, ListExportJobsResponse, ListImportJobsRequest, ListImportJobsResponse, ScheduleExportRequest, ScheduleExportResponse, ScheduledExport, UndoImportJobResponse } from '@objectstack/spec/api';

// Validate data
const result = CreateExportJobRequest.parse(data);
Expand Down Expand Up @@ -518,6 +518,25 @@ Type: `Object[]`
| **jobs** | `Object[]` | ✅ | Import jobs, newest first |


---

## ScheduleExportRequest

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **name** | `string` | ✅ | Schedule name (snake_case) |
| **label** | `string` | optional | Human-readable label |
| **object** | `string` | ✅ | Object name to export |
| **format** | `Enum<'csv' \| 'json' \| 'jsonl' \| 'xlsx' \| 'parquet'>` | optional | Export file format |
| **fields** | `string[]` | optional | Fields to include |
| **filter** | `Record<string, any>` | optional | Record filter criteria |
| **templateId** | `string` | optional | Export template ID for field mappings |
| **schedule** | `Object` | ✅ | Schedule timing configuration |
| **delivery** | `Object` | ✅ | Export delivery configuration |


---

## ScheduleExportResponse
Expand All @@ -532,6 +551,31 @@ Type: `Object[]`
| **data** | `Object` | ✅ | |


---

## ScheduledExport

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | optional | Scheduled export ID |
| **name** | `string` | ✅ | Schedule name (snake_case) |
| **label** | `string` | optional | Human-readable label |
| **object** | `string` | ✅ | Object name to export |
| **format** | `Enum<'csv' \| 'json' \| 'jsonl' \| 'xlsx' \| 'parquet'>` | optional | Export file format |
| **fields** | `string[]` | optional | Fields to include |
| **filter** | `Record<string, any>` | optional | Record filter criteria |
| **templateId** | `string` | optional | Export template ID for field mappings |
| **schedule** | `Object` | ✅ | Schedule timing configuration |
| **delivery** | `Object` | ✅ | Export delivery configuration |
| **enabled** | `boolean` | optional | Whether the scheduled export is active |
| **lastRunAt** | `string` | optional | Last execution timestamp |
| **nextRunAt** | `string` | optional | Next scheduled execution |
| **createdAt** | `string` | optional | Creation timestamp |
| **createdBy** | `string` | optional | User who created the schedule |


---

## UndoImportJobResponse
Expand Down
Loading