@treeseed/agent 0.8.5
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/Dockerfile +7 -0
- package/README.md +198 -0
- package/dist/agent-runtime.d.ts +17 -0
- package/dist/agent-runtime.js +117 -0
- package/dist/agents/adapters/execution.d.ts +41 -0
- package/dist/agents/adapters/execution.js +73 -0
- package/dist/agents/adapters/mutations.d.ts +22 -0
- package/dist/agents/adapters/mutations.js +30 -0
- package/dist/agents/adapters/notification.d.ts +26 -0
- package/dist/agents/adapters/notification.js +46 -0
- package/dist/agents/adapters/repository.d.ts +28 -0
- package/dist/agents/adapters/repository.js +61 -0
- package/dist/agents/adapters/research.d.ts +26 -0
- package/dist/agents/adapters/research.js +59 -0
- package/dist/agents/adapters/verification.d.ts +36 -0
- package/dist/agents/adapters/verification.js +62 -0
- package/dist/agents/cli-tools.d.ts +1 -0
- package/dist/agents/cli-tools.js +5 -0
- package/dist/agents/cli.d.ts +15 -0
- package/dist/agents/cli.js +109 -0
- package/dist/agents/contracts/messages.d.ts +88 -0
- package/dist/agents/contracts/messages.js +138 -0
- package/dist/agents/contracts/run.d.ts +21 -0
- package/dist/agents/contracts/run.js +0 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.js +5 -0
- package/dist/agents/kernel/agent-kernel.d.ts +63 -0
- package/dist/agents/kernel/agent-kernel.js +291 -0
- package/dist/agents/kernel/trigger-resolver.d.ts +19 -0
- package/dist/agents/kernel/trigger-resolver.js +157 -0
- package/dist/agents/registry-helper.d.ts +4 -0
- package/dist/agents/registry-helper.js +14 -0
- package/dist/agents/registry.d.ts +6 -0
- package/dist/agents/registry.js +98 -0
- package/dist/agents/runtime-types.d.ts +118 -0
- package/dist/agents/runtime-types.js +0 -0
- package/dist/agents/spec-loader.d.ts +18 -0
- package/dist/agents/spec-loader.js +54 -0
- package/dist/agents/spec-normalizer.d.ts +2 -0
- package/dist/agents/spec-normalizer.js +327 -0
- package/dist/agents/spec-types.d.ts +64 -0
- package/dist/agents/spec-types.js +0 -0
- package/dist/agents/testing/agents-smoke.d.ts +1 -0
- package/dist/agents/testing/agents-smoke.js +32 -0
- package/dist/agents/testing/e2e-harness.d.ts +44 -0
- package/dist/agents/testing/e2e-harness.js +503 -0
- package/dist/api/agent-routes.d.ts +13 -0
- package/dist/api/agent-routes.js +327 -0
- package/dist/api/app.d.ts +8 -0
- package/dist/api/app.js +444 -0
- package/dist/api/auth/d1-database.d.ts +3 -0
- package/dist/api/auth/d1-database.js +20 -0
- package/dist/api/auth/d1-provider.d.ts +79 -0
- package/dist/api/auth/d1-provider.js +92 -0
- package/dist/api/auth/d1-store.d.ts +114 -0
- package/dist/api/auth/d1-store.js +895 -0
- package/dist/api/auth/memory-provider.d.ts +77 -0
- package/dist/api/auth/memory-provider.js +249 -0
- package/dist/api/auth/rbac.d.ts +22 -0
- package/dist/api/auth/rbac.js +162 -0
- package/dist/api/auth/tokens.d.ts +18 -0
- package/dist/api/auth/tokens.js +56 -0
- package/dist/api/capabilities.d.ts +9 -0
- package/dist/api/capabilities.js +33 -0
- package/dist/api/config.d.ts +2 -0
- package/dist/api/config.js +77 -0
- package/dist/api/http.d.ts +28 -0
- package/dist/api/http.js +51 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/api/index.js +20 -0
- package/dist/api/operations-routes.d.ts +11 -0
- package/dist/api/operations-routes.js +87 -0
- package/dist/api/operations.d.ts +3 -0
- package/dist/api/operations.js +26 -0
- package/dist/api/project-routes.d.ts +8 -0
- package/dist/api/project-routes.js +585 -0
- package/dist/api/providers.d.ts +2 -0
- package/dist/api/providers.js +62 -0
- package/dist/api/railway.d.ts +51 -0
- package/dist/api/railway.js +71 -0
- package/dist/api/sdk-dispatch.d.ts +5 -0
- package/dist/api/sdk-dispatch.js +13 -0
- package/dist/api/sdk-routes.d.ts +11 -0
- package/dist/api/sdk-routes.js +29 -0
- package/dist/api/server.d.ts +2 -0
- package/dist/api/server.js +10 -0
- package/dist/api/templates.d.ts +3 -0
- package/dist/api/templates.js +31 -0
- package/dist/api/types.d.ts +237 -0
- package/dist/api/types.js +0 -0
- package/dist/env.yaml +957 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +41 -0
- package/dist/scripts/assert-release-tag-version.d.ts +1 -0
- package/dist/scripts/assert-release-tag-version.js +20 -0
- package/dist/scripts/build-dist.d.ts +1 -0
- package/dist/scripts/build-dist.js +106 -0
- package/dist/scripts/package-tools.d.ts +1 -0
- package/dist/scripts/package-tools.js +7 -0
- package/dist/scripts/publish-package.d.ts +1 -0
- package/dist/scripts/publish-package.js +24 -0
- package/dist/scripts/release-verify.d.ts +1 -0
- package/dist/scripts/release-verify.js +152 -0
- package/dist/scripts/test-smoke.d.ts +1 -0
- package/dist/scripts/test-smoke.js +23 -0
- package/dist/scripts/treeseed-agent-api.d.ts +2 -0
- package/dist/scripts/treeseed-agent-api.js +25 -0
- package/dist/scripts/treeseed-agent-service.d.ts +2 -0
- package/dist/scripts/treeseed-agent-service.js +36 -0
- package/dist/scripts/treeseed-agents.d.ts +2 -0
- package/dist/scripts/treeseed-agents.js +13 -0
- package/dist/services/agents.d.ts +17 -0
- package/dist/services/agents.js +48 -0
- package/dist/services/common.d.ts +66 -0
- package/dist/services/common.js +212 -0
- package/dist/services/index.d.ts +6 -0
- package/dist/services/index.js +19 -0
- package/dist/services/manager.d.ts +333 -0
- package/dist/services/manager.js +1368 -0
- package/dist/services/remote-runner.d.ts +30 -0
- package/dist/services/remote-runner.js +230 -0
- package/dist/services/workday-content.d.ts +53 -0
- package/dist/services/workday-content.js +190 -0
- package/dist/services/workday-manager.d.ts +391 -0
- package/dist/services/workday-manager.js +163 -0
- package/dist/services/workday-report.d.ts +238 -0
- package/dist/services/workday-report.js +17 -0
- package/dist/services/workday-start.d.ts +238 -0
- package/dist/services/workday-start.js +17 -0
- package/dist/services/worker-capacity.d.ts +58 -0
- package/dist/services/worker-capacity.js +208 -0
- package/dist/services/worker-pool-scaler.d.ts +27 -0
- package/dist/services/worker-pool-scaler.js +127 -0
- package/dist/services/worker.d.ts +19 -0
- package/dist/services/worker.js +436 -0
- package/dist/templates/github/deploy-processing.workflow.yml +119 -0
- package/package.json +136 -0
- package/templates/github/deploy-processing.workflow.yml +119 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { D1DatabaseLike } from '@treeseed/sdk/types/cloudflare';
|
|
2
|
+
import type { ApiConfig, ApiCredential, ApiPrincipal, DeviceCodeApproveRequest, DeviceCodePollRequest, DeviceCodePollResponse, DeviceCodeStartRequest, DeviceCodeStartResponse, TokenRefreshRequest, TokenRefreshResponse, TrustedUserAssertionClaims, UserIdentityProfileInput } from '../types.ts';
|
|
3
|
+
type PrincipalRecord = {
|
|
4
|
+
principal: ApiPrincipal;
|
|
5
|
+
userId: string;
|
|
6
|
+
};
|
|
7
|
+
export interface PersonalAccessTokenResult {
|
|
8
|
+
id: string;
|
|
9
|
+
token: string;
|
|
10
|
+
prefix: string;
|
|
11
|
+
name: string;
|
|
12
|
+
expiresAt: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface ServiceCredentialResult {
|
|
15
|
+
id: string;
|
|
16
|
+
serviceId: string;
|
|
17
|
+
secret: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class D1AuthStore {
|
|
20
|
+
private readonly config;
|
|
21
|
+
private readonly db;
|
|
22
|
+
private initializationPromise;
|
|
23
|
+
constructor(config: ApiConfig, db: D1DatabaseLike);
|
|
24
|
+
private run;
|
|
25
|
+
private first;
|
|
26
|
+
private all;
|
|
27
|
+
private ensureInitialized;
|
|
28
|
+
private ensureAuthSchema;
|
|
29
|
+
private seedCatalog;
|
|
30
|
+
private seedConfiguredServices;
|
|
31
|
+
private loadUser;
|
|
32
|
+
private loadIdentityByProvider;
|
|
33
|
+
private loadUserByVerifiedEmail;
|
|
34
|
+
private rolesForUser;
|
|
35
|
+
private permissionsForUser;
|
|
36
|
+
private permissionsForRoles;
|
|
37
|
+
private scopesForPrincipal;
|
|
38
|
+
private principalForUser;
|
|
39
|
+
private assignRole;
|
|
40
|
+
private replaceRoles;
|
|
41
|
+
private bootstrapRolesForUser;
|
|
42
|
+
private writeAuditEvent;
|
|
43
|
+
private userMetadata;
|
|
44
|
+
syncUser(identity: UserIdentityProfileInput): Promise<{
|
|
45
|
+
identityId: string | null;
|
|
46
|
+
principal: ApiPrincipal;
|
|
47
|
+
userId: string;
|
|
48
|
+
}>;
|
|
49
|
+
createUser(input: {
|
|
50
|
+
email?: string | null;
|
|
51
|
+
username?: string | null;
|
|
52
|
+
displayName?: string | null;
|
|
53
|
+
metadata?: Record<string, unknown>;
|
|
54
|
+
}): Promise<PrincipalRecord>;
|
|
55
|
+
setUserRoles(userId: string, roles: string[]): Promise<PrincipalRecord>;
|
|
56
|
+
startDeviceFlow(request: DeviceCodeStartRequest): Promise<DeviceCodeStartResponse>;
|
|
57
|
+
approveDeviceFlow(request: DeviceCodeApproveRequest): Promise<{
|
|
58
|
+
ok: true;
|
|
59
|
+
}>;
|
|
60
|
+
pollDeviceFlow(request: DeviceCodePollRequest): Promise<DeviceCodePollResponse>;
|
|
61
|
+
refreshAccessToken(request: TokenRefreshRequest): Promise<TokenRefreshResponse>;
|
|
62
|
+
createPersonalAccessToken(userId: string, input: {
|
|
63
|
+
name: string;
|
|
64
|
+
scopes?: string[];
|
|
65
|
+
expiresAt?: string | null;
|
|
66
|
+
}): Promise<{
|
|
67
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
68
|
+
token: string;
|
|
69
|
+
prefix: string;
|
|
70
|
+
name: string;
|
|
71
|
+
expiresAt: string | null;
|
|
72
|
+
}>;
|
|
73
|
+
listPersonalAccessTokens(userId: string): Promise<{
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
token_prefix: string;
|
|
77
|
+
expires_at: string | null;
|
|
78
|
+
last_used_at: string | null;
|
|
79
|
+
revoked_at: string | null;
|
|
80
|
+
created_at: string;
|
|
81
|
+
}[]>;
|
|
82
|
+
revokePersonalAccessToken(userId: string, tokenId: string): Promise<void>;
|
|
83
|
+
upsertServiceCredential(input: {
|
|
84
|
+
serviceId: string;
|
|
85
|
+
name: string;
|
|
86
|
+
secret: string;
|
|
87
|
+
roles?: string[];
|
|
88
|
+
permissions?: string[];
|
|
89
|
+
}): Promise<string>;
|
|
90
|
+
createServiceCredential(input: {
|
|
91
|
+
serviceId: string;
|
|
92
|
+
name: string;
|
|
93
|
+
roles?: string[];
|
|
94
|
+
permissions?: string[];
|
|
95
|
+
}): Promise<ServiceCredentialResult>;
|
|
96
|
+
rotateServiceCredential(serviceId: string): Promise<ServiceCredentialResult>;
|
|
97
|
+
authenticateBearerToken(token: string): Promise<{
|
|
98
|
+
principal: ApiPrincipal;
|
|
99
|
+
credential: ApiCredential;
|
|
100
|
+
} | null>;
|
|
101
|
+
authenticateService(serviceId: string, secret: string): Promise<{
|
|
102
|
+
principal: ApiPrincipal;
|
|
103
|
+
credential: ApiCredential;
|
|
104
|
+
} | null>;
|
|
105
|
+
exchangeTrustedUserAssertion(claims: TrustedUserAssertionClaims): Promise<{
|
|
106
|
+
ok: true;
|
|
107
|
+
accessToken: string;
|
|
108
|
+
tokenType: "Bearer";
|
|
109
|
+
expiresAt: string;
|
|
110
|
+
expiresInSeconds: number;
|
|
111
|
+
principal: ApiPrincipal;
|
|
112
|
+
}>;
|
|
113
|
+
}
|
|
114
|
+
export {};
|