@treeseed/sdk 0.1.1 → 0.3.0
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/README.md +97 -494
- package/dist/{src/cli-tools.d.ts → cli-tools.d.ts} +1 -1
- package/dist/cli-tools.js +5 -3
- package/dist/{src/content-store.d.ts → content-store.d.ts} +3 -2
- package/dist/content-store.js +52 -20
- package/dist/{src/d1-store.d.ts → d1-store.d.ts} +62 -1
- package/dist/d1-store.js +625 -65
- package/dist/field-aliases.d.ts +11 -0
- package/dist/field-aliases.js +41 -0
- package/dist/graph/build.d.ts +19 -0
- package/dist/graph/build.js +949 -0
- package/dist/graph/dsl.d.ts +2 -0
- package/dist/graph/dsl.js +243 -0
- package/dist/graph/query.d.ts +47 -0
- package/dist/graph/query.js +447 -0
- package/dist/graph/ranking.d.ts +3 -0
- package/dist/graph/ranking.js +483 -0
- package/dist/graph/schema.d.ts +142 -0
- package/dist/graph/schema.js +133 -0
- package/dist/graph.d.ts +52 -0
- package/dist/graph.js +133 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +90 -2
- package/dist/model-registry.d.ts +8 -0
- package/dist/model-registry.js +351 -25
- package/dist/operations/providers/default.d.ts +10 -0
- package/dist/operations/providers/default.js +514 -0
- package/dist/operations/runtime.d.ts +7 -0
- package/dist/operations/runtime.js +60 -0
- package/dist/operations/services/config-runtime.d.ts +269 -0
- package/dist/operations/services/config-runtime.js +1397 -0
- package/dist/operations/services/d1-migration.d.ts +6 -0
- package/dist/operations/services/d1-migration.js +89 -0
- package/dist/operations/services/deploy.d.ts +371 -0
- package/dist/operations/services/deploy.js +981 -0
- package/dist/operations/services/git-workflow.d.ts +49 -0
- package/dist/operations/services/git-workflow.js +218 -0
- package/dist/operations/services/github-automation.d.ts +156 -0
- package/dist/operations/services/github-automation.js +256 -0
- package/dist/operations/services/local-dev.d.ts +9 -0
- package/dist/operations/services/local-dev.js +106 -0
- package/dist/operations/services/mailpit-runtime.d.ts +4 -0
- package/dist/operations/services/mailpit-runtime.js +59 -0
- package/dist/operations/services/railway-deploy.d.ts +53 -0
- package/dist/operations/services/railway-deploy.js +123 -0
- package/dist/operations/services/runtime-paths.d.ts +19 -0
- package/dist/operations/services/runtime-paths.js +54 -0
- package/dist/operations/services/runtime-tools.d.ts +117 -0
- package/dist/operations/services/runtime-tools.js +358 -0
- package/dist/operations/services/save-deploy-preflight.d.ts +34 -0
- package/dist/operations/services/save-deploy-preflight.js +76 -0
- package/dist/operations/services/template-registry.d.ts +88 -0
- package/dist/operations/services/template-registry.js +407 -0
- package/dist/operations/services/watch-dev.d.ts +21 -0
- package/dist/operations/services/watch-dev.js +284 -0
- package/dist/operations/services/workspace-preflight.d.ts +40 -0
- package/dist/operations/services/workspace-preflight.js +165 -0
- package/dist/operations/services/workspace-save.d.ts +42 -0
- package/dist/operations/services/workspace-save.js +235 -0
- package/dist/operations/services/workspace-tools.d.ts +16 -0
- package/dist/operations/services/workspace-tools.js +270 -0
- package/dist/operations-registry.d.ts +5 -0
- package/dist/operations-registry.js +68 -0
- package/dist/operations-types.d.ts +71 -0
- package/dist/operations-types.js +17 -0
- package/dist/operations.d.ts +6 -0
- package/dist/operations.js +16 -0
- package/dist/platform/books-data.d.ts +1 -0
- package/dist/platform/books-data.js +1 -0
- package/dist/platform/contracts.d.ts +158 -0
- package/dist/platform/contracts.js +0 -0
- package/dist/platform/deploy/config.d.ts +4 -0
- package/dist/platform/deploy/config.js +222 -0
- package/dist/platform/deploy-config.d.ts +1 -0
- package/dist/platform/deploy-config.js +1 -0
- package/dist/platform/env.yaml +394 -0
- package/dist/platform/environment.d.ts +130 -0
- package/dist/platform/environment.js +331 -0
- package/dist/platform/plugin.d.ts +2 -0
- package/dist/platform/plugin.js +4 -0
- package/dist/platform/plugins/constants.d.ts +22 -0
- package/dist/platform/plugins/constants.js +29 -0
- package/dist/platform/plugins/plugin.d.ts +51 -0
- package/dist/platform/plugins/plugin.js +6 -0
- package/dist/platform/plugins/runtime.d.ts +35 -0
- package/dist/platform/plugins/runtime.js +142 -0
- package/dist/platform/plugins.d.ts +5 -0
- package/dist/platform/plugins.js +16 -0
- package/dist/platform/site-config-schema.js +1 -0
- package/dist/platform/tenant/config.d.ts +9 -0
- package/dist/platform/tenant/config.js +154 -0
- package/dist/platform/tenant/runtime-config.d.ts +4 -0
- package/dist/platform/tenant/runtime-config.js +20 -0
- package/dist/platform/tenant-config.d.ts +1 -0
- package/dist/platform/tenant-config.js +1 -0
- package/dist/platform/utils/books-data.d.ts +29 -0
- package/dist/platform/utils/books-data.js +82 -0
- package/dist/platform/utils/site-config-schema.js +321 -0
- package/dist/remote.d.ts +175 -0
- package/dist/remote.js +202 -0
- package/dist/runtime.js +50 -3
- package/dist/scripts/aggregate-book.js +121 -0
- package/dist/scripts/build-dist.js +57 -13
- package/dist/scripts/build-tenant-worker.js +36 -0
- package/dist/scripts/cleanup-markdown.js +373 -0
- package/dist/scripts/cli-test-fixtures.js +48 -0
- package/dist/scripts/config-treeseed.js +95 -0
- package/dist/scripts/ensure-mailpit.js +29 -0
- package/dist/scripts/local-dev.js +129 -0
- package/dist/scripts/logs-mailpit.js +2 -0
- package/dist/scripts/patch-starlight-content-path.js +172 -0
- package/dist/scripts/release-verify.js +34 -5
- package/dist/scripts/run-fixture-astro-command.js +18 -0
- package/dist/scripts/scaffold-site.js +65 -0
- package/dist/scripts/stop-mailpit.js +5 -0
- package/dist/scripts/sync-dev-vars.js +6 -0
- package/dist/scripts/sync-template.js +20 -0
- package/dist/scripts/template-catalog.test.js +100 -0
- package/dist/scripts/template-command.js +31 -0
- package/dist/scripts/tenant-astro-command.js +3 -0
- package/dist/scripts/tenant-build.js +16 -0
- package/dist/scripts/tenant-check.js +7 -0
- package/dist/scripts/tenant-d1-migrate-local.js +11 -0
- package/dist/scripts/tenant-deploy.js +180 -0
- package/dist/scripts/tenant-destroy.js +104 -0
- package/dist/scripts/tenant-dev.js +171 -0
- package/dist/scripts/tenant-lint.js +4 -0
- package/dist/scripts/tenant-test.js +4 -0
- package/dist/scripts/test-cloudflare-local.js +212 -0
- package/dist/scripts/test-scaffold.js +314 -0
- package/dist/scripts/test-smoke.js +71 -13
- package/dist/scripts/treeseed-assert-release-tag-version.js +21 -0
- package/dist/scripts/treeseed-build-dist.js +134 -0
- package/dist/scripts/treeseed-publish-package.js +19 -0
- package/dist/scripts/treeseed-release-verify.js +131 -0
- package/dist/scripts/treeseed-run-ts.js +45 -0
- package/dist/scripts/validate-templates.js +6 -0
- package/dist/scripts/verify-driver.js +29 -0
- package/dist/scripts/workflow-commands.test.js +39 -0
- package/dist/scripts/workspace-close.js +24 -0
- package/dist/scripts/workspace-command-e2e.js +718 -0
- package/dist/scripts/workspace-lint.js +9 -0
- package/dist/scripts/workspace-preflight.js +22 -0
- package/dist/scripts/workspace-publish-changed-packages.js +16 -0
- package/dist/scripts/workspace-release-verify.js +81 -0
- package/dist/scripts/workspace-release.js +42 -0
- package/dist/scripts/workspace-save.js +124 -0
- package/dist/scripts/workspace-start-warning.js +3 -0
- package/dist/scripts/workspace-start.js +71 -0
- package/dist/scripts/workspace-test-unit.js +4 -0
- package/dist/scripts/workspace-test.js +11 -0
- package/dist/sdk-fields.d.ts +11 -0
- package/dist/sdk-fields.js +169 -0
- package/dist/sdk-filters.d.ts +4 -0
- package/dist/sdk-filters.js +12 -15
- package/dist/sdk-types.d.ts +796 -0
- package/dist/sdk-types.js +7 -1
- package/dist/sdk-version.d.ts +2 -0
- package/dist/sdk-version.js +42 -0
- package/dist/sdk.d.ts +215 -0
- package/dist/sdk.js +235 -11
- package/dist/stores/cursor-store.js +9 -3
- package/dist/stores/lease-store.js +8 -2
- package/dist/{src/stores → stores}/message-store.d.ts +1 -1
- package/dist/stores/message-store.js +27 -3
- package/dist/stores/operational-store.d.ts +24 -0
- package/dist/stores/operational-store.js +279 -0
- package/dist/stores/run-store.js +8 -1
- package/dist/stores/subscription-store.js +7 -5
- package/dist/template-catalog.d.ts +13 -0
- package/dist/template-catalog.js +141 -0
- package/dist/treeseed/services/compose.yml +7 -0
- package/dist/treeseed/template-catalog/catalog.fixture.json +55 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/astro.config.d.ts +2 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/astro.config.ts +3 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/package.json +32 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/config.yaml +40 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/empty/.gitkeep +1 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/knowledge/handbook/index.mdx +11 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content/pages/welcome.mdx +11 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content.config.d.ts +1 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/content.config.ts +3 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/env.yaml +1 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/manifest.yaml +19 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/treeseed.site.yaml +26 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/tsconfig.json +9 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template.config.json +90 -0
- package/dist/verification.d.ts +20 -0
- package/dist/verification.js +98 -0
- package/dist/workflow/operations.d.ts +396 -0
- package/dist/workflow/operations.js +841 -0
- package/dist/workflow-state.d.ts +56 -0
- package/dist/workflow-state.js +195 -0
- package/dist/workflow-support.d.ts +9 -0
- package/dist/workflow-support.js +176 -0
- package/dist/workflow.d.ts +111 -0
- package/dist/workflow.js +97 -0
- package/package.json +97 -5
- package/scripts/verify-driver.mjs +29 -0
- package/dist/scripts/.ts-run-1775616845195-odh4xzphk3l.js +0 -22
- package/dist/scripts/.ts-run-1775616848931-9386s6kwrl.js +0 -126
- package/dist/scripts/assert-release-tag-version.d.ts +0 -1
- package/dist/scripts/build-dist.d.ts +0 -1
- package/dist/scripts/package-tools.d.ts +0 -15
- package/dist/scripts/publish-package.d.ts +0 -1
- package/dist/scripts/release-verify.d.ts +0 -1
- package/dist/scripts/test-smoke.d.ts +0 -1
- package/dist/src/index.d.ts +0 -6
- package/dist/src/model-registry.d.ts +0 -4
- package/dist/src/sdk-filters.d.ts +0 -4
- package/dist/src/sdk-types.d.ts +0 -285
- package/dist/src/sdk.d.ts +0 -109
- package/dist/test/test-fixture.d.ts +0 -1
- package/dist/test/utils/envelopes.test.d.ts +0 -1
- package/dist/test/utils/sdk.test.d.ts +0 -1
- package/dist/vitest.config.d.ts +0 -2
- /package/dist/{src/frontmatter.d.ts → frontmatter.d.ts} +0 -0
- /package/dist/{src/git-runtime.d.ts → git-runtime.d.ts} +0 -0
- /package/dist/{src/runtime.d.ts → runtime.d.ts} +0 -0
- /package/dist/{src/stores → stores}/cursor-store.d.ts +0 -0
- /package/dist/{src/stores → stores}/envelopes.d.ts +0 -0
- /package/dist/{src/stores → stores}/helpers.d.ts +0 -0
- /package/dist/{src/stores → stores}/lease-store.d.ts +0 -0
- /package/dist/{src/stores → stores}/run-store.d.ts +0 -0
- /package/dist/{src/stores → stores}/subscription-store.d.ts +0 -0
- /package/dist/{src/types → types}/agents.d.ts +0 -0
- /package/dist/{src/types → types}/cloudflare.d.ts +0 -0
- /package/dist/{src/wrangler-d1.d.ts → wrangler-d1.d.ts} +0 -0
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
import type { TreeseedFieldAliasBinding } from './field-aliases.ts';
|
|
2
|
+
export declare const SDK_MODEL_NAMES: readonly ["page", "note", "question", "book", "knowledge", "objective", "person", "subscription", "message", "agent", "agent_run", "agent_cursor", "content_lease", "work_day", "task", "task_event", "task_output", "graph_run", "report"];
|
|
3
|
+
export declare const SDK_OPERATIONS: readonly ["get", "read", "search", "follow", "pick", "create", "update"];
|
|
4
|
+
export declare const SDK_STORAGE_BACKENDS: readonly ["content", "d1"];
|
|
5
|
+
export declare const SDK_PICK_STRATEGIES: readonly ["latest", "highest_priority", "oldest"];
|
|
6
|
+
export type SdkBuiltinModelName = (typeof SDK_MODEL_NAMES)[number];
|
|
7
|
+
export type SdkModelName = SdkBuiltinModelName | (string & {});
|
|
8
|
+
export type SdkOperation = (typeof SDK_OPERATIONS)[number];
|
|
9
|
+
export type SdkStorageBackend = (typeof SDK_STORAGE_BACKENDS)[number];
|
|
10
|
+
export type SdkPickStrategy = (typeof SDK_PICK_STRATEGIES)[number];
|
|
11
|
+
export type SdkComparableAs = 'string' | 'number' | 'date' | 'boolean' | 'string_array';
|
|
12
|
+
export type SdkFilterOperator = 'eq' | 'in' | 'contains' | 'prefix' | 'gt' | 'gte' | 'lt' | 'lte' | 'updated_since' | 'related_to';
|
|
13
|
+
export type TreeseedSchemaVersion = number;
|
|
14
|
+
export type TreeseedRuntimeRecordType = 'subscription' | 'contact_submission' | 'agent_run' | 'message' | 'agent_cursor' | 'content_lease' | 'work_day' | 'task' | 'task_event' | 'task_output' | 'graph_run' | 'report';
|
|
15
|
+
export interface TreeseedRecordEnvelope<TPayload, TMeta = Record<string, unknown>> {
|
|
16
|
+
recordType: TreeseedRuntimeRecordType;
|
|
17
|
+
schemaVersion: TreeseedSchemaVersion;
|
|
18
|
+
status: string;
|
|
19
|
+
payload: TPayload;
|
|
20
|
+
meta: TMeta;
|
|
21
|
+
}
|
|
22
|
+
export interface TreeseedSubscriptionPayload {
|
|
23
|
+
email: string;
|
|
24
|
+
name: string | null;
|
|
25
|
+
source: string;
|
|
26
|
+
consentAt: string | null;
|
|
27
|
+
ipHash: string;
|
|
28
|
+
}
|
|
29
|
+
export interface TreeseedSubscriptionMeta {
|
|
30
|
+
legacyId?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface TreeseedContactSubmissionPayload {
|
|
33
|
+
name: string;
|
|
34
|
+
email: string;
|
|
35
|
+
organization: string | null;
|
|
36
|
+
contactType: string;
|
|
37
|
+
subject: string;
|
|
38
|
+
message: string;
|
|
39
|
+
userAgent: string;
|
|
40
|
+
ipHash: string;
|
|
41
|
+
}
|
|
42
|
+
export interface TreeseedContactSubmissionMeta {
|
|
43
|
+
source?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface TreeseedAgentRunPayload {
|
|
46
|
+
triggerSource: string;
|
|
47
|
+
handlerKind?: string | null;
|
|
48
|
+
triggerKind?: string | null;
|
|
49
|
+
selectedItemKey: string | null;
|
|
50
|
+
selectedMessageId: number | null;
|
|
51
|
+
claimedMessageId?: number | null;
|
|
52
|
+
branchName: string | null;
|
|
53
|
+
prUrl: string | null;
|
|
54
|
+
summary: string | null;
|
|
55
|
+
error: string | null;
|
|
56
|
+
errorCategory?: string | null;
|
|
57
|
+
commitSha?: string | null;
|
|
58
|
+
changedPaths?: string[];
|
|
59
|
+
finishedAt: string | null;
|
|
60
|
+
}
|
|
61
|
+
export interface TreeseedAgentRunMeta {
|
|
62
|
+
runId: string;
|
|
63
|
+
agentSlug: string;
|
|
64
|
+
}
|
|
65
|
+
export interface TreeseedMessagePayload {
|
|
66
|
+
body: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
export interface TreeseedMessageMeta {
|
|
69
|
+
actor?: string;
|
|
70
|
+
trace?: Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
export interface TreeseedCursorPayload {
|
|
73
|
+
cursorValue: string;
|
|
74
|
+
}
|
|
75
|
+
export interface TreeseedCursorMeta {
|
|
76
|
+
updatedBy?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface TreeseedLeasePayload {
|
|
79
|
+
token: string;
|
|
80
|
+
}
|
|
81
|
+
export interface TreeseedLeaseMeta {
|
|
82
|
+
actor?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface SdkFilterCondition {
|
|
85
|
+
field: string;
|
|
86
|
+
op: SdkFilterOperator;
|
|
87
|
+
value: unknown;
|
|
88
|
+
}
|
|
89
|
+
export interface SdkSortSpec {
|
|
90
|
+
field: string;
|
|
91
|
+
direction?: 'asc' | 'desc';
|
|
92
|
+
}
|
|
93
|
+
export interface SdkJsonEnvelope<TPayload> {
|
|
94
|
+
ok: boolean;
|
|
95
|
+
model: SdkModelName;
|
|
96
|
+
operation: SdkOperation;
|
|
97
|
+
payload: TPayload;
|
|
98
|
+
meta?: Record<string, unknown>;
|
|
99
|
+
}
|
|
100
|
+
export interface SdkMessageEntity {
|
|
101
|
+
[key: string]: unknown;
|
|
102
|
+
id: number;
|
|
103
|
+
recordType?: TreeseedRuntimeRecordType;
|
|
104
|
+
schemaVersion?: TreeseedSchemaVersion;
|
|
105
|
+
type: string;
|
|
106
|
+
status: string;
|
|
107
|
+
payloadJson: string;
|
|
108
|
+
metaJson?: string;
|
|
109
|
+
relatedModel: string | null;
|
|
110
|
+
relatedId: string | null;
|
|
111
|
+
priority: number;
|
|
112
|
+
availableAt: string;
|
|
113
|
+
claimedBy: string | null;
|
|
114
|
+
claimedAt: string | null;
|
|
115
|
+
leaseExpiresAt: string | null;
|
|
116
|
+
attempts: number;
|
|
117
|
+
maxAttempts: number;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
updatedAt: string;
|
|
120
|
+
}
|
|
121
|
+
export interface SdkRunEntity {
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
runId: string;
|
|
124
|
+
recordType?: TreeseedRuntimeRecordType;
|
|
125
|
+
schemaVersion?: TreeseedSchemaVersion;
|
|
126
|
+
agentSlug: string;
|
|
127
|
+
handlerKind?: string | null;
|
|
128
|
+
triggerKind?: string | null;
|
|
129
|
+
triggerSource: string;
|
|
130
|
+
claimedMessageId?: number | null;
|
|
131
|
+
status: string;
|
|
132
|
+
selectedItemKey: string | null;
|
|
133
|
+
selectedMessageId: number | null;
|
|
134
|
+
branchName: string | null;
|
|
135
|
+
commitSha?: string | null;
|
|
136
|
+
changedPaths?: string[];
|
|
137
|
+
prUrl: string | null;
|
|
138
|
+
summary: string | null;
|
|
139
|
+
error: string | null;
|
|
140
|
+
errorCategory?: string | null;
|
|
141
|
+
startedAt: string;
|
|
142
|
+
finishedAt: string | null;
|
|
143
|
+
}
|
|
144
|
+
export interface SdkCursorEntity {
|
|
145
|
+
[key: string]: unknown;
|
|
146
|
+
recordType?: TreeseedRuntimeRecordType;
|
|
147
|
+
schemaVersion?: TreeseedSchemaVersion;
|
|
148
|
+
agentSlug: string;
|
|
149
|
+
cursorKey: string;
|
|
150
|
+
cursorValue: string;
|
|
151
|
+
updatedAt: string | null;
|
|
152
|
+
}
|
|
153
|
+
export interface SdkLeaseEntity {
|
|
154
|
+
[key: string]: unknown;
|
|
155
|
+
recordType?: TreeseedRuntimeRecordType;
|
|
156
|
+
schemaVersion?: TreeseedSchemaVersion;
|
|
157
|
+
model: string;
|
|
158
|
+
itemKey: string;
|
|
159
|
+
claimedBy: string;
|
|
160
|
+
claimedAt: string;
|
|
161
|
+
leaseExpiresAt: string;
|
|
162
|
+
token: string;
|
|
163
|
+
}
|
|
164
|
+
export interface SdkSubscriptionEntity {
|
|
165
|
+
[key: string]: unknown;
|
|
166
|
+
id?: number;
|
|
167
|
+
recordType?: TreeseedRuntimeRecordType;
|
|
168
|
+
schemaVersion?: TreeseedSchemaVersion;
|
|
169
|
+
email: string;
|
|
170
|
+
name?: string | null;
|
|
171
|
+
status: string;
|
|
172
|
+
source?: string;
|
|
173
|
+
metaJson?: string;
|
|
174
|
+
consent_at?: string;
|
|
175
|
+
created_at?: string;
|
|
176
|
+
updated_at?: string;
|
|
177
|
+
ip_hash?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface SdkAgentSpec {
|
|
180
|
+
[key: string]: unknown;
|
|
181
|
+
id: string;
|
|
182
|
+
slug: string;
|
|
183
|
+
title?: string;
|
|
184
|
+
body: string;
|
|
185
|
+
frontmatter: Record<string, unknown>;
|
|
186
|
+
}
|
|
187
|
+
export interface SdkWorkDayEntity {
|
|
188
|
+
[key: string]: unknown;
|
|
189
|
+
id: string;
|
|
190
|
+
projectId: string;
|
|
191
|
+
state: string;
|
|
192
|
+
capacityBudget: number;
|
|
193
|
+
capacityUsed: number;
|
|
194
|
+
graphVersion: string | null;
|
|
195
|
+
summaryJson: string | null;
|
|
196
|
+
startedAt: string;
|
|
197
|
+
endedAt: string | null;
|
|
198
|
+
createdAt: string;
|
|
199
|
+
updatedAt: string;
|
|
200
|
+
}
|
|
201
|
+
export interface SdkTaskEntity {
|
|
202
|
+
[key: string]: unknown;
|
|
203
|
+
id: string;
|
|
204
|
+
workDayId: string;
|
|
205
|
+
agentId: string;
|
|
206
|
+
type: string;
|
|
207
|
+
state: string;
|
|
208
|
+
priority: number;
|
|
209
|
+
idempotencyKey: string;
|
|
210
|
+
payloadJson: string;
|
|
211
|
+
payloadHash: string | null;
|
|
212
|
+
attemptCount: number;
|
|
213
|
+
maxAttempts: number;
|
|
214
|
+
claimedBy: string | null;
|
|
215
|
+
leaseExpiresAt: string | null;
|
|
216
|
+
availableAt: string;
|
|
217
|
+
lastErrorCode: string | null;
|
|
218
|
+
lastErrorMessage: string | null;
|
|
219
|
+
graphVersion: string | null;
|
|
220
|
+
parentTaskId: string | null;
|
|
221
|
+
createdAt: string;
|
|
222
|
+
startedAt: string | null;
|
|
223
|
+
completedAt: string | null;
|
|
224
|
+
updatedAt: string;
|
|
225
|
+
}
|
|
226
|
+
export interface SdkTaskEventEntity {
|
|
227
|
+
[key: string]: unknown;
|
|
228
|
+
id: string;
|
|
229
|
+
taskId: string;
|
|
230
|
+
seq: number;
|
|
231
|
+
kind: string;
|
|
232
|
+
dataJson: string;
|
|
233
|
+
createdAt: string;
|
|
234
|
+
}
|
|
235
|
+
export interface SdkTaskOutputEntity {
|
|
236
|
+
[key: string]: unknown;
|
|
237
|
+
id: string;
|
|
238
|
+
taskId: string;
|
|
239
|
+
outputJson: string;
|
|
240
|
+
outputRef: string | null;
|
|
241
|
+
createdAt: string;
|
|
242
|
+
}
|
|
243
|
+
export interface SdkGraphRunEntity {
|
|
244
|
+
[key: string]: unknown;
|
|
245
|
+
id: string;
|
|
246
|
+
workDayId: string;
|
|
247
|
+
corpusHash: string;
|
|
248
|
+
graphVersion: string;
|
|
249
|
+
queryJson?: string | null;
|
|
250
|
+
seedIdsJson?: string | null;
|
|
251
|
+
selectedNodeIdsJson?: string | null;
|
|
252
|
+
statsJson: string | null;
|
|
253
|
+
snapshotRef: string | null;
|
|
254
|
+
createdAt: string;
|
|
255
|
+
}
|
|
256
|
+
export interface SdkReportEntity {
|
|
257
|
+
[key: string]: unknown;
|
|
258
|
+
id: string;
|
|
259
|
+
workDayId: string;
|
|
260
|
+
kind: string;
|
|
261
|
+
bodyJson: string;
|
|
262
|
+
renderedRef: string | null;
|
|
263
|
+
sentAt: string | null;
|
|
264
|
+
createdAt: string;
|
|
265
|
+
}
|
|
266
|
+
export interface SdkContentEntry {
|
|
267
|
+
id: string;
|
|
268
|
+
slug: string;
|
|
269
|
+
model: SdkModelName;
|
|
270
|
+
title?: string;
|
|
271
|
+
path: string;
|
|
272
|
+
body: string;
|
|
273
|
+
frontmatter: Record<string, unknown>;
|
|
274
|
+
updatedAt: string | null;
|
|
275
|
+
createdAt: string | null;
|
|
276
|
+
}
|
|
277
|
+
export interface SdkSearchRequest {
|
|
278
|
+
model: SdkModelName;
|
|
279
|
+
filters?: SdkFilterCondition[];
|
|
280
|
+
sort?: SdkSortSpec[];
|
|
281
|
+
limit?: number;
|
|
282
|
+
cursor?: string | null;
|
|
283
|
+
}
|
|
284
|
+
export interface SdkGetRequest {
|
|
285
|
+
model: SdkModelName;
|
|
286
|
+
id?: string;
|
|
287
|
+
slug?: string;
|
|
288
|
+
key?: string;
|
|
289
|
+
}
|
|
290
|
+
export interface SdkFollowRequest {
|
|
291
|
+
model: SdkModelName;
|
|
292
|
+
since: string;
|
|
293
|
+
filters?: SdkFilterCondition[];
|
|
294
|
+
timeoutSeconds?: number;
|
|
295
|
+
}
|
|
296
|
+
export interface SdkPickRequest {
|
|
297
|
+
model: SdkModelName;
|
|
298
|
+
strategy?: SdkPickStrategy;
|
|
299
|
+
filters?: SdkFilterCondition[];
|
|
300
|
+
leaseSeconds: number;
|
|
301
|
+
workerId: string;
|
|
302
|
+
}
|
|
303
|
+
export interface SdkMutationRequest {
|
|
304
|
+
model: SdkModelName;
|
|
305
|
+
data: Record<string, unknown>;
|
|
306
|
+
actor: string;
|
|
307
|
+
}
|
|
308
|
+
export interface SdkUpdateRequest extends SdkMutationRequest {
|
|
309
|
+
id?: string;
|
|
310
|
+
slug?: string;
|
|
311
|
+
key?: string;
|
|
312
|
+
expectedVersion?: string;
|
|
313
|
+
}
|
|
314
|
+
export interface SdkModelFieldBinding extends TreeseedFieldAliasBinding {
|
|
315
|
+
aliases?: string[];
|
|
316
|
+
contentKeys?: string[];
|
|
317
|
+
dbColumns?: string[];
|
|
318
|
+
payloadPaths?: string[];
|
|
319
|
+
writeContentKey?: string;
|
|
320
|
+
writeDbColumn?: string;
|
|
321
|
+
filterable?: boolean;
|
|
322
|
+
sortable?: boolean;
|
|
323
|
+
comparableAs?: SdkComparableAs;
|
|
324
|
+
normalize?: (value: unknown) => unknown;
|
|
325
|
+
}
|
|
326
|
+
export interface SdkModelDefinition {
|
|
327
|
+
name: SdkModelName;
|
|
328
|
+
aliases: string[];
|
|
329
|
+
storage: SdkStorageBackend;
|
|
330
|
+
operations: SdkOperation[];
|
|
331
|
+
fields: Record<string, SdkModelFieldBinding>;
|
|
332
|
+
filterableFields: string[];
|
|
333
|
+
sortableFields: string[];
|
|
334
|
+
pickField: string;
|
|
335
|
+
contentCollection?: string;
|
|
336
|
+
contentDir?: string;
|
|
337
|
+
graph?: SdkGraphModelConfig;
|
|
338
|
+
}
|
|
339
|
+
export type SdkModelRegistry = Record<string, SdkModelDefinition>;
|
|
340
|
+
export type SdkGraphNodeType = 'File' | 'Section' | 'Agent' | 'Objective' | 'Question' | 'Note' | 'Knowledge' | 'Book' | 'Page' | 'Person' | 'Tag' | 'Series' | 'Reference' | 'Entity';
|
|
341
|
+
export type SdkGraphEdgeType = 'HAS_SECTION' | 'BELONGS_TO_FILE' | 'PARENT_SECTION' | 'CHILD_SECTION' | 'NEXT_SECTION' | 'PREV_SECTION' | 'LINKS_TO' | 'REFERENCES' | 'MENTIONS' | 'HAS_TAG' | 'IN_SERIES' | 'SAME_DIRECTORY' | 'SAME_COLLECTION' | 'DEFINES' | 'DEFINED_BY' | 'RELATES_TO' | 'DEPENDS_ON' | 'IMPLEMENTS' | 'EXTENDS' | 'SUPERSEDES' | 'BELONGS_TO' | 'ABOUT' | 'USED_BY' | 'GENERATED_FROM';
|
|
342
|
+
export interface SdkGraphReferenceFieldConfig {
|
|
343
|
+
field: string;
|
|
344
|
+
edgeType?: Exclude<SdkGraphEdgeType, 'HAS_SECTION' | 'BELONGS_TO_FILE' | 'PARENT_SECTION' | 'CHILD_SECTION' | 'NEXT_SECTION' | 'PREV_SECTION' | 'LINKS_TO' | 'MENTIONS' | 'SAME_DIRECTORY' | 'SAME_COLLECTION' | 'DEFINES' | 'DEFINED_BY'>;
|
|
345
|
+
targetModels?: string[];
|
|
346
|
+
multiple?: boolean;
|
|
347
|
+
}
|
|
348
|
+
export interface SdkGraphModelConfig {
|
|
349
|
+
entityType?: SdkGraphNodeType;
|
|
350
|
+
referenceFields?: SdkGraphReferenceFieldConfig[];
|
|
351
|
+
tagField?: string;
|
|
352
|
+
seriesField?: string;
|
|
353
|
+
titleField?: string;
|
|
354
|
+
enableSections?: boolean;
|
|
355
|
+
}
|
|
356
|
+
export interface SdkGraphRefreshRequest {
|
|
357
|
+
paths?: string[];
|
|
358
|
+
}
|
|
359
|
+
export interface SdkGraphQueryOptions {
|
|
360
|
+
limit?: number;
|
|
361
|
+
models?: string[];
|
|
362
|
+
nodeTypes?: SdkGraphNodeType[];
|
|
363
|
+
edgeTypes?: SdkGraphEdgeType[];
|
|
364
|
+
direction?: 'outgoing' | 'incoming' | 'both';
|
|
365
|
+
depth?: number;
|
|
366
|
+
scoreThreshold?: number;
|
|
367
|
+
maxNodes?: number;
|
|
368
|
+
cycleDetection?: boolean;
|
|
369
|
+
edgeWeights?: Partial<Record<SdkGraphEdgeType, number>>;
|
|
370
|
+
}
|
|
371
|
+
export interface SdkGraphSearchOptions extends SdkGraphQueryOptions {
|
|
372
|
+
prefix?: boolean;
|
|
373
|
+
fuzzy?: number | boolean;
|
|
374
|
+
}
|
|
375
|
+
export interface SdkResolveReferenceOptions {
|
|
376
|
+
fromNodeId?: string;
|
|
377
|
+
fromPath?: string;
|
|
378
|
+
models?: string[];
|
|
379
|
+
}
|
|
380
|
+
export interface SdkGraphNode {
|
|
381
|
+
id: string;
|
|
382
|
+
nodeType: SdkGraphNodeType;
|
|
383
|
+
sourceModel?: string;
|
|
384
|
+
entityType?: string;
|
|
385
|
+
ownerFileId?: string;
|
|
386
|
+
path?: string;
|
|
387
|
+
slug?: string;
|
|
388
|
+
title?: string;
|
|
389
|
+
heading?: string | null;
|
|
390
|
+
headingPath?: string | null;
|
|
391
|
+
level?: number | null;
|
|
392
|
+
text?: string;
|
|
393
|
+
tags?: string[];
|
|
394
|
+
series?: string | null;
|
|
395
|
+
fileId?: string;
|
|
396
|
+
entityId?: string;
|
|
397
|
+
status?: string | null;
|
|
398
|
+
canonical?: boolean;
|
|
399
|
+
canonicalId?: string | null;
|
|
400
|
+
version?: string | null;
|
|
401
|
+
domain?: string | null;
|
|
402
|
+
audience?: string[];
|
|
403
|
+
updatedAt?: string | null;
|
|
404
|
+
data?: Record<string, unknown>;
|
|
405
|
+
}
|
|
406
|
+
export interface SdkGraphEdge {
|
|
407
|
+
id: string;
|
|
408
|
+
type: SdkGraphEdgeType;
|
|
409
|
+
sourceId: string;
|
|
410
|
+
targetId: string;
|
|
411
|
+
ownerFileId?: string;
|
|
412
|
+
data?: Record<string, unknown>;
|
|
413
|
+
}
|
|
414
|
+
export interface SdkGraphSearchResult {
|
|
415
|
+
node: SdkGraphNode;
|
|
416
|
+
score: number;
|
|
417
|
+
reason: string;
|
|
418
|
+
highlights?: string[];
|
|
419
|
+
context?: Record<string, unknown>;
|
|
420
|
+
}
|
|
421
|
+
export interface SdkGraphRankingDiagnostics {
|
|
422
|
+
providerId: string;
|
|
423
|
+
lexicalScore: number;
|
|
424
|
+
graphScore: number;
|
|
425
|
+
priorScore: number;
|
|
426
|
+
canonicalityScore: number;
|
|
427
|
+
freshnessScore: number;
|
|
428
|
+
stageScore: number;
|
|
429
|
+
finalScore: number;
|
|
430
|
+
}
|
|
431
|
+
export interface SdkGraphTraversalResult {
|
|
432
|
+
seedId: string;
|
|
433
|
+
nodes: SdkGraphNode[];
|
|
434
|
+
edges: SdkGraphEdge[];
|
|
435
|
+
}
|
|
436
|
+
export interface SdkGraphSeed {
|
|
437
|
+
id: string;
|
|
438
|
+
kind: 'id' | 'path' | 'query' | 'tag' | 'type';
|
|
439
|
+
value: string;
|
|
440
|
+
scope?: 'files' | 'sections' | 'entities';
|
|
441
|
+
}
|
|
442
|
+
export type SdkGraphQueryStage = 'plan' | 'implement' | 'research' | 'debug' | 'review';
|
|
443
|
+
export type SdkGraphQueryView = 'list' | 'brief' | 'full' | 'map';
|
|
444
|
+
export type SdkGraphDslRelation = 'related' | 'depends_on' | 'implements' | 'references' | 'parent' | 'child' | 'supersedes';
|
|
445
|
+
export interface SdkGraphWhereFilter {
|
|
446
|
+
field: 'type' | 'status' | 'audience' | 'tag' | 'domain';
|
|
447
|
+
op: 'eq' | 'in';
|
|
448
|
+
value: string | string[];
|
|
449
|
+
}
|
|
450
|
+
export interface SdkGraphSeedResolution {
|
|
451
|
+
seeds: SdkGraphSeed[];
|
|
452
|
+
matches: SdkGraphSearchResult[];
|
|
453
|
+
resolvedNodeIds: string[];
|
|
454
|
+
}
|
|
455
|
+
export interface SdkGraphQueryRequest {
|
|
456
|
+
seedIds?: string[];
|
|
457
|
+
seeds?: SdkGraphSeed[];
|
|
458
|
+
query?: string;
|
|
459
|
+
scope?: 'files' | 'sections' | 'entities';
|
|
460
|
+
stage?: SdkGraphQueryStage;
|
|
461
|
+
scopePaths?: string[];
|
|
462
|
+
where?: SdkGraphWhereFilter[];
|
|
463
|
+
relations?: SdkGraphDslRelation[];
|
|
464
|
+
view?: SdkGraphQueryView;
|
|
465
|
+
options?: SdkGraphQueryOptions;
|
|
466
|
+
}
|
|
467
|
+
export interface SdkGraphQueryNodeResult {
|
|
468
|
+
node: SdkGraphNode;
|
|
469
|
+
score: number;
|
|
470
|
+
depth: number;
|
|
471
|
+
reasons: string[];
|
|
472
|
+
diagnostics?: SdkGraphRankingDiagnostics;
|
|
473
|
+
}
|
|
474
|
+
export interface SdkGraphQueryResult {
|
|
475
|
+
seedIds: string[];
|
|
476
|
+
nodes: SdkGraphQueryNodeResult[];
|
|
477
|
+
edges: SdkGraphEdge[];
|
|
478
|
+
providerId?: string;
|
|
479
|
+
diagnostics?: Record<string, unknown>;
|
|
480
|
+
}
|
|
481
|
+
export interface SdkContextPackNode {
|
|
482
|
+
node: SdkGraphNode;
|
|
483
|
+
score: number;
|
|
484
|
+
depth: number;
|
|
485
|
+
text: string;
|
|
486
|
+
tokenEstimate: number;
|
|
487
|
+
reasons: string[];
|
|
488
|
+
provenance: {
|
|
489
|
+
seedIds: string[];
|
|
490
|
+
viaEdgeTypes: SdkGraphEdgeType[];
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
export interface SdkGraphRankingBuildInput {
|
|
494
|
+
nodes: SdkGraphNode[];
|
|
495
|
+
edges: SdkGraphEdge[];
|
|
496
|
+
}
|
|
497
|
+
export interface SdkGraphRankingSearchRequest {
|
|
498
|
+
query: string;
|
|
499
|
+
scope: 'files' | 'sections' | 'entities' | 'all';
|
|
500
|
+
options?: SdkGraphSearchOptions;
|
|
501
|
+
request?: SdkGraphQueryRequest;
|
|
502
|
+
}
|
|
503
|
+
export interface SdkGraphRankingNodeResult {
|
|
504
|
+
nodeId: string;
|
|
505
|
+
score: number;
|
|
506
|
+
depth: number;
|
|
507
|
+
reasons: string[];
|
|
508
|
+
seedIds: string[];
|
|
509
|
+
viaEdgeTypes: SdkGraphEdgeType[];
|
|
510
|
+
diagnostics?: SdkGraphRankingDiagnostics;
|
|
511
|
+
}
|
|
512
|
+
export interface SdkGraphRankingQueryRequest {
|
|
513
|
+
request: SdkGraphQueryRequest;
|
|
514
|
+
seedIds: string[];
|
|
515
|
+
seedMatches?: SdkGraphSearchResult[];
|
|
516
|
+
allowedNodeIds?: string[];
|
|
517
|
+
allowedEdgeTypes?: SdkGraphEdgeType[];
|
|
518
|
+
}
|
|
519
|
+
export interface SdkGraphRankingQueryResult {
|
|
520
|
+
providerId: string;
|
|
521
|
+
nodes: SdkGraphRankingNodeResult[];
|
|
522
|
+
edgeIds: string[];
|
|
523
|
+
diagnostics?: Record<string, unknown>;
|
|
524
|
+
}
|
|
525
|
+
export interface SdkGraphRankingIndex {
|
|
526
|
+
search(request: SdkGraphRankingSearchRequest): SdkGraphSearchResult[];
|
|
527
|
+
rankQuery(request: SdkGraphRankingQueryRequest): SdkGraphRankingQueryResult;
|
|
528
|
+
serialize?(): Record<string, unknown>;
|
|
529
|
+
}
|
|
530
|
+
export interface SdkGraphRankingProvider {
|
|
531
|
+
id: string;
|
|
532
|
+
capabilities?: string[];
|
|
533
|
+
buildIndex(input: SdkGraphRankingBuildInput): SdkGraphRankingIndex;
|
|
534
|
+
}
|
|
535
|
+
export interface SdkContextPack {
|
|
536
|
+
seedIds: string[];
|
|
537
|
+
totalTokenEstimate: number;
|
|
538
|
+
includedNodeIds: string[];
|
|
539
|
+
nodes: SdkContextPackNode[];
|
|
540
|
+
edges: SdkGraphEdge[];
|
|
541
|
+
}
|
|
542
|
+
export interface SdkContextPackRequest extends SdkGraphQueryRequest {
|
|
543
|
+
budget?: {
|
|
544
|
+
maxNodes?: number;
|
|
545
|
+
maxTokens?: number;
|
|
546
|
+
includeMode?: 'files' | 'sections' | 'mixed';
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
export interface SdkGraphDslParseResult {
|
|
550
|
+
ok: boolean;
|
|
551
|
+
query: SdkContextPackRequest | null;
|
|
552
|
+
errors: string[];
|
|
553
|
+
}
|
|
554
|
+
export interface SdkGraphPathExplanation {
|
|
555
|
+
fromId: string;
|
|
556
|
+
toId: string;
|
|
557
|
+
nodes: SdkGraphNode[];
|
|
558
|
+
edges: SdkGraphEdge[];
|
|
559
|
+
}
|
|
560
|
+
export interface SdkGraphRefreshPayload {
|
|
561
|
+
ready: boolean;
|
|
562
|
+
snapshotRoot: string;
|
|
563
|
+
changed: {
|
|
564
|
+
added: string[];
|
|
565
|
+
modified: string[];
|
|
566
|
+
removed: string[];
|
|
567
|
+
};
|
|
568
|
+
metrics: Record<string, unknown>;
|
|
569
|
+
}
|
|
570
|
+
export interface SdkCreateMessageRequest {
|
|
571
|
+
type: string;
|
|
572
|
+
payload: Record<string, unknown>;
|
|
573
|
+
relatedModel?: string | null;
|
|
574
|
+
relatedId?: string | null;
|
|
575
|
+
priority?: number;
|
|
576
|
+
maxAttempts?: number;
|
|
577
|
+
actor: string;
|
|
578
|
+
}
|
|
579
|
+
export interface SdkClaimMessageRequest {
|
|
580
|
+
workerId: string;
|
|
581
|
+
messageTypes?: string[];
|
|
582
|
+
leaseSeconds: number;
|
|
583
|
+
}
|
|
584
|
+
export interface SdkAckMessageRequest {
|
|
585
|
+
id: number;
|
|
586
|
+
status: 'completed' | 'failed' | 'dead_letter' | 'pending' | 'claimed';
|
|
587
|
+
}
|
|
588
|
+
export interface SdkRecordRunRequest {
|
|
589
|
+
run: Record<string, unknown>;
|
|
590
|
+
}
|
|
591
|
+
export interface SdkCursorRequest {
|
|
592
|
+
agentSlug: string;
|
|
593
|
+
cursorKey: string;
|
|
594
|
+
cursorValue: string;
|
|
595
|
+
}
|
|
596
|
+
export interface SdkGetCursorRequest {
|
|
597
|
+
agentSlug: string;
|
|
598
|
+
cursorKey: string;
|
|
599
|
+
}
|
|
600
|
+
export interface SdkLeaseReleaseRequest {
|
|
601
|
+
model: string;
|
|
602
|
+
itemKey: string;
|
|
603
|
+
leaseToken?: string | null;
|
|
604
|
+
}
|
|
605
|
+
export interface SdkStartWorkDayRequest {
|
|
606
|
+
id?: string;
|
|
607
|
+
projectId: string;
|
|
608
|
+
capacityBudget?: number;
|
|
609
|
+
graphVersion?: string | null;
|
|
610
|
+
summary?: Record<string, unknown> | null;
|
|
611
|
+
actor: string;
|
|
612
|
+
}
|
|
613
|
+
export interface SdkCloseWorkDayRequest {
|
|
614
|
+
id: string;
|
|
615
|
+
state?: 'completed' | 'cancelled' | 'failed';
|
|
616
|
+
summary?: Record<string, unknown> | null;
|
|
617
|
+
actor: string;
|
|
618
|
+
}
|
|
619
|
+
export interface SdkCreateTaskRequest {
|
|
620
|
+
id?: string;
|
|
621
|
+
workDayId: string;
|
|
622
|
+
agentId: string;
|
|
623
|
+
type: string;
|
|
624
|
+
state?: string;
|
|
625
|
+
priority?: number;
|
|
626
|
+
idempotencyKey: string;
|
|
627
|
+
payload: Record<string, unknown>;
|
|
628
|
+
payloadHash?: string | null;
|
|
629
|
+
maxAttempts?: number;
|
|
630
|
+
availableAt?: string;
|
|
631
|
+
graphVersion?: string | null;
|
|
632
|
+
parentTaskId?: string | null;
|
|
633
|
+
actor: string;
|
|
634
|
+
}
|
|
635
|
+
export interface SdkClaimTaskRequest {
|
|
636
|
+
id: string;
|
|
637
|
+
workerId: string;
|
|
638
|
+
leaseSeconds: number;
|
|
639
|
+
actor: string;
|
|
640
|
+
}
|
|
641
|
+
export interface SdkTaskProgressRequest {
|
|
642
|
+
id: string;
|
|
643
|
+
workerId?: string | null;
|
|
644
|
+
state?: string;
|
|
645
|
+
appendEvent?: {
|
|
646
|
+
kind: string;
|
|
647
|
+
data?: Record<string, unknown>;
|
|
648
|
+
} | null;
|
|
649
|
+
patch?: Record<string, unknown>;
|
|
650
|
+
actor: string;
|
|
651
|
+
}
|
|
652
|
+
export interface SdkCompleteTaskRequest {
|
|
653
|
+
id: string;
|
|
654
|
+
output?: Record<string, unknown> | null;
|
|
655
|
+
outputRef?: string | null;
|
|
656
|
+
summary?: Record<string, unknown> | null;
|
|
657
|
+
actor: string;
|
|
658
|
+
}
|
|
659
|
+
export interface SdkFailTaskRequest {
|
|
660
|
+
id: string;
|
|
661
|
+
errorCode?: string | null;
|
|
662
|
+
errorMessage: string;
|
|
663
|
+
retryable?: boolean;
|
|
664
|
+
nextVisibleAt?: string | null;
|
|
665
|
+
actor: string;
|
|
666
|
+
}
|
|
667
|
+
export interface SdkAppendTaskEventRequest {
|
|
668
|
+
taskId: string;
|
|
669
|
+
kind: string;
|
|
670
|
+
data?: Record<string, unknown>;
|
|
671
|
+
actor: string;
|
|
672
|
+
}
|
|
673
|
+
export interface SdkEnqueueTaskRequest {
|
|
674
|
+
taskId: string;
|
|
675
|
+
queueName?: string;
|
|
676
|
+
deliveryDelaySeconds?: number;
|
|
677
|
+
actor: string;
|
|
678
|
+
}
|
|
679
|
+
export interface SdkCreateReportRequest {
|
|
680
|
+
id?: string;
|
|
681
|
+
workDayId: string;
|
|
682
|
+
kind: string;
|
|
683
|
+
body: Record<string, unknown>;
|
|
684
|
+
renderedRef?: string | null;
|
|
685
|
+
sentAt?: string | null;
|
|
686
|
+
actor: string;
|
|
687
|
+
}
|
|
688
|
+
export interface SdkTaskSearchRequest {
|
|
689
|
+
workDayId?: string;
|
|
690
|
+
agentId?: string;
|
|
691
|
+
state?: string | string[];
|
|
692
|
+
limit?: number;
|
|
693
|
+
}
|
|
694
|
+
export interface SdkManagerContextRequest {
|
|
695
|
+
taskId: string;
|
|
696
|
+
includeGraph?: boolean;
|
|
697
|
+
}
|
|
698
|
+
export interface SdkManagerContextPayload {
|
|
699
|
+
task: SdkTaskEntity | null;
|
|
700
|
+
workDay: SdkWorkDayEntity | null;
|
|
701
|
+
agent: Record<string, unknown> | null;
|
|
702
|
+
graph: Record<string, unknown> | null;
|
|
703
|
+
}
|
|
704
|
+
export interface SdkGatewayClientConfig {
|
|
705
|
+
baseUrl: string;
|
|
706
|
+
bearerToken: string;
|
|
707
|
+
fetchImpl?: typeof fetch;
|
|
708
|
+
}
|
|
709
|
+
export interface SdkQueuePullClientConfig {
|
|
710
|
+
accountId: string;
|
|
711
|
+
queueId: string;
|
|
712
|
+
token: string;
|
|
713
|
+
apiBaseUrl?: string;
|
|
714
|
+
fetchImpl?: typeof fetch;
|
|
715
|
+
}
|
|
716
|
+
export interface SdkQueuePullRequest {
|
|
717
|
+
batchSize?: number;
|
|
718
|
+
visibilityTimeoutMs?: number;
|
|
719
|
+
}
|
|
720
|
+
export interface SdkQueueMessageEnvelope {
|
|
721
|
+
messageId: string;
|
|
722
|
+
taskId: string;
|
|
723
|
+
workDayId: string;
|
|
724
|
+
agentId: string;
|
|
725
|
+
taskType: string;
|
|
726
|
+
idempotencyKey: string;
|
|
727
|
+
attempt: number;
|
|
728
|
+
payloadRef: string;
|
|
729
|
+
graphVersion: string | null;
|
|
730
|
+
budgetHint: number;
|
|
731
|
+
}
|
|
732
|
+
export interface SdkPulledQueueMessage {
|
|
733
|
+
leaseId: string;
|
|
734
|
+
attempts: number;
|
|
735
|
+
body: SdkQueueMessageEnvelope;
|
|
736
|
+
rawBody: string;
|
|
737
|
+
}
|
|
738
|
+
export interface SdkQueuePullResult {
|
|
739
|
+
messages: SdkPulledQueueMessage[];
|
|
740
|
+
}
|
|
741
|
+
export interface SdkFollowResult<TItem> {
|
|
742
|
+
items: TItem[];
|
|
743
|
+
since: string;
|
|
744
|
+
}
|
|
745
|
+
export interface SdkPickResult<TItem> {
|
|
746
|
+
item: TItem | null;
|
|
747
|
+
leaseToken: string | null;
|
|
748
|
+
}
|
|
749
|
+
export type SdkTemplateCatalogStatus = 'draft' | 'live' | 'archived';
|
|
750
|
+
export type SdkTemplateCategory = 'starter' | 'example' | 'fixture' | 'reference-app';
|
|
751
|
+
export interface SdkTemplateCatalogPublisher {
|
|
752
|
+
id: string;
|
|
753
|
+
name: string;
|
|
754
|
+
url?: string;
|
|
755
|
+
}
|
|
756
|
+
export interface SdkTemplateCatalogSource {
|
|
757
|
+
kind: 'git';
|
|
758
|
+
repoUrl: string;
|
|
759
|
+
directory: string;
|
|
760
|
+
ref: string;
|
|
761
|
+
integrity?: string;
|
|
762
|
+
}
|
|
763
|
+
export interface SdkTemplateCatalogEntry {
|
|
764
|
+
id: string;
|
|
765
|
+
displayName: string;
|
|
766
|
+
description: string;
|
|
767
|
+
summary: string;
|
|
768
|
+
status: SdkTemplateCatalogStatus;
|
|
769
|
+
featured?: boolean;
|
|
770
|
+
category: SdkTemplateCategory;
|
|
771
|
+
audience?: string[];
|
|
772
|
+
tags?: string[];
|
|
773
|
+
publisher: SdkTemplateCatalogPublisher;
|
|
774
|
+
publisherVerified?: boolean;
|
|
775
|
+
templateVersion: string;
|
|
776
|
+
templateApiVersion: number;
|
|
777
|
+
minCliVersion: string;
|
|
778
|
+
minCoreVersion?: string;
|
|
779
|
+
fulfillment: {
|
|
780
|
+
source: SdkTemplateCatalogSource;
|
|
781
|
+
hooksPolicy: 'builtin_only' | 'trusted_only' | 'disabled';
|
|
782
|
+
supportsReconcile: boolean;
|
|
783
|
+
};
|
|
784
|
+
offer?: {
|
|
785
|
+
priceModel?: 'free' | 'paid' | 'contact';
|
|
786
|
+
license?: string;
|
|
787
|
+
support?: string;
|
|
788
|
+
};
|
|
789
|
+
relatedBooks?: string[];
|
|
790
|
+
relatedKnowledge?: string[];
|
|
791
|
+
relatedObjectives?: string[];
|
|
792
|
+
}
|
|
793
|
+
export interface SdkTemplateCatalogResponse {
|
|
794
|
+
items: SdkTemplateCatalogEntry[];
|
|
795
|
+
meta?: Record<string, unknown>;
|
|
796
|
+
}
|