@haaaiawd/second-nature 0.1.1 → 0.1.3
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/index.ts +64 -21
- package/openclaw.plugin.json +1 -1
- package/package.json +8 -2
- package/runtime/cli/action-bridge.d.ts +11 -0
- package/runtime/cli/action-bridge.js +27 -0
- package/runtime/cli/commands/credential.d.ts +2 -0
- package/runtime/cli/commands/credential.js +40 -0
- package/runtime/cli/commands/index.d.ts +12 -0
- package/runtime/cli/commands/index.js +138 -0
- package/runtime/cli/commands/policy.d.ts +12 -0
- package/runtime/cli/commands/policy.js +43 -0
- package/runtime/cli/explain/format-explanation.d.ts +10 -0
- package/runtime/cli/explain/format-explanation.js +10 -0
- package/runtime/cli/explain/resolve-subject.d.ts +2 -0
- package/runtime/cli/explain/resolve-subject.js +26 -0
- package/runtime/cli/index.d.ts +25 -0
- package/runtime/cli/index.js +36 -0
- package/runtime/cli/read-models/index.d.ts +20 -0
- package/runtime/cli/read-models/index.js +161 -0
- package/runtime/cli/read-models/types.d.ts +75 -0
- package/runtime/cli/read-models/types.js +1 -0
- package/runtime/connectors/agent-network/evomap/adapter.d.ts +23 -0
- package/runtime/connectors/agent-network/evomap/adapter.js +69 -0
- package/runtime/connectors/agent-network/evomap/index.d.ts +2 -0
- package/runtime/connectors/agent-network/evomap/index.js +2 -0
- package/runtime/connectors/agent-network/evomap/manifest.d.ts +2 -0
- package/runtime/connectors/agent-network/evomap/manifest.js +7 -0
- package/runtime/connectors/base/channel-health.d.ts +29 -0
- package/runtime/connectors/base/channel-health.js +23 -0
- package/runtime/connectors/base/contract.d.ts +81 -0
- package/runtime/connectors/base/contract.js +71 -0
- package/runtime/connectors/base/failure-taxonomy.d.ts +13 -0
- package/runtime/connectors/base/failure-taxonomy.js +105 -0
- package/runtime/connectors/base/index.d.ts +6 -0
- package/runtime/connectors/base/index.js +6 -0
- package/runtime/connectors/base/manifest.d.ts +11 -0
- package/runtime/connectors/base/manifest.js +36 -0
- package/runtime/connectors/base/policy-layer.d.ts +27 -0
- package/runtime/connectors/base/policy-layer.js +213 -0
- package/runtime/connectors/base/route-planner.d.ts +10 -0
- package/runtime/connectors/base/route-planner.js +98 -0
- package/runtime/connectors/index.d.ts +4 -0
- package/runtime/connectors/index.js +4 -0
- package/runtime/connectors/social-community/instreet/adapter.d.ts +32 -0
- package/runtime/connectors/social-community/instreet/adapter.js +79 -0
- package/runtime/connectors/social-community/instreet/index.d.ts +2 -0
- package/runtime/connectors/social-community/instreet/index.js +2 -0
- package/runtime/connectors/social-community/instreet/manifest.d.ts +2 -0
- package/runtime/connectors/social-community/instreet/manifest.js +7 -0
- package/runtime/connectors/social-community/moltbook/adapter.d.ts +15 -0
- package/runtime/connectors/social-community/moltbook/adapter.js +48 -0
- package/runtime/connectors/social-community/moltbook/index.d.ts +2 -0
- package/runtime/connectors/social-community/moltbook/index.js +2 -0
- package/runtime/connectors/social-community/moltbook/manifest.d.ts +7 -0
- package/runtime/connectors/social-community/moltbook/manifest.js +12 -0
- package/runtime/core/second-nature/guidance/apply-guidance.d.ts +10 -0
- package/runtime/core/second-nature/guidance/apply-guidance.js +10 -0
- package/runtime/core/second-nature/guidance/request-guidance.d.ts +18 -0
- package/runtime/core/second-nature/guidance/request-guidance.js +22 -0
- package/runtime/core/second-nature/index.d.ts +14 -0
- package/runtime/core/second-nature/index.js +14 -0
- package/runtime/core/second-nature/orchestrator/effect-dispatcher.d.ts +100 -0
- package/runtime/core/second-nature/orchestrator/effect-dispatcher.js +139 -0
- package/runtime/core/second-nature/orchestrator/guard-layer.d.ts +2 -0
- package/runtime/core/second-nature/orchestrator/guard-layer.js +54 -0
- package/runtime/core/second-nature/orchestrator/intent-planner.d.ts +3 -0
- package/runtime/core/second-nature/orchestrator/intent-planner.js +92 -0
- package/runtime/core/second-nature/orchestrator/lease-manager.d.ts +14 -0
- package/runtime/core/second-nature/orchestrator/lease-manager.js +58 -0
- package/runtime/core/second-nature/orchestrator/resume-from-checkpoint.d.ts +32 -0
- package/runtime/core/second-nature/orchestrator/resume-from-checkpoint.js +23 -0
- package/runtime/core/second-nature/outreach/build-message.d.ts +16 -0
- package/runtime/core/second-nature/outreach/build-message.js +27 -0
- package/runtime/core/second-nature/outreach/evaluate-outreach.d.ts +13 -0
- package/runtime/core/second-nature/outreach/evaluate-outreach.js +41 -0
- package/runtime/core/second-nature/quiet/quiet-pipeline.d.ts +34 -0
- package/runtime/core/second-nature/quiet/quiet-pipeline.js +35 -0
- package/runtime/core/second-nature/reflection/run-narrative-reflection.d.ts +39 -0
- package/runtime/core/second-nature/reflection/run-narrative-reflection.js +29 -0
- package/runtime/core/second-nature/rhythm/rhythm-policy.d.ts +18 -0
- package/runtime/core/second-nature/rhythm/rhythm-policy.js +24 -0
- package/runtime/core/second-nature/rhythm/select-window.d.ts +3 -0
- package/runtime/core/second-nature/rhythm/select-window.js +50 -0
- package/runtime/core/second-nature/runtime/lifecycle-service.d.ts +26 -0
- package/runtime/core/second-nature/runtime/lifecycle-service.js +38 -0
- package/runtime/core/second-nature/runtime/service-entry.d.ts +36 -0
- package/runtime/core/second-nature/runtime/service-entry.js +44 -0
- package/runtime/core/second-nature/types.d.ts +37 -0
- package/runtime/core/second-nature/types.js +1 -0
- package/runtime/guidance/contracts.d.ts +48 -0
- package/runtime/guidance/contracts.js +54 -0
- package/runtime/guidance/fallback.d.ts +2 -0
- package/runtime/guidance/fallback.js +17 -0
- package/runtime/guidance/guidance-assembler.d.ts +5 -0
- package/runtime/guidance/guidance-assembler.js +62 -0
- package/runtime/guidance/index.d.ts +8 -0
- package/runtime/guidance/index.js +8 -0
- package/runtime/guidance/output-guard.d.ts +10 -0
- package/runtime/guidance/output-guard.js +29 -0
- package/runtime/guidance/persona-selection.d.ts +11 -0
- package/runtime/guidance/persona-selection.js +90 -0
- package/runtime/guidance/review-workflow.d.ts +15 -0
- package/runtime/guidance/review-workflow.js +60 -0
- package/runtime/guidance/template-registry.d.ts +3 -0
- package/runtime/guidance/template-registry.js +45 -0
- package/runtime/guidance/types.d.ts +72 -0
- package/runtime/guidance/types.js +1 -0
- package/runtime/observability/db/index.d.ts +10 -0
- package/runtime/observability/db/index.js +17 -0
- package/runtime/observability/db/schema/index.d.ts +946 -0
- package/runtime/observability/db/schema/index.js +70 -0
- package/runtime/observability/index.d.ts +12 -0
- package/runtime/observability/index.js +11 -0
- package/runtime/observability/projections/guidance-audit.d.ts +16 -0
- package/runtime/observability/projections/guidance-audit.js +35 -0
- package/runtime/observability/projections/outreach-quality-audit.d.ts +15 -0
- package/runtime/observability/projections/outreach-quality-audit.js +9 -0
- package/runtime/observability/projections/reflection-audit.d.ts +17 -0
- package/runtime/observability/projections/reflection-audit.js +9 -0
- package/runtime/observability/query/compose-evidence.d.ts +56 -0
- package/runtime/observability/query/compose-evidence.js +43 -0
- package/runtime/observability/query/evidence-query-engine.d.ts +17 -0
- package/runtime/observability/query/evidence-query-engine.js +166 -0
- package/runtime/observability/redaction/manifest.d.ts +18 -0
- package/runtime/observability/redaction/manifest.js +109 -0
- package/runtime/observability/redaction/policy.d.ts +19 -0
- package/runtime/observability/redaction/policy.js +71 -0
- package/runtime/observability/services/decision-ledger.d.ts +33 -0
- package/runtime/observability/services/decision-ledger.js +115 -0
- package/runtime/observability/services/execution-telemetry.d.ts +32 -0
- package/runtime/observability/services/execution-telemetry.js +126 -0
- package/runtime/observability/services/governance-audit.d.ts +27 -0
- package/runtime/observability/services/governance-audit.js +139 -0
- package/runtime/observability/services/redaction-store.d.ts +3 -0
- package/runtime/observability/services/redaction-store.js +20 -0
- package/runtime/setup/HOST_SETUP.md +112 -0
- package/runtime/shared/types/continuity.d.ts +69 -0
- package/runtime/shared/types/continuity.js +1 -0
- package/runtime/shared/types/credential.d.ts +22 -0
- package/runtime/shared/types/credential.js +1 -0
- package/runtime/shared/types/index.d.ts +3 -0
- package/runtime/shared/types/index.js +3 -0
- package/runtime/shared/types/outreach.d.ts +19 -0
- package/runtime/shared/types/outreach.js +1 -0
- package/runtime/storage/bootstrap/repair.d.ts +3 -0
- package/runtime/storage/bootstrap/repair.js +5 -0
- package/runtime/storage/db/index.d.ts +10 -0
- package/runtime/storage/db/index.js +17 -0
- package/runtime/storage/db/schema/assets.d.ts +140 -0
- package/runtime/storage/db/schema/assets.js +10 -0
- package/runtime/storage/db/schema/credentials.d.ts +178 -0
- package/runtime/storage/db/schema/credentials.js +12 -0
- package/runtime/storage/db/schema/index.d.ts +6 -0
- package/runtime/storage/db/schema/index.js +6 -0
- package/runtime/storage/db/schema/intent-commits.d.ts +161 -0
- package/runtime/storage/db/schema/intent-commits.js +11 -0
- package/runtime/storage/db/schema/policies.d.ts +81 -0
- package/runtime/storage/db/schema/policies.js +7 -0
- package/runtime/storage/db/schema/proposals.d.ts +216 -0
- package/runtime/storage/db/schema/proposals.js +14 -0
- package/runtime/storage/db/schema/provenance.d.ts +104 -0
- package/runtime/storage/db/schema/provenance.js +8 -0
- package/runtime/storage/index.d.ts +16 -0
- package/runtime/storage/index.js +16 -0
- package/runtime/storage/memory/workspace/paths.d.ts +62 -0
- package/runtime/storage/memory/workspace/paths.js +160 -0
- package/runtime/storage/memory/workspace/store.d.ts +26 -0
- package/runtime/storage/memory/workspace/store.js +153 -0
- package/runtime/storage/memory/workspace/types.d.ts +45 -0
- package/runtime/storage/memory/workspace/types.js +1 -0
- package/runtime/storage/repositories/asset-repository.d.ts +8 -0
- package/runtime/storage/repositories/asset-repository.js +19 -0
- package/runtime/storage/repositories/credential-repository.d.ts +8 -0
- package/runtime/storage/repositories/credential-repository.js +19 -0
- package/runtime/storage/repositories/index.d.ts +6 -0
- package/runtime/storage/repositories/index.js +6 -0
- package/runtime/storage/repositories/intent-commit-repository.d.ts +10 -0
- package/runtime/storage/repositories/intent-commit-repository.js +35 -0
- package/runtime/storage/repositories/policy-repository.d.ts +8 -0
- package/runtime/storage/repositories/policy-repository.js +19 -0
- package/runtime/storage/repositories/proposal-repository.d.ts +9 -0
- package/runtime/storage/repositories/proposal-repository.js +26 -0
- package/runtime/storage/repositories/provenance-repository.d.ts +20 -0
- package/runtime/storage/repositories/provenance-repository.js +41 -0
- package/runtime/storage/services/credential-vault.d.ts +8 -0
- package/runtime/storage/services/credential-vault.js +78 -0
- package/runtime/storage/services/daily-log-pipeline.d.ts +47 -0
- package/runtime/storage/services/daily-log-pipeline.js +86 -0
- package/runtime/storage/services/effect-commit-store.d.ts +11 -0
- package/runtime/storage/services/effect-commit-store.js +93 -0
- package/runtime/storage/services/governance-layer.d.ts +40 -0
- package/runtime/storage/services/governance-layer.js +103 -0
- package/runtime/storage/services/persona-candidate-loader.d.ts +5 -0
- package/runtime/storage/services/persona-candidate-loader.js +41 -0
- package/runtime/storage/services/provenance-service.d.ts +40 -0
- package/runtime/storage/services/provenance-service.js +43 -0
- package/runtime/storage/services/quiet-input-loader.d.ts +40 -0
- package/runtime/storage/services/quiet-input-loader.js +131 -0
- package/runtime/storage/services/repair-and-backup.d.ts +22 -0
- package/runtime/storage/services/repair-and-backup.js +73 -0
- package/runtime/storage/state-api.d.ts +46 -0
- package/runtime/storage/state-api.js +73 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export type TopLevelMode = "active" | "quiet" | "maintenance_only" | "paused_for_interrupt";
|
|
2
|
+
export type DecisionVerdict = "allow" | "deny" | "defer" | "escalate";
|
|
3
|
+
export type DecisionBasis = "rule_only" | "score_based" | "model_assisted";
|
|
4
|
+
export type IntentCommitState = "planned" | "dispatched" | "externally_acknowledged" | "committed" | "reconcile" | "aborted";
|
|
5
|
+
export interface DecisionRecord {
|
|
6
|
+
id: string;
|
|
7
|
+
tickId: string;
|
|
8
|
+
traceId: string;
|
|
9
|
+
intentId?: string;
|
|
10
|
+
platformId?: string;
|
|
11
|
+
verdict: DecisionVerdict;
|
|
12
|
+
mode: TopLevelMode;
|
|
13
|
+
reasons: string[];
|
|
14
|
+
reasonCodes: string[];
|
|
15
|
+
decisionBasis: DecisionBasis;
|
|
16
|
+
evidenceRefs: string[];
|
|
17
|
+
modelEvalRef?: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ExecutionAttempt {
|
|
21
|
+
id: string;
|
|
22
|
+
traceId: string;
|
|
23
|
+
decisionId: string;
|
|
24
|
+
intentId: string;
|
|
25
|
+
platformId: string;
|
|
26
|
+
capability: string;
|
|
27
|
+
channel: string;
|
|
28
|
+
status: "planned" | "started" | "succeeded" | "failed";
|
|
29
|
+
commitState?: IntentCommitState;
|
|
30
|
+
failureClass?: string;
|
|
31
|
+
retryPolicy?: string;
|
|
32
|
+
idempotencyKey?: string;
|
|
33
|
+
metadata?: Record<string, unknown>;
|
|
34
|
+
startedAt?: string;
|
|
35
|
+
finishedAt?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface AnchorChangeAudit {
|
|
38
|
+
id: string;
|
|
39
|
+
proposalId: string;
|
|
40
|
+
targetAssetId: string;
|
|
41
|
+
assetPath: string;
|
|
42
|
+
status: "draft" | "requires_review" | "approved" | "rejected" | "applied" | "conflicted";
|
|
43
|
+
beforeHash?: string;
|
|
44
|
+
afterHash?: string;
|
|
45
|
+
supportingSources: string[];
|
|
46
|
+
reason: string;
|
|
47
|
+
appliedAt?: string;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
}
|
|
50
|
+
export interface IntentCommitOutcome {
|
|
51
|
+
traceId: string;
|
|
52
|
+
outcomeRef: string;
|
|
53
|
+
}
|
|
54
|
+
export interface IntentCommitRecord {
|
|
55
|
+
id: string;
|
|
56
|
+
intentId: string;
|
|
57
|
+
decisionId: string;
|
|
58
|
+
checkpointId?: string;
|
|
59
|
+
state: IntentCommitState;
|
|
60
|
+
outcomeRef?: string;
|
|
61
|
+
metadata?: Record<string, unknown>;
|
|
62
|
+
updatedAt: string;
|
|
63
|
+
}
|
|
64
|
+
export interface IntentCommitRecordInput {
|
|
65
|
+
intentId: string;
|
|
66
|
+
decisionId: string;
|
|
67
|
+
checkpointId?: string;
|
|
68
|
+
state: IntentCommitState;
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type CredentialState = "missing" | "pending_verification" | "active" | "expired" | "revoked" | "failed";
|
|
2
|
+
export type CredentialType = "api_key" | "oauth_token" | "node_secret" | "verification_code";
|
|
3
|
+
export interface CredentialContext {
|
|
4
|
+
platformId: string;
|
|
5
|
+
status: CredentialState;
|
|
6
|
+
credentialType: CredentialType;
|
|
7
|
+
verificationDeadline?: string;
|
|
8
|
+
attemptsRemaining?: number;
|
|
9
|
+
challengeText?: string;
|
|
10
|
+
verificationCode?: string;
|
|
11
|
+
encryptedValue?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CredentialContextWrite {
|
|
14
|
+
platformId: string;
|
|
15
|
+
credentialType: CredentialType;
|
|
16
|
+
encryptedValue: string;
|
|
17
|
+
status: CredentialState;
|
|
18
|
+
verificationCode?: string;
|
|
19
|
+
challengeText?: string;
|
|
20
|
+
expiresAt?: string;
|
|
21
|
+
attemptsRemaining?: number;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface OutreachEvaluationInput {
|
|
2
|
+
candidateId: string;
|
|
3
|
+
summary: string;
|
|
4
|
+
sourceRefs: string[];
|
|
5
|
+
recentOutreachHashes: string[];
|
|
6
|
+
requiredUserHelp?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface OutreachEvaluationResult {
|
|
9
|
+
valueScore: number;
|
|
10
|
+
novelty: number;
|
|
11
|
+
userRelevance: number;
|
|
12
|
+
actionability: number;
|
|
13
|
+
urgency: number;
|
|
14
|
+
requiredUserHelp: boolean;
|
|
15
|
+
isRoutineProgress: boolean;
|
|
16
|
+
minThreshold: number;
|
|
17
|
+
sourceRefs: string[];
|
|
18
|
+
explanation?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { StateDatabase } from "../db/index.js";
|
|
2
|
+
import { type RepairAndBackupOptions, type RepairAndBackupResult } from "../services/repair-and-backup.js";
|
|
3
|
+
export declare function runStartupRepairAndBackup(database: StateDatabase, options?: RepairAndBackupOptions): Promise<RepairAndBackupResult>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Database from "better-sqlite3";
|
|
2
|
+
import { drizzle } from "drizzle-orm/better-sqlite3";
|
|
3
|
+
import * as schema from "./schema/index.js";
|
|
4
|
+
export interface StateDatabase {
|
|
5
|
+
sqlite: Database.Database;
|
|
6
|
+
db: ReturnType<typeof drizzle<typeof schema>>;
|
|
7
|
+
schema: typeof schema;
|
|
8
|
+
close(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function createStateDatabase(filename?: string): StateDatabase;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Database from "better-sqlite3";
|
|
2
|
+
import { drizzle } from "drizzle-orm/better-sqlite3";
|
|
3
|
+
import * as schema from "./schema/index.js";
|
|
4
|
+
export function createStateDatabase(filename = "./data/state.db") {
|
|
5
|
+
const sqlite = new Database(filename);
|
|
6
|
+
sqlite.pragma("journal_mode = WAL");
|
|
7
|
+
sqlite.pragma("busy_timeout = 5000");
|
|
8
|
+
const db = drizzle(sqlite, { schema });
|
|
9
|
+
return {
|
|
10
|
+
sqlite,
|
|
11
|
+
db,
|
|
12
|
+
schema,
|
|
13
|
+
close() {
|
|
14
|
+
sqlite.close();
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
export declare const assetRegistry: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
2
|
+
name: "asset_registry";
|
|
3
|
+
schema: undefined;
|
|
4
|
+
columns: {
|
|
5
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
6
|
+
name: "id";
|
|
7
|
+
tableName: "asset_registry";
|
|
8
|
+
dataType: "string";
|
|
9
|
+
columnType: "SQLiteText";
|
|
10
|
+
data: string;
|
|
11
|
+
driverParam: string;
|
|
12
|
+
notNull: true;
|
|
13
|
+
hasDefault: false;
|
|
14
|
+
isPrimaryKey: true;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: false;
|
|
17
|
+
enumValues: [string, ...string[]];
|
|
18
|
+
baseColumn: never;
|
|
19
|
+
identity: undefined;
|
|
20
|
+
generated: undefined;
|
|
21
|
+
}, {}, {
|
|
22
|
+
length: number | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
kind: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
25
|
+
name: "kind";
|
|
26
|
+
tableName: "asset_registry";
|
|
27
|
+
dataType: "string";
|
|
28
|
+
columnType: "SQLiteText";
|
|
29
|
+
data: string;
|
|
30
|
+
driverParam: string;
|
|
31
|
+
notNull: true;
|
|
32
|
+
hasDefault: false;
|
|
33
|
+
isPrimaryKey: false;
|
|
34
|
+
isAutoincrement: false;
|
|
35
|
+
hasRuntimeDefault: false;
|
|
36
|
+
enumValues: [string, ...string[]];
|
|
37
|
+
baseColumn: never;
|
|
38
|
+
identity: undefined;
|
|
39
|
+
generated: undefined;
|
|
40
|
+
}, {}, {
|
|
41
|
+
length: number | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
path: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
44
|
+
name: "path";
|
|
45
|
+
tableName: "asset_registry";
|
|
46
|
+
dataType: "string";
|
|
47
|
+
columnType: "SQLiteText";
|
|
48
|
+
data: string;
|
|
49
|
+
driverParam: string;
|
|
50
|
+
notNull: true;
|
|
51
|
+
hasDefault: false;
|
|
52
|
+
isPrimaryKey: false;
|
|
53
|
+
isAutoincrement: false;
|
|
54
|
+
hasRuntimeDefault: false;
|
|
55
|
+
enumValues: [string, ...string[]];
|
|
56
|
+
baseColumn: never;
|
|
57
|
+
identity: undefined;
|
|
58
|
+
generated: undefined;
|
|
59
|
+
}, {}, {
|
|
60
|
+
length: number | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
hash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
63
|
+
name: "hash";
|
|
64
|
+
tableName: "asset_registry";
|
|
65
|
+
dataType: "string";
|
|
66
|
+
columnType: "SQLiteText";
|
|
67
|
+
data: string;
|
|
68
|
+
driverParam: string;
|
|
69
|
+
notNull: true;
|
|
70
|
+
hasDefault: false;
|
|
71
|
+
isPrimaryKey: false;
|
|
72
|
+
isAutoincrement: false;
|
|
73
|
+
hasRuntimeDefault: false;
|
|
74
|
+
enumValues: [string, ...string[]];
|
|
75
|
+
baseColumn: never;
|
|
76
|
+
identity: undefined;
|
|
77
|
+
generated: undefined;
|
|
78
|
+
}, {}, {
|
|
79
|
+
length: number | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
version: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
82
|
+
name: "version";
|
|
83
|
+
tableName: "asset_registry";
|
|
84
|
+
dataType: "number";
|
|
85
|
+
columnType: "SQLiteInteger";
|
|
86
|
+
data: number;
|
|
87
|
+
driverParam: number;
|
|
88
|
+
notNull: true;
|
|
89
|
+
hasDefault: true;
|
|
90
|
+
isPrimaryKey: false;
|
|
91
|
+
isAutoincrement: false;
|
|
92
|
+
hasRuntimeDefault: false;
|
|
93
|
+
enumValues: undefined;
|
|
94
|
+
baseColumn: never;
|
|
95
|
+
identity: undefined;
|
|
96
|
+
generated: undefined;
|
|
97
|
+
}, {}, {}>;
|
|
98
|
+
layer: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
99
|
+
name: "layer";
|
|
100
|
+
tableName: "asset_registry";
|
|
101
|
+
dataType: "string";
|
|
102
|
+
columnType: "SQLiteText";
|
|
103
|
+
data: string;
|
|
104
|
+
driverParam: string;
|
|
105
|
+
notNull: true;
|
|
106
|
+
hasDefault: false;
|
|
107
|
+
isPrimaryKey: false;
|
|
108
|
+
isAutoincrement: false;
|
|
109
|
+
hasRuntimeDefault: false;
|
|
110
|
+
enumValues: [string, ...string[]];
|
|
111
|
+
baseColumn: never;
|
|
112
|
+
identity: undefined;
|
|
113
|
+
generated: undefined;
|
|
114
|
+
}, {}, {
|
|
115
|
+
length: number | undefined;
|
|
116
|
+
}>;
|
|
117
|
+
lastIndexedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
118
|
+
name: "last_indexed_at";
|
|
119
|
+
tableName: "asset_registry";
|
|
120
|
+
dataType: "string";
|
|
121
|
+
columnType: "SQLiteText";
|
|
122
|
+
data: string;
|
|
123
|
+
driverParam: string;
|
|
124
|
+
notNull: true;
|
|
125
|
+
hasDefault: false;
|
|
126
|
+
isPrimaryKey: false;
|
|
127
|
+
isAutoincrement: false;
|
|
128
|
+
hasRuntimeDefault: false;
|
|
129
|
+
enumValues: [string, ...string[]];
|
|
130
|
+
baseColumn: never;
|
|
131
|
+
identity: undefined;
|
|
132
|
+
generated: undefined;
|
|
133
|
+
}, {}, {
|
|
134
|
+
length: number | undefined;
|
|
135
|
+
}>;
|
|
136
|
+
};
|
|
137
|
+
dialect: "sqlite";
|
|
138
|
+
}>;
|
|
139
|
+
export type AssetRegistryRecord = typeof assetRegistry.$inferSelect;
|
|
140
|
+
export type NewAssetRegistryRecord = typeof assetRegistry.$inferInsert;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { integer, sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
2
|
+
export const assetRegistry = sqliteTable("asset_registry", {
|
|
3
|
+
id: text("id").primaryKey(),
|
|
4
|
+
kind: text("kind").notNull(),
|
|
5
|
+
path: text("path").notNull(),
|
|
6
|
+
hash: text("hash").notNull(),
|
|
7
|
+
version: integer("version").notNull().default(1),
|
|
8
|
+
layer: text("layer").notNull(),
|
|
9
|
+
lastIndexedAt: text("last_indexed_at").notNull(),
|
|
10
|
+
}, (table) => [uniqueIndex("asset_registry_path_idx").on(table.path)]);
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
export declare const credentialRecords: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
2
|
+
name: "credential_records";
|
|
3
|
+
schema: undefined;
|
|
4
|
+
columns: {
|
|
5
|
+
platformId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
6
|
+
name: "platform_id";
|
|
7
|
+
tableName: "credential_records";
|
|
8
|
+
dataType: "string";
|
|
9
|
+
columnType: "SQLiteText";
|
|
10
|
+
data: string;
|
|
11
|
+
driverParam: string;
|
|
12
|
+
notNull: true;
|
|
13
|
+
hasDefault: false;
|
|
14
|
+
isPrimaryKey: true;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: false;
|
|
17
|
+
enumValues: [string, ...string[]];
|
|
18
|
+
baseColumn: never;
|
|
19
|
+
identity: undefined;
|
|
20
|
+
generated: undefined;
|
|
21
|
+
}, {}, {
|
|
22
|
+
length: number | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
credentialType: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
25
|
+
name: "credential_type";
|
|
26
|
+
tableName: "credential_records";
|
|
27
|
+
dataType: "string";
|
|
28
|
+
columnType: "SQLiteText";
|
|
29
|
+
data: string;
|
|
30
|
+
driverParam: string;
|
|
31
|
+
notNull: true;
|
|
32
|
+
hasDefault: false;
|
|
33
|
+
isPrimaryKey: false;
|
|
34
|
+
isAutoincrement: false;
|
|
35
|
+
hasRuntimeDefault: false;
|
|
36
|
+
enumValues: [string, ...string[]];
|
|
37
|
+
baseColumn: never;
|
|
38
|
+
identity: undefined;
|
|
39
|
+
generated: undefined;
|
|
40
|
+
}, {}, {
|
|
41
|
+
length: number | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
encryptedValue: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
44
|
+
name: "encrypted_value";
|
|
45
|
+
tableName: "credential_records";
|
|
46
|
+
dataType: "string";
|
|
47
|
+
columnType: "SQLiteText";
|
|
48
|
+
data: string;
|
|
49
|
+
driverParam: string;
|
|
50
|
+
notNull: true;
|
|
51
|
+
hasDefault: false;
|
|
52
|
+
isPrimaryKey: false;
|
|
53
|
+
isAutoincrement: false;
|
|
54
|
+
hasRuntimeDefault: false;
|
|
55
|
+
enumValues: [string, ...string[]];
|
|
56
|
+
baseColumn: never;
|
|
57
|
+
identity: undefined;
|
|
58
|
+
generated: undefined;
|
|
59
|
+
}, {}, {
|
|
60
|
+
length: number | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
status: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
63
|
+
name: "status";
|
|
64
|
+
tableName: "credential_records";
|
|
65
|
+
dataType: "string";
|
|
66
|
+
columnType: "SQLiteText";
|
|
67
|
+
data: string;
|
|
68
|
+
driverParam: string;
|
|
69
|
+
notNull: true;
|
|
70
|
+
hasDefault: false;
|
|
71
|
+
isPrimaryKey: false;
|
|
72
|
+
isAutoincrement: false;
|
|
73
|
+
hasRuntimeDefault: false;
|
|
74
|
+
enumValues: [string, ...string[]];
|
|
75
|
+
baseColumn: never;
|
|
76
|
+
identity: undefined;
|
|
77
|
+
generated: undefined;
|
|
78
|
+
}, {}, {
|
|
79
|
+
length: number | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
verificationCode: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
82
|
+
name: "verification_code";
|
|
83
|
+
tableName: "credential_records";
|
|
84
|
+
dataType: "string";
|
|
85
|
+
columnType: "SQLiteText";
|
|
86
|
+
data: string;
|
|
87
|
+
driverParam: string;
|
|
88
|
+
notNull: false;
|
|
89
|
+
hasDefault: false;
|
|
90
|
+
isPrimaryKey: false;
|
|
91
|
+
isAutoincrement: false;
|
|
92
|
+
hasRuntimeDefault: false;
|
|
93
|
+
enumValues: [string, ...string[]];
|
|
94
|
+
baseColumn: never;
|
|
95
|
+
identity: undefined;
|
|
96
|
+
generated: undefined;
|
|
97
|
+
}, {}, {
|
|
98
|
+
length: number | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
challengeText: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
101
|
+
name: "challenge_text";
|
|
102
|
+
tableName: "credential_records";
|
|
103
|
+
dataType: "string";
|
|
104
|
+
columnType: "SQLiteText";
|
|
105
|
+
data: string;
|
|
106
|
+
driverParam: string;
|
|
107
|
+
notNull: false;
|
|
108
|
+
hasDefault: false;
|
|
109
|
+
isPrimaryKey: false;
|
|
110
|
+
isAutoincrement: false;
|
|
111
|
+
hasRuntimeDefault: false;
|
|
112
|
+
enumValues: [string, ...string[]];
|
|
113
|
+
baseColumn: never;
|
|
114
|
+
identity: undefined;
|
|
115
|
+
generated: undefined;
|
|
116
|
+
}, {}, {
|
|
117
|
+
length: number | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
expiresAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
120
|
+
name: "expires_at";
|
|
121
|
+
tableName: "credential_records";
|
|
122
|
+
dataType: "string";
|
|
123
|
+
columnType: "SQLiteText";
|
|
124
|
+
data: string;
|
|
125
|
+
driverParam: string;
|
|
126
|
+
notNull: false;
|
|
127
|
+
hasDefault: false;
|
|
128
|
+
isPrimaryKey: false;
|
|
129
|
+
isAutoincrement: false;
|
|
130
|
+
hasRuntimeDefault: false;
|
|
131
|
+
enumValues: [string, ...string[]];
|
|
132
|
+
baseColumn: never;
|
|
133
|
+
identity: undefined;
|
|
134
|
+
generated: undefined;
|
|
135
|
+
}, {}, {
|
|
136
|
+
length: number | undefined;
|
|
137
|
+
}>;
|
|
138
|
+
attemptsRemaining: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
139
|
+
name: "attempts_remaining";
|
|
140
|
+
tableName: "credential_records";
|
|
141
|
+
dataType: "number";
|
|
142
|
+
columnType: "SQLiteInteger";
|
|
143
|
+
data: number;
|
|
144
|
+
driverParam: number;
|
|
145
|
+
notNull: false;
|
|
146
|
+
hasDefault: false;
|
|
147
|
+
isPrimaryKey: false;
|
|
148
|
+
isAutoincrement: false;
|
|
149
|
+
hasRuntimeDefault: false;
|
|
150
|
+
enumValues: undefined;
|
|
151
|
+
baseColumn: never;
|
|
152
|
+
identity: undefined;
|
|
153
|
+
generated: undefined;
|
|
154
|
+
}, {}, {}>;
|
|
155
|
+
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
156
|
+
name: "updated_at";
|
|
157
|
+
tableName: "credential_records";
|
|
158
|
+
dataType: "string";
|
|
159
|
+
columnType: "SQLiteText";
|
|
160
|
+
data: string;
|
|
161
|
+
driverParam: string;
|
|
162
|
+
notNull: true;
|
|
163
|
+
hasDefault: false;
|
|
164
|
+
isPrimaryKey: false;
|
|
165
|
+
isAutoincrement: false;
|
|
166
|
+
hasRuntimeDefault: false;
|
|
167
|
+
enumValues: [string, ...string[]];
|
|
168
|
+
baseColumn: never;
|
|
169
|
+
identity: undefined;
|
|
170
|
+
generated: undefined;
|
|
171
|
+
}, {}, {
|
|
172
|
+
length: number | undefined;
|
|
173
|
+
}>;
|
|
174
|
+
};
|
|
175
|
+
dialect: "sqlite";
|
|
176
|
+
}>;
|
|
177
|
+
export type CredentialRecord = typeof credentialRecords.$inferSelect;
|
|
178
|
+
export type NewCredentialRecord = typeof credentialRecords.$inferInsert;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
2
|
+
export const credentialRecords = sqliteTable("credential_records", {
|
|
3
|
+
platformId: text("platform_id").primaryKey(),
|
|
4
|
+
credentialType: text("credential_type").notNull(),
|
|
5
|
+
encryptedValue: text("encrypted_value").notNull(),
|
|
6
|
+
status: text("status").notNull(),
|
|
7
|
+
verificationCode: text("verification_code"),
|
|
8
|
+
challengeText: text("challenge_text"),
|
|
9
|
+
expiresAt: text("expires_at"),
|
|
10
|
+
attemptsRemaining: integer("attempts_remaining"),
|
|
11
|
+
updatedAt: text("updated_at").notNull(),
|
|
12
|
+
});
|