@hasna/workflows 0.2.1 → 0.2.2
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 +25 -0
- package/dist/agent-tools.js +1 -506
- package/dist/cli/index.js +11 -11
- package/dist/handlers.js +115 -15
- package/dist/index.js +116 -17
- package/dist/mcp/index.js +3 -3
- package/dist/sdk.js +3 -3
- package/dist/serve/admin.js +134 -32
- package/dist/serve/index.js +175 -32
- package/dist/service.js +113 -13
- package/hasna.contract.json +1 -1
- package/package.json +2 -2
- package/types/journal-directory.d.ts +4 -0
- package/types/serve/journal-lease.d.ts +7 -0
- package/types/service.d.ts +12 -4
- package/types/types.d.ts +4 -0
package/hasna.contract.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "workflows",
|
|
4
4
|
"class": "service",
|
|
5
5
|
"contractVersion": "v1",
|
|
6
|
-
"kitVersion": "1.3.
|
|
6
|
+
"kitVersion": "1.3.5",
|
|
7
7
|
"description": "Hosted workflow CLI, MCP and HTTP SDK, with a PostgreSQL execution server and a preserved session journal.",
|
|
8
8
|
"bins": [
|
|
9
9
|
"workflows",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/workflows",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Universal graph workflow app — graph language (start/step/decision/while/end), three-table store, session WAL, daemon with claims/leases, four lane adapters (claude/codex/cursor/grok), and a full CLI on four surfaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@anthropic-ai/claude-agent-sdk": "0.3.234",
|
|
78
78
|
"@cursor/sdk": "^1.0.28",
|
|
79
|
-
"@hasna/contracts": "1.3.
|
|
79
|
+
"@hasna/contracts": "1.3.5",
|
|
80
80
|
"@openai/codex-sdk": "0.160.0",
|
|
81
81
|
"commander": "^13.1.0",
|
|
82
82
|
"pg": "^8.16.3"
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** An optional deployment identity prevents an empty fallback directory from
|
|
2
|
+
* being mistaken for the restored journal. Provision the marker separately,
|
|
3
|
+
* after preservation and restore verification; the runtime never creates it. */
|
|
4
|
+
export declare function assertJournalDirectory(dataDir: string, identity: string): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** A process-lifetime filesystem mutex, separate from the short journal mutex.
|
|
2
|
+
* There are no tables or application records in this file. Closing the process
|
|
3
|
+
* releases its OS lock; the file is never deleted to steal another process's
|
|
4
|
+
* lease. All server processes must bind the same verified local filesystem. */
|
|
5
|
+
export declare function acquireJournalServerLease(dataDir: string, identity: string): {
|
|
6
|
+
close(): void;
|
|
7
|
+
};
|
package/types/service.d.ts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import { type RunToCompletionOptions } from "./daemon.js";
|
|
2
2
|
import { openStore } from "./store.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type LaneKind, type WorkflowGraph } from "./graph.js";
|
|
4
|
+
import { type LaneProbe } from "./lanes/index.js";
|
|
4
5
|
import type { HealthReport, ReadinessReport, WorkflowsConfig } from "./types.js";
|
|
5
6
|
export { packageVersion } from "./version.js";
|
|
7
|
+
type ResolvedWorkflowsConfig = WorkflowsConfig & {
|
|
8
|
+
enabledLanes: readonly LaneKind[];
|
|
9
|
+
};
|
|
6
10
|
/** Resolve the service configuration from env + explicit overrides. */
|
|
7
|
-
export declare function resolveWorkflowsConfig(overrides?: Partial<WorkflowsConfig>):
|
|
11
|
+
export declare function resolveWorkflowsConfig(overrides?: Partial<WorkflowsConfig>): ResolvedWorkflowsConfig;
|
|
8
12
|
export declare class WorkflowsService {
|
|
9
13
|
private readonly execution;
|
|
10
14
|
readonly name = "workflows";
|
|
11
15
|
readonly version: string;
|
|
12
|
-
readonly config:
|
|
16
|
+
readonly config: ResolvedWorkflowsConfig;
|
|
13
17
|
private readonly startedAt;
|
|
14
18
|
private readonly databaseEnv;
|
|
15
19
|
constructor(config?: Partial<WorkflowsConfig>, execution?: RunToCompletionOptions);
|
|
16
20
|
health(): HealthReport;
|
|
17
21
|
ready(): Promise<ReadinessReport>;
|
|
22
|
+
private verifyJournalDirectory;
|
|
23
|
+
private assertEnabledGraphLanes;
|
|
24
|
+
probeLane(kind: LaneKind): Promise<LaneProbe>;
|
|
25
|
+
laneInventory(): Promise<LaneProbe[]>;
|
|
18
26
|
private openEngineStore;
|
|
19
27
|
private withStore;
|
|
20
28
|
/** Explicit operator bootstrap; ordinary reads and server startup never create tables. */
|
|
@@ -26,7 +34,7 @@ export declare class WorkflowsService {
|
|
|
26
34
|
cancelRun(id: string): Promise<import("./store.js").RunRow | undefined>;
|
|
27
35
|
resumeRun(id: string): Promise<{
|
|
28
36
|
runId: string;
|
|
29
|
-
status: "
|
|
37
|
+
status: "pending" | "running" | "completed" | "failed" | "cancelled" | "interrupted";
|
|
30
38
|
error: string | null;
|
|
31
39
|
result: any;
|
|
32
40
|
reused: boolean;
|
package/types/types.d.ts
CHANGED
|
@@ -20,12 +20,16 @@ export interface WorkflowsConfig {
|
|
|
20
20
|
apiUrl?: string;
|
|
21
21
|
/** Optional client API key (WORKFLOWS_API_KEY) — resolved, never printed. */
|
|
22
22
|
apiKey?: string;
|
|
23
|
+
/** Optional restored-data marker checked before any server storage access. */
|
|
24
|
+
dataIdentity?: string;
|
|
23
25
|
/** Gateway origin identity. When configured, every /v1 route requires it. */
|
|
24
26
|
originAuth?: string;
|
|
25
27
|
/** Hosted server authority. SQLite requires an explicit embedded selection. */
|
|
26
28
|
storageBackend: "postgresql" | "sqlite";
|
|
27
29
|
databaseUrl?: string;
|
|
28
30
|
databaseSchema?: string;
|
|
31
|
+
/** Model lanes admitted by this server. An empty list permits command steps only. */
|
|
32
|
+
enabledLanes?: readonly import("./graph.js").LaneKind[];
|
|
29
33
|
}
|
|
30
34
|
export interface HealthReport {
|
|
31
35
|
ok: boolean;
|