@treeseed/sdk 0.1.2 → 0.3.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/README.md +97 -506
- 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 +28 -0
- package/dist/index.js +91 -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/deploy-runtime.d.ts +18 -0
- package/dist/platform/deploy-runtime.js +78 -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 +161 -0
- package/dist/platform/plugins.d.ts +6 -0
- package/dist/platform/plugins.js +38 -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 +35 -22
- package/dist/scripts/aggregate-book.js +121 -0
- package/dist/scripts/build-dist.js +54 -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 -6
- 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/utils/agents/contracts/messages.d.ts +88 -0
- package/dist/utils/agents/contracts/messages.js +138 -0
- package/dist/utils/agents/contracts/run.d.ts +20 -0
- package/dist/utils/agents/contracts/run.js +0 -0
- package/dist/utils/agents/runtime-types.d.ts +117 -0
- package/dist/utils/agents/runtime-types.js +4 -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 +111 -5
- package/scripts/verify-driver.mjs +29 -0
- package/dist/scripts/.ts-run-1775630384291-crtqr3izsa.js +0 -22
- package/dist/scripts/.ts-run-1775630388025-vnjle0z75a.js +0 -129
- package/dist/scripts/assert-release-tag-version.d.ts +0 -1
- package/dist/scripts/build-dist.d.ts +0 -1
- package/dist/scripts/fixture-tools.d.ts +0 -5
- 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
package/dist/src/sdk-types.d.ts
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
export declare const SDK_MODEL_NAMES: readonly ["page", "note", "question", "book", "knowledge", "objective", "person", "subscription", "message", "agent", "agent_run", "agent_cursor", "content_lease"];
|
|
2
|
-
export declare const SDK_OPERATIONS: readonly ["get", "read", "search", "follow", "pick", "create", "update"];
|
|
3
|
-
export declare const SDK_STORAGE_BACKENDS: readonly ["content", "d1"];
|
|
4
|
-
export declare const SDK_PICK_STRATEGIES: readonly ["latest", "highest_priority", "oldest"];
|
|
5
|
-
export type SdkModelName = (typeof SDK_MODEL_NAMES)[number];
|
|
6
|
-
export type SdkOperation = (typeof SDK_OPERATIONS)[number];
|
|
7
|
-
export type SdkStorageBackend = (typeof SDK_STORAGE_BACKENDS)[number];
|
|
8
|
-
export type SdkPickStrategy = (typeof SDK_PICK_STRATEGIES)[number];
|
|
9
|
-
export type SdkFilterOperator = 'eq' | 'in' | 'contains' | 'prefix' | 'gt' | 'gte' | 'lt' | 'lte' | 'updated_since' | 'related_to';
|
|
10
|
-
export type TreeseedSchemaVersion = number;
|
|
11
|
-
export type TreeseedRuntimeRecordType = 'subscription' | 'contact_submission' | 'agent_run' | 'message' | 'agent_cursor' | 'content_lease';
|
|
12
|
-
export interface TreeseedRecordEnvelope<TPayload, TMeta = Record<string, unknown>> {
|
|
13
|
-
recordType: TreeseedRuntimeRecordType;
|
|
14
|
-
schemaVersion: TreeseedSchemaVersion;
|
|
15
|
-
status: string;
|
|
16
|
-
payload: TPayload;
|
|
17
|
-
meta: TMeta;
|
|
18
|
-
}
|
|
19
|
-
export interface TreeseedSubscriptionPayload {
|
|
20
|
-
email: string;
|
|
21
|
-
name: string | null;
|
|
22
|
-
source: string;
|
|
23
|
-
consentAt: string | null;
|
|
24
|
-
ipHash: string;
|
|
25
|
-
}
|
|
26
|
-
export interface TreeseedSubscriptionMeta {
|
|
27
|
-
legacyId?: number;
|
|
28
|
-
}
|
|
29
|
-
export interface TreeseedContactSubmissionPayload {
|
|
30
|
-
name: string;
|
|
31
|
-
email: string;
|
|
32
|
-
organization: string | null;
|
|
33
|
-
contactType: string;
|
|
34
|
-
subject: string;
|
|
35
|
-
message: string;
|
|
36
|
-
userAgent: string;
|
|
37
|
-
ipHash: string;
|
|
38
|
-
}
|
|
39
|
-
export interface TreeseedContactSubmissionMeta {
|
|
40
|
-
source?: string;
|
|
41
|
-
}
|
|
42
|
-
export interface TreeseedAgentRunPayload {
|
|
43
|
-
triggerSource: string;
|
|
44
|
-
handlerKind?: string | null;
|
|
45
|
-
triggerKind?: string | null;
|
|
46
|
-
selectedItemKey: string | null;
|
|
47
|
-
selectedMessageId: number | null;
|
|
48
|
-
claimedMessageId?: number | null;
|
|
49
|
-
branchName: string | null;
|
|
50
|
-
prUrl: string | null;
|
|
51
|
-
summary: string | null;
|
|
52
|
-
error: string | null;
|
|
53
|
-
errorCategory?: string | null;
|
|
54
|
-
commitSha?: string | null;
|
|
55
|
-
changedPaths?: string[];
|
|
56
|
-
finishedAt: string | null;
|
|
57
|
-
}
|
|
58
|
-
export interface TreeseedAgentRunMeta {
|
|
59
|
-
runId: string;
|
|
60
|
-
agentSlug: string;
|
|
61
|
-
}
|
|
62
|
-
export interface TreeseedMessagePayload {
|
|
63
|
-
body: Record<string, unknown>;
|
|
64
|
-
}
|
|
65
|
-
export interface TreeseedMessageMeta {
|
|
66
|
-
actor?: string;
|
|
67
|
-
trace?: Record<string, unknown>;
|
|
68
|
-
}
|
|
69
|
-
export interface TreeseedCursorPayload {
|
|
70
|
-
cursorValue: string;
|
|
71
|
-
}
|
|
72
|
-
export interface TreeseedCursorMeta {
|
|
73
|
-
updatedBy?: string;
|
|
74
|
-
}
|
|
75
|
-
export interface TreeseedLeasePayload {
|
|
76
|
-
token: string;
|
|
77
|
-
}
|
|
78
|
-
export interface TreeseedLeaseMeta {
|
|
79
|
-
actor?: string;
|
|
80
|
-
}
|
|
81
|
-
export interface SdkFilterCondition {
|
|
82
|
-
field: string;
|
|
83
|
-
op: SdkFilterOperator;
|
|
84
|
-
value: unknown;
|
|
85
|
-
}
|
|
86
|
-
export interface SdkSortSpec {
|
|
87
|
-
field: string;
|
|
88
|
-
direction?: 'asc' | 'desc';
|
|
89
|
-
}
|
|
90
|
-
export interface SdkJsonEnvelope<TPayload> {
|
|
91
|
-
ok: boolean;
|
|
92
|
-
model: SdkModelName;
|
|
93
|
-
operation: SdkOperation;
|
|
94
|
-
payload: TPayload;
|
|
95
|
-
meta?: Record<string, unknown>;
|
|
96
|
-
}
|
|
97
|
-
export interface SdkMessageEntity {
|
|
98
|
-
[key: string]: unknown;
|
|
99
|
-
id: number;
|
|
100
|
-
recordType?: TreeseedRuntimeRecordType;
|
|
101
|
-
schemaVersion?: TreeseedSchemaVersion;
|
|
102
|
-
type: string;
|
|
103
|
-
status: string;
|
|
104
|
-
payloadJson: string;
|
|
105
|
-
metaJson?: string;
|
|
106
|
-
relatedModel: string | null;
|
|
107
|
-
relatedId: string | null;
|
|
108
|
-
priority: number;
|
|
109
|
-
availableAt: string;
|
|
110
|
-
claimedBy: string | null;
|
|
111
|
-
claimedAt: string | null;
|
|
112
|
-
leaseExpiresAt: string | null;
|
|
113
|
-
attempts: number;
|
|
114
|
-
maxAttempts: number;
|
|
115
|
-
createdAt: string;
|
|
116
|
-
updatedAt: string;
|
|
117
|
-
}
|
|
118
|
-
export interface SdkRunEntity {
|
|
119
|
-
[key: string]: unknown;
|
|
120
|
-
runId: string;
|
|
121
|
-
recordType?: TreeseedRuntimeRecordType;
|
|
122
|
-
schemaVersion?: TreeseedSchemaVersion;
|
|
123
|
-
agentSlug: string;
|
|
124
|
-
handlerKind?: string | null;
|
|
125
|
-
triggerKind?: string | null;
|
|
126
|
-
triggerSource: string;
|
|
127
|
-
claimedMessageId?: number | null;
|
|
128
|
-
status: string;
|
|
129
|
-
selectedItemKey: string | null;
|
|
130
|
-
selectedMessageId: number | null;
|
|
131
|
-
branchName: string | null;
|
|
132
|
-
commitSha?: string | null;
|
|
133
|
-
changedPaths?: string[];
|
|
134
|
-
prUrl: string | null;
|
|
135
|
-
summary: string | null;
|
|
136
|
-
error: string | null;
|
|
137
|
-
errorCategory?: string | null;
|
|
138
|
-
startedAt: string;
|
|
139
|
-
finishedAt: string | null;
|
|
140
|
-
}
|
|
141
|
-
export interface SdkCursorEntity {
|
|
142
|
-
[key: string]: unknown;
|
|
143
|
-
recordType?: TreeseedRuntimeRecordType;
|
|
144
|
-
schemaVersion?: TreeseedSchemaVersion;
|
|
145
|
-
agentSlug: string;
|
|
146
|
-
cursorKey: string;
|
|
147
|
-
cursorValue: string;
|
|
148
|
-
updatedAt: string | null;
|
|
149
|
-
}
|
|
150
|
-
export interface SdkLeaseEntity {
|
|
151
|
-
[key: string]: unknown;
|
|
152
|
-
recordType?: TreeseedRuntimeRecordType;
|
|
153
|
-
schemaVersion?: TreeseedSchemaVersion;
|
|
154
|
-
model: string;
|
|
155
|
-
itemKey: string;
|
|
156
|
-
claimedBy: string;
|
|
157
|
-
claimedAt: string;
|
|
158
|
-
leaseExpiresAt: string;
|
|
159
|
-
token: string;
|
|
160
|
-
}
|
|
161
|
-
export interface SdkSubscriptionEntity {
|
|
162
|
-
[key: string]: unknown;
|
|
163
|
-
id?: number;
|
|
164
|
-
recordType?: TreeseedRuntimeRecordType;
|
|
165
|
-
schemaVersion?: TreeseedSchemaVersion;
|
|
166
|
-
email: string;
|
|
167
|
-
name?: string | null;
|
|
168
|
-
status: string;
|
|
169
|
-
source?: string;
|
|
170
|
-
metaJson?: string;
|
|
171
|
-
consent_at?: string;
|
|
172
|
-
created_at?: string;
|
|
173
|
-
updated_at?: string;
|
|
174
|
-
ip_hash?: string;
|
|
175
|
-
}
|
|
176
|
-
export interface SdkAgentSpec {
|
|
177
|
-
[key: string]: unknown;
|
|
178
|
-
id: string;
|
|
179
|
-
slug: string;
|
|
180
|
-
title?: string;
|
|
181
|
-
body: string;
|
|
182
|
-
frontmatter: Record<string, unknown>;
|
|
183
|
-
}
|
|
184
|
-
export interface SdkContentEntry {
|
|
185
|
-
id: string;
|
|
186
|
-
slug: string;
|
|
187
|
-
model: SdkModelName;
|
|
188
|
-
title?: string;
|
|
189
|
-
path: string;
|
|
190
|
-
body: string;
|
|
191
|
-
frontmatter: Record<string, unknown>;
|
|
192
|
-
updatedAt: string | null;
|
|
193
|
-
createdAt: string | null;
|
|
194
|
-
}
|
|
195
|
-
export interface SdkSearchRequest {
|
|
196
|
-
model: SdkModelName;
|
|
197
|
-
filters?: SdkFilterCondition[];
|
|
198
|
-
sort?: SdkSortSpec[];
|
|
199
|
-
limit?: number;
|
|
200
|
-
cursor?: string | null;
|
|
201
|
-
}
|
|
202
|
-
export interface SdkGetRequest {
|
|
203
|
-
model: SdkModelName;
|
|
204
|
-
id?: string;
|
|
205
|
-
slug?: string;
|
|
206
|
-
key?: string;
|
|
207
|
-
}
|
|
208
|
-
export interface SdkFollowRequest {
|
|
209
|
-
model: SdkModelName;
|
|
210
|
-
since: string;
|
|
211
|
-
filters?: SdkFilterCondition[];
|
|
212
|
-
timeoutSeconds?: number;
|
|
213
|
-
}
|
|
214
|
-
export interface SdkPickRequest {
|
|
215
|
-
model: SdkModelName;
|
|
216
|
-
strategy?: SdkPickStrategy;
|
|
217
|
-
filters?: SdkFilterCondition[];
|
|
218
|
-
leaseSeconds: number;
|
|
219
|
-
workerId: string;
|
|
220
|
-
}
|
|
221
|
-
export interface SdkMutationRequest {
|
|
222
|
-
model: SdkModelName;
|
|
223
|
-
data: Record<string, unknown>;
|
|
224
|
-
actor: string;
|
|
225
|
-
}
|
|
226
|
-
export interface SdkUpdateRequest extends SdkMutationRequest {
|
|
227
|
-
id?: string;
|
|
228
|
-
slug?: string;
|
|
229
|
-
key?: string;
|
|
230
|
-
expectedVersion?: string;
|
|
231
|
-
}
|
|
232
|
-
export interface SdkModelDefinition {
|
|
233
|
-
name: SdkModelName;
|
|
234
|
-
aliases: string[];
|
|
235
|
-
storage: SdkStorageBackend;
|
|
236
|
-
operations: SdkOperation[];
|
|
237
|
-
filterableFields: string[];
|
|
238
|
-
sortableFields: string[];
|
|
239
|
-
pickField: string;
|
|
240
|
-
contentCollection?: string;
|
|
241
|
-
contentDir?: string;
|
|
242
|
-
}
|
|
243
|
-
export interface SdkCreateMessageRequest {
|
|
244
|
-
type: string;
|
|
245
|
-
payload: Record<string, unknown>;
|
|
246
|
-
relatedModel?: string | null;
|
|
247
|
-
relatedId?: string | null;
|
|
248
|
-
priority?: number;
|
|
249
|
-
maxAttempts?: number;
|
|
250
|
-
actor: string;
|
|
251
|
-
}
|
|
252
|
-
export interface SdkClaimMessageRequest {
|
|
253
|
-
workerId: string;
|
|
254
|
-
messageTypes?: string[];
|
|
255
|
-
leaseSeconds: number;
|
|
256
|
-
}
|
|
257
|
-
export interface SdkAckMessageRequest {
|
|
258
|
-
id: number;
|
|
259
|
-
status: 'completed' | 'failed' | 'dead_letter' | 'pending' | 'claimed';
|
|
260
|
-
}
|
|
261
|
-
export interface SdkRecordRunRequest {
|
|
262
|
-
run: Record<string, unknown>;
|
|
263
|
-
}
|
|
264
|
-
export interface SdkCursorRequest {
|
|
265
|
-
agentSlug: string;
|
|
266
|
-
cursorKey: string;
|
|
267
|
-
cursorValue: string;
|
|
268
|
-
}
|
|
269
|
-
export interface SdkGetCursorRequest {
|
|
270
|
-
agentSlug: string;
|
|
271
|
-
cursorKey: string;
|
|
272
|
-
}
|
|
273
|
-
export interface SdkLeaseReleaseRequest {
|
|
274
|
-
model: string;
|
|
275
|
-
itemKey: string;
|
|
276
|
-
leaseToken?: string | null;
|
|
277
|
-
}
|
|
278
|
-
export interface SdkFollowResult<TItem> {
|
|
279
|
-
items: TItem[];
|
|
280
|
-
since: string;
|
|
281
|
-
}
|
|
282
|
-
export interface SdkPickResult<TItem> {
|
|
283
|
-
item: TItem | null;
|
|
284
|
-
leaseToken: string | null;
|
|
285
|
-
}
|
package/dist/src/sdk.d.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import type { AgentPermissionConfig, AgentRuntimeSpec } from './types/agents.ts';
|
|
2
|
-
import { ContentStore } from './content-store.ts';
|
|
3
|
-
import { type AgentDatabase } from './d1-store.ts';
|
|
4
|
-
import type { SdkAckMessageRequest, SdkClaimMessageRequest, SdkCreateMessageRequest, SdkCursorRequest, SdkFollowRequest, SdkGetRequest, SdkGetCursorRequest, SdkJsonEnvelope, SdkLeaseReleaseRequest, SdkMutationRequest, SdkPickRequest, SdkRecordRunRequest, SdkSearchRequest, SdkUpdateRequest } from './sdk-types.ts';
|
|
5
|
-
export interface AgentSdkOptions {
|
|
6
|
-
repoRoot?: string;
|
|
7
|
-
database?: AgentDatabase;
|
|
8
|
-
}
|
|
9
|
-
export declare class AgentSdk {
|
|
10
|
-
readonly database: AgentDatabase;
|
|
11
|
-
readonly content: ContentStore;
|
|
12
|
-
constructor(options?: AgentSdkOptions);
|
|
13
|
-
static createLocal(options: {
|
|
14
|
-
repoRoot?: string;
|
|
15
|
-
databaseName?: string;
|
|
16
|
-
persistTo?: string;
|
|
17
|
-
}): AgentSdk;
|
|
18
|
-
private envelope;
|
|
19
|
-
get(request: SdkGetRequest): Promise<SdkJsonEnvelope<Record<string, unknown> | import("./sdk-types.ts").SdkContentEntry | null>>;
|
|
20
|
-
read(request: SdkGetRequest): Promise<{
|
|
21
|
-
operation: "read";
|
|
22
|
-
ok: boolean;
|
|
23
|
-
model: import("./sdk-types.ts").SdkModelName;
|
|
24
|
-
payload: Record<string, unknown> | import("./sdk-types.ts").SdkContentEntry | null;
|
|
25
|
-
meta?: Record<string, unknown>;
|
|
26
|
-
}>;
|
|
27
|
-
search(request: SdkSearchRequest): Promise<SdkJsonEnvelope<Record<string, unknown>[] | import("./sdk-types.ts").SdkContentEntry[]>>;
|
|
28
|
-
follow(request: SdkFollowRequest): Promise<SdkJsonEnvelope<{
|
|
29
|
-
items: Record<string, unknown>[];
|
|
30
|
-
since: string;
|
|
31
|
-
} | {
|
|
32
|
-
items: import("./sdk-types.ts").SdkContentEntry[];
|
|
33
|
-
since: string;
|
|
34
|
-
}>>;
|
|
35
|
-
pick(request: SdkPickRequest): Promise<SdkJsonEnvelope<import("./sdk-types.ts").SdkPickResult<Record<string, unknown>> | import("./sdk-types.ts").SdkPickResult<import("./sdk-types.ts").SdkContentEntry>>>;
|
|
36
|
-
create(request: SdkMutationRequest): Promise<SdkJsonEnvelope<Record<string, unknown> | {
|
|
37
|
-
item: import("./sdk-types.ts").SdkContentEntry;
|
|
38
|
-
git: import("./git-runtime.ts").GitMutationResult;
|
|
39
|
-
}>>;
|
|
40
|
-
update(request: SdkUpdateRequest): Promise<SdkJsonEnvelope<Record<string, unknown> | {
|
|
41
|
-
item: import("./sdk-types.ts").SdkContentEntry;
|
|
42
|
-
git: import("./git-runtime.ts").GitMutationResult;
|
|
43
|
-
} | null>>;
|
|
44
|
-
claimMessage(request: SdkClaimMessageRequest): Promise<SdkJsonEnvelope<import("./sdk-types.ts").SdkMessageEntity | null>>;
|
|
45
|
-
ackMessage(request: SdkAckMessageRequest): Promise<SdkJsonEnvelope<{
|
|
46
|
-
id: number;
|
|
47
|
-
status: "pending" | "claimed" | "completed" | "failed" | "dead_letter";
|
|
48
|
-
}>>;
|
|
49
|
-
createMessage(request: SdkCreateMessageRequest): Promise<SdkJsonEnvelope<import("./sdk-types.ts").SdkMessageEntity>>;
|
|
50
|
-
recordRun(request: SdkRecordRunRequest): Promise<SdkJsonEnvelope<Record<string, unknown>>>;
|
|
51
|
-
getCursor(request: SdkGetCursorRequest): Promise<SdkJsonEnvelope<string | null>>;
|
|
52
|
-
upsertCursor(request: SdkCursorRequest): Promise<SdkJsonEnvelope<SdkCursorRequest>>;
|
|
53
|
-
releaseLease(request: SdkLeaseReleaseRequest): Promise<SdkJsonEnvelope<SdkLeaseReleaseRequest>>;
|
|
54
|
-
releaseAllLeases(): Promise<SdkJsonEnvelope<{
|
|
55
|
-
count: number;
|
|
56
|
-
}>>;
|
|
57
|
-
listAgentSpecs(options?: {
|
|
58
|
-
enabled?: boolean;
|
|
59
|
-
}): Promise<AgentRuntimeSpec[]>;
|
|
60
|
-
listRawAgentSpecs(options?: {
|
|
61
|
-
enabled?: boolean;
|
|
62
|
-
}): Promise<Record<string, unknown>[] | import("./sdk-types.ts").SdkContentEntry[]>;
|
|
63
|
-
scopeForAgent(agent: Pick<AgentRuntimeSpec, 'slug' | 'permissions'>): ScopedAgentSdk;
|
|
64
|
-
}
|
|
65
|
-
export declare class ScopedAgentSdk {
|
|
66
|
-
private readonly base;
|
|
67
|
-
private readonly actor;
|
|
68
|
-
private readonly permissions;
|
|
69
|
-
constructor(base: AgentSdk, actor: string, permissions: AgentPermissionConfig[]);
|
|
70
|
-
private assertAllowed;
|
|
71
|
-
get(request: SdkGetRequest): Promise<SdkJsonEnvelope<Record<string, unknown> | import("./sdk-types.ts").SdkContentEntry | null>>;
|
|
72
|
-
read(request: SdkGetRequest): Promise<{
|
|
73
|
-
operation: "read";
|
|
74
|
-
ok: boolean;
|
|
75
|
-
model: import("./sdk-types.ts").SdkModelName;
|
|
76
|
-
payload: Record<string, unknown> | import("./sdk-types.ts").SdkContentEntry | null;
|
|
77
|
-
meta?: Record<string, unknown>;
|
|
78
|
-
}>;
|
|
79
|
-
search(request: SdkSearchRequest): Promise<SdkJsonEnvelope<Record<string, unknown>[] | import("./sdk-types.ts").SdkContentEntry[]>>;
|
|
80
|
-
follow(request: SdkFollowRequest): Promise<SdkJsonEnvelope<{
|
|
81
|
-
items: Record<string, unknown>[];
|
|
82
|
-
since: string;
|
|
83
|
-
} | {
|
|
84
|
-
items: import("./sdk-types.ts").SdkContentEntry[];
|
|
85
|
-
since: string;
|
|
86
|
-
}>>;
|
|
87
|
-
pick(request: SdkPickRequest): Promise<SdkJsonEnvelope<import("./sdk-types.ts").SdkPickResult<Record<string, unknown>> | import("./sdk-types.ts").SdkPickResult<import("./sdk-types.ts").SdkContentEntry>>>;
|
|
88
|
-
create(request: Omit<SdkMutationRequest, 'actor'>): Promise<SdkJsonEnvelope<Record<string, unknown> | {
|
|
89
|
-
item: import("./sdk-types.ts").SdkContentEntry;
|
|
90
|
-
git: import("./git-runtime.ts").GitMutationResult;
|
|
91
|
-
}>>;
|
|
92
|
-
update(request: Omit<SdkUpdateRequest, 'actor'>): Promise<SdkJsonEnvelope<Record<string, unknown> | {
|
|
93
|
-
item: import("./sdk-types.ts").SdkContentEntry;
|
|
94
|
-
git: import("./git-runtime.ts").GitMutationResult;
|
|
95
|
-
} | null>>;
|
|
96
|
-
claimMessage(request: SdkClaimMessageRequest): Promise<SdkJsonEnvelope<import("./sdk-types.ts").SdkMessageEntity | null>>;
|
|
97
|
-
ackMessage(request: SdkAckMessageRequest): Promise<SdkJsonEnvelope<{
|
|
98
|
-
id: number;
|
|
99
|
-
status: "pending" | "claimed" | "completed" | "failed" | "dead_letter";
|
|
100
|
-
}>>;
|
|
101
|
-
createMessage(request: Omit<SdkCreateMessageRequest, 'actor'>): Promise<SdkJsonEnvelope<import("./sdk-types.ts").SdkMessageEntity>>;
|
|
102
|
-
recordRun(request: SdkRecordRunRequest): Promise<SdkJsonEnvelope<Record<string, unknown>>>;
|
|
103
|
-
getCursor(request: SdkGetCursorRequest): Promise<SdkJsonEnvelope<string | null>>;
|
|
104
|
-
upsertCursor(request: SdkCursorRequest): Promise<SdkJsonEnvelope<SdkCursorRequest>>;
|
|
105
|
-
releaseLease(request: SdkLeaseReleaseRequest): Promise<SdkJsonEnvelope<SdkLeaseReleaseRequest>>;
|
|
106
|
-
releaseAllLeases(): Promise<SdkJsonEnvelope<{
|
|
107
|
-
count: number;
|
|
108
|
-
}>>;
|
|
109
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const sdkFixtureRoot: string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/vitest.config.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|