@type_of/interlock 0.0.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/CONTEXT.md ADDED
@@ -0,0 +1,29 @@
1
+ # Interlock
2
+
3
+ Interlock defines repeatable procedures that agents and people can execute and inspect.
4
+
5
+ ## Language
6
+
7
+ **Workflow**: A reusable definition of work, including its steps and execution rules.
8
+
9
+ **Workflow version**: An immutable published definition of a workflow.
10
+
11
+ **Draft**: An editable workflow definition that has not been published as a version.
12
+
13
+ **Run**: One execution of a particular workflow version with its own inputs and progress.
14
+
15
+ **Node**: A step in a workflow. A node can invoke another workflow.
16
+
17
+ **Node execution**: One invocation of a node within a run.
18
+
19
+ **Tool**: A capability that a node can invoke.
20
+
21
+ **Context policy**: Rules governing the information and capabilities an agent execution receives.
22
+
23
+ **Work request**: A bounded assignment that a run makes available to an agent executor.
24
+
25
+ **Claim**: A time-limited reservation of a work request by an executor.
26
+
27
+ **Workflow revision**: A proposed change to a workflow's procedure.
28
+
29
+ **Evaluation**: Evidence about the quality of a workflow or proposed revision.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Interlock contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,143 @@
1
+ # Interlock
2
+
3
+ Interlock is a local workflow editor and engine for AI agents. Define a procedure once, combine agent assignments with JavaScript or Bash steps, and inspect each run in your browser.
4
+
5
+ Build workflows visually or edit their JSON definitions. Interlock validates inputs and results, runs scripts, and stores progress in SQLite. Your connected agent handles assignments through the Model Context Protocol (MCP).
6
+
7
+ ## Install and run
8
+
9
+ Requires **Node.js 24.13 or later** on **macOS or Linux**. Bash script nodes also require `/bin/bash`.
10
+
11
+ ```sh
12
+ npm install -g @type_of/interlock
13
+ interlock
14
+ ```
15
+
16
+ Open [http://127.0.0.1:4310](http://127.0.0.1:4310) in your browser. The package includes the engine, UI, CLI, and MCP bridge. No separate build is required.
17
+
18
+ Keep the terminal running while you use Interlock. Closing the browser does not stop the engine. Press Ctrl+C in the terminal to stop it.
19
+
20
+ ## Run your first workflow
21
+
22
+ The initial library includes **Research a protocol**, an editable example with an input, an agent assignment, and an output.
23
+
24
+ 1. Select **Connect with MCP** in the sidebar.
25
+ 2. Follow the instructions for Codex, Claude, OpenCode, or another MCP client.
26
+ 3. Restart or reconnect your client so it can discover the Interlock tools.
27
+ 4. Ask your agent:
28
+
29
+ ```text
30
+ Find the Interlock workflow "Research a protocol" and run it with
31
+ {"name":"Aave"}. Complete its assignments, then return the result.
32
+ ```
33
+
34
+ 5. Open **Run history** in Interlock to inspect the run, node results, and any errors.
35
+
36
+ Your agent needs access to the tools required by the assignment, such as web research for this example. Its tool approval settings still apply.
37
+
38
+ The connection uses `interlock mcp`, a stdio bridge to the running engine. Keep the engine running separately. The modal includes absolute-path configuration if your client cannot find the global `interlock` command. See [Connect a harness](docs/connect-harness.md) for configuration and the assignment loop.
39
+
40
+ ## Create a workflow
41
+
42
+ Select **New workflow** to create a draft. Use **Add node** to choose each step's type, then connect the nodes in execution order.
43
+
44
+ Available nodes include entry and exit, agent assignments, scripts, conditions, child workflows, and maps. Maps run a child workflow for each item in a list and collect its results.
45
+
46
+ Configure input and output contracts in the node settings. Use **Visual / Raw** to switch between the graph and its JSON definition. The raw editor checks JSON syntax and structure before saving. Publishing also checks the workflow's graph.
47
+
48
+ Select **Publish version** when the draft is ready, then **Run v1** to supply input and start a run. Each run uses a fixed published version. Editing a draft does not change an existing run.
49
+
50
+ ### Script nodes
51
+
52
+ New script nodes default to JavaScript. Read the incoming JSON value as `input` and return a JSON value for the next node. Top-level `await` is supported:
53
+
54
+ ```js
55
+ const doubled = await Promise.resolve(input.number * 2);
56
+ return { number: doubled };
57
+ ```
58
+
59
+ For input `{"number":21}`, this returns `{"number":42}`. Configure the node's contracts to accept these fields.
60
+
61
+ Bash scripts read JSON from stdin and must write one JSON value to stdout. Write diagnostic messages to stderr. JavaScript `console.log` messages go to stderr automatically.
62
+
63
+ A thrown error, nonzero exit, timeout, or invalid output fails the script step. Scripts are not retried automatically.
64
+
65
+ Scripts execute with your user account's filesystem, environment, and network access. They are not sandboxed, so review scripts before running imported workflows.
66
+
67
+ ## Storage and configuration
68
+
69
+ Interlock listens on `127.0.0.1:4310` and stores workflows and runs in `~/.interlock/interlock.db`. Restarting the server retains saved data. Scripts use the directory where you started Interlock as their working directory.
70
+
71
+ To change the port, script working directory, or database path:
72
+
73
+ ```sh
74
+ interlock --port 4400 --workdir /path/to/project --db /path/to/interlock.db
75
+ ```
76
+
77
+ `INTERLOCK_WORKDIR` and `INTERLOCK_DB` provide defaults for the corresponding flags. Flags take precedence.
78
+
79
+ When using another port, set `INTERLOCK_URL` for CLI commands and the MCP bridge. The connection modal generates the correct environment configuration for the running server.
80
+
81
+ ```sh
82
+ INTERLOCK_URL=http://127.0.0.1:4400 interlock workflows
83
+ ```
84
+
85
+ The engine's HTTP address is not an HTTP MCP endpoint. MCP clients connect through the stdio bridge.
86
+
87
+ ## Use the CLI
88
+
89
+ With the engine running, open another terminal:
90
+
91
+ ```sh
92
+ interlock workflows
93
+ interlock workflow WORKFLOW_ID
94
+ interlock start WORKFLOW_ID '{"name":"Aave"}'
95
+ interlock run RUN_ID
96
+ ```
97
+
98
+ Replace `WORKFLOW_ID` with an ID from `interlock workflows` and `RUN_ID` with the run ID returned by `interlock start`. Match the input to your workflow's contract. Starting a run with agent assignments makes those assignments available for a connected agent to claim and complete.
99
+
100
+ JSON arguments also accept `@filename`, such as `interlock start WORKFLOW_ID @input.json`. Run `interlock commands` for the full command list or `interlock --help` for server options.
101
+
102
+ ## Current scope
103
+
104
+ Interlock is a local, single-user application. It does not call model APIs or launch agent sessions itself. Agent steps need a connected executor or manual submission; script steps run in the engine.
105
+
106
+ A connected executor supplies the tools, skills, and context isolation requested by a workflow. Interlock checks the executor's declared capabilities but does not install or provide them.
107
+
108
+ See [Scope and limits](docs/v1.md) for execution limits and unsupported features.
109
+
110
+ ## Develop locally
111
+
112
+ From a source checkout, use Node.js 24.13 or later and pnpm 11.7:
113
+
114
+ ```sh
115
+ pnpm install
116
+ pnpm dev
117
+ ```
118
+
119
+ The development UI runs on [port 5173](http://127.0.0.1:5173), with the engine on port 4310. Stop any installed Interlock server using port 4310 before starting development.
120
+
121
+ Development stores data in `.interlock/interlock.db` inside the checkout. Installed copies use a separate database unless you pass `--db` explicitly. Run `pnpm build` followed by `pnpm start` to serve the built UI on port 4310 with the development database.
122
+
123
+ Validate changes with:
124
+
125
+ ```sh
126
+ pnpm test
127
+ pnpm build
128
+ pnpm format:check
129
+ pnpm test:package
130
+ ```
131
+
132
+ The build includes TypeScript checks. Tests cover workflow contracts, runtime behavior, and MCP over stdio. The package test installs a local tarball into a temporary prefix and checks the CLI, UI, MCP bridge, JavaScript execution, and persistence after a restart. It does not publish anything.
133
+
134
+ ## Project documentation
135
+
136
+ - [Domain language](CONTEXT.md)
137
+ - [Architecture and execution semantics](docs/architecture.md)
138
+ - [Scope and limits](docs/v1.md)
139
+ - [Harness integration](docs/connect-harness.md)
140
+
141
+ ## License
142
+
143
+ [MIT](LICENSE)