@osfactory/har 0.36.0 → 0.36.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/dist/index.js
CHANGED
|
@@ -76462,6 +76462,17 @@ async function registerRepoWithControl(options) {
|
|
|
76462
76462
|
}
|
|
76463
76463
|
return await response.json();
|
|
76464
76464
|
}
|
|
76465
|
+
async function ensureRepoRegisteredWithControl(repoPath, apiUrl) {
|
|
76466
|
+
const canonical = canonicalizeControlRepoPath(repoPath);
|
|
76467
|
+
recordRepoForControlSync(canonical);
|
|
76468
|
+
try {
|
|
76469
|
+
await registerRepoWithControl({ repoPath: canonical, apiUrl });
|
|
76470
|
+
} catch (err) {
|
|
76471
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
76472
|
+
process.stderr.write(`[har control] repo registration skipped: ${message}
|
|
76473
|
+
`);
|
|
76474
|
+
}
|
|
76475
|
+
}
|
|
76465
76476
|
async function syncRepoWithLocalControl(options) {
|
|
76466
76477
|
const apiUrl = options.apiUrl ?? getControlApiUrl();
|
|
76467
76478
|
const { repoPath, dryRun } = options;
|
|
@@ -89891,6 +89902,7 @@ async function defaultEnsureControl(options) {
|
|
|
89891
89902
|
warning: "Telemetry is on but Mission Control is not running. Start later with: har control up"
|
|
89892
89903
|
};
|
|
89893
89904
|
}
|
|
89905
|
+
await ensureRepoRegisteredWithControl(options.cwd, apiUrl);
|
|
89894
89906
|
}
|
|
89895
89907
|
return { started: false, apiUrl };
|
|
89896
89908
|
}
|
|
@@ -89898,6 +89910,9 @@ async function defaultEnsureControl(options) {
|
|
|
89898
89910
|
const ensured = await ensureTelemetryInfrastructure({ startIfNeeded: true });
|
|
89899
89911
|
if (ensured.message) success(ensured.message);
|
|
89900
89912
|
if (ensured.warning) warn(ensured.warning);
|
|
89913
|
+
if (ensured.reachable) {
|
|
89914
|
+
await ensureRepoRegisteredWithControl(options.cwd, ensured.apiUrl);
|
|
89915
|
+
}
|
|
89901
89916
|
return {
|
|
89902
89917
|
started: ensured.started || ensured.reachable,
|
|
89903
89918
|
apiUrl: ensured.apiUrl,
|
|
@@ -90450,6 +90465,7 @@ async function handleOn(argv) {
|
|
|
90450
90465
|
if (hooks.message) success(hooks.message);
|
|
90451
90466
|
if (hooks.warning) warn(hooks.warning);
|
|
90452
90467
|
if (result.otelReady) {
|
|
90468
|
+
await ensureRepoRegisteredWithControl(process.cwd(), result.apiUrl);
|
|
90453
90469
|
info(`OTLP ingest: ${result.apiUrl.replace(/\/$/, "")}/api/otel`);
|
|
90454
90470
|
info("Usage appears under Mission Control \u2192 Worktrees / Usage. Disable: har telemetry off");
|
|
90455
90471
|
}
|
|
@@ -90523,6 +90539,9 @@ async function handleInstallHooks() {
|
|
|
90523
90539
|
const result = await ensureTelemetryInfrastructure({ startIfNeeded: true });
|
|
90524
90540
|
if (result.message) success(result.message);
|
|
90525
90541
|
if (result.warning) warn(result.warning);
|
|
90542
|
+
if (result.otelReady) {
|
|
90543
|
+
await ensureRepoRegisteredWithControl(process.cwd(), result.apiUrl);
|
|
90544
|
+
}
|
|
90526
90545
|
const hooks = ensureOtelHooks({ setupAgents: true });
|
|
90527
90546
|
if (hooks.ok) {
|
|
90528
90547
|
success(hooks.message ?? "@osfactory/otel-hook installed and agents registered");
|
|
@@ -16,7 +16,7 @@ work around it with ad-hoc commands.
|
|
|
16
16
|
## Before making changes
|
|
17
17
|
|
|
18
18
|
1. **On the main checkout, switch to the intended base** (usually `main`) — every launch creates a worktree from that HEAD. `--replace` does not select the base.
|
|
19
|
-
2. **Launch your slot FIRST — before editing any file.** Use `har_launch_environment` with `agentId: 1` (MCP) or `har env launch 1`. Launch always creates a **fresh session worktree** and returns its **work dir**.
|
|
19
|
+
2. **Launch your slot FIRST — before editing any file.** Use `har_launch_environment` with `agentId: 1` (MCP) or `har env launch 1`. Launch always creates a **fresh session worktree** and returns its **work dir**. If the task binds to a durable external work item (a GitHub issue, a Linear ticket, a task from the user's tracker), pass `workUnitId` + `title` on launch (`har_launch_environment` `workUnitId`/`title`, or CLI `--work-id`/`--work-title`) so Mission Control attributes usage and events to that work item instead of leaving them session-only.
|
|
20
20
|
3. **Make ALL file edits under the returned work dir — never in the main checkout.** The work dir looks like `~/worktrees/<base-branch>-<sha4>-har-agent-<id>-<rand4>` (recorded in `.har/slots/agent-<id>.json`). Edits there hot-reload in the running slot; use `har env restart <id>` or `./.har/agent-cli.sh <id> restart` if a change doesn't take.
|
|
21
21
|
4. Read [AGENT.md](./AGENT.md) at the repo root
|
|
22
22
|
5. Read [.har/README.md](./.har/README.md) and [.har/stages.json](./.har/stages.json)
|