@fml-inc/fml 0.8.2-rc.1 → 0.8.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fml",
3
- "version": "0.8.2-rc.1",
3
+ "version": "0.8.2",
4
4
  "description": "FML agent tools for Claude Code",
5
5
  "mcpServers": {
6
6
  "fml": {
@@ -7,7 +7,7 @@ import {
7
7
  getSelectedOrg,
8
8
  getSiteUrlForConvexUrl,
9
9
  getValidToken
10
- } from "./chunk-A6HAEVJX.js";
10
+ } from "./chunk-TNJVAET3.js";
11
11
 
12
12
  // src/fml-client.ts
13
13
  var LOGIN_EXPIRED_MESSAGE = "Authentication expired. Run `fml login` to sign in again, then restart Claude Code.";
@@ -79,7 +79,7 @@ function createFmlClient(token, options = {}) {
79
79
  const repo = resolveRepoFromCwd(process.cwd());
80
80
  if (repo) body.repo = repo.repo;
81
81
  if (isServiceToken) {
82
- const { readTokens, SERVICE_TOKEN_LOGIN_USER_ID } = await import("./token-store-BT5THIAJ.js");
82
+ const { readTokens, SERVICE_TOKEN_LOGIN_USER_ID } = await import("./token-store-7OI3CMM4.js");
83
83
  const stored = readTokens(options.envName);
84
84
  const storedUserExternalId = stored?.tokenType === "service" && stored.user.id !== SERVICE_TOKEN_LOGIN_USER_ID ? stored.user.id : void 0;
85
85
  const userExternalId = process.env.FML_USER_EXTERNAL_ID ?? storedUserExternalId;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  OBSERVER_SERVICE_NAME
3
- } from "./chunk-KBT5RMAU.js";
3
+ } from "./chunk-F4A2POJX.js";
4
4
  import {
5
5
  FML_OBSERVER_LOCK_FILE,
6
6
  FML_OBSERVER_PORT,
7
7
  FML_OBSERVER_STATE_FILE
8
- } from "./chunk-A6HAEVJX.js";
8
+ } from "./chunk-TNJVAET3.js";
9
9
 
10
10
  // src/observer/state.ts
11
11
  import { randomUUID } from "crypto";
@@ -6,7 +6,7 @@ import {
6
6
  getSiteUrlForConvexUrl,
7
7
  getSyncDestinationIdentity,
8
8
  getValidToken
9
- } from "./chunk-A6HAEVJX.js";
9
+ } from "./chunk-TNJVAET3.js";
10
10
 
11
11
  // src/hooks/sync-loop.ts
12
12
  import { createHash } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FML_HOOK_INBOX_DIR
3
- } from "./chunk-A6HAEVJX.js";
3
+ } from "./chunk-TNJVAET3.js";
4
4
 
5
5
  // ../../packages/panopticon/src/observer/auth.ts
6
6
  import crypto from "crypto";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resolvePackageRoot,
3
3
  runRawSyncOnce
4
- } from "./chunk-YSU5CS2V.js";
4
+ } from "./chunk-UGUYQVUW.js";
5
5
 
6
6
  // src/observer/sync-cycle.ts
7
7
  import { fork } from "child_process";
@@ -317,6 +317,9 @@ function getSiteUrlForConvexUrl(convexUrl) {
317
317
  var initialized = false;
318
318
  var sentry = null;
319
319
  var client = null;
320
+ function isSentryEnabled() {
321
+ return process.env.SENTRY_ENABLED === "true";
322
+ }
320
323
  async function loadSentry() {
321
324
  if (sentry) return sentry;
322
325
  try {
@@ -329,10 +332,12 @@ async function loadSentry() {
329
332
  async function initSentry() {
330
333
  if (initialized) return;
331
334
  initialized = true;
335
+ if (!isSentryEnabled()) return;
332
336
  const mod = await loadSentry();
333
337
  if (!mod) return;
334
338
  client = new mod.ServerRuntimeClient({
335
339
  dsn: "https://4c243521c03917c886d0bf33bc0038c8@o4510167429873664.ingest.us.sentry.io/4511078213156864",
340
+ environment: process.env.DEPLOYMENT_ENV ?? process.env.NODE_ENV ?? "production",
336
341
  tracesSampleRate: 0,
337
342
  integrations: [],
338
343
  stackParser: mod.createStackParser(mod.nodeStackLineParser()),
@@ -6,7 +6,7 @@ import {
6
6
  getSiteUrlForConvexUrl,
7
7
  getSyncDestinationIdentity,
8
8
  getValidToken
9
- } from "./chunk-A6HAEVJX.js";
9
+ } from "./chunk-TNJVAET3.js";
10
10
 
11
11
  // ../../packages/panopticon/src/artifact.ts
12
12
  import {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FML_HOOK_CAPTURE_DISABLED_FILE
3
- } from "./chunk-A6HAEVJX.js";
3
+ } from "./chunk-TNJVAET3.js";
4
4
 
5
5
  // src/json-file.ts
6
6
  import { randomUUID } from "crypto";
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  createFmlClient,
4
4
  getAuthenticatedClient
5
- } from "./chunk-R45CWWZO.js";
5
+ } from "./chunk-26RJC76L.js";
6
6
  import {
7
7
  OBSERVER_HEARTBEAT_STALE_MS,
8
8
  getProcessIdentity,
@@ -10,13 +10,13 @@ import {
10
10
  isPidAlive,
11
11
  readObserverStateStatus,
12
12
  removeObserverStateIfOwned
13
- } from "./chunk-7DWFJENY.js";
13
+ } from "./chunk-3WDAKM5B.js";
14
14
  import {
15
15
  readJsonFile,
16
16
  setHookCaptureDisabled,
17
17
  writeJsonFile,
18
18
  writeTextFileAtomic
19
- } from "./chunk-ENW2GJNO.js";
19
+ } from "./chunk-UZG65JUB.js";
20
20
  import {
21
21
  CODEX_HOOK_EVENTS,
22
22
  GEMINI_HOOK_EVENTS,
@@ -24,7 +24,7 @@ import {
24
24
  isObserverHealth,
25
25
  readHookInboxStatus,
26
26
  readObserverAuthToken
27
- } from "./chunk-KBT5RMAU.js";
27
+ } from "./chunk-F4A2POJX.js";
28
28
  import "./chunk-7V7G7NVF.js";
29
29
  import {
30
30
  claudeConfigDirectory,
@@ -34,7 +34,7 @@ import {
34
34
  initializeSyncSettings,
35
35
  resolvePackageRoot,
36
36
  runRawSyncOnce
37
- } from "./chunk-YSU5CS2V.js";
37
+ } from "./chunk-UGUYQVUW.js";
38
38
  import {
39
39
  DEFAULT_PROD_URL,
40
40
  DEFAULT_TARGET_NAME,
@@ -76,7 +76,7 @@ import {
76
76
  storeServiceRefreshToken,
77
77
  writeEnvConfig,
78
78
  writeTokens
79
- } from "./chunk-A6HAEVJX.js";
79
+ } from "./chunk-TNJVAET3.js";
80
80
  import "./chunk-MLKGABMK.js";
81
81
 
82
82
  // src/cli.ts
@@ -124,7 +124,7 @@ var POLL_INTERVAL_MS = 50;
124
124
  var LOG_ROTATE_BYTES = 10 * 1024 * 1024;
125
125
  var LOG_ROTATE_FILES = 3;
126
126
  function expectedObserverVersion() {
127
- return true ? "0.8.2-rc.1+7fe2ebce" : "dev";
127
+ return true ? "0.8.2+e2bf128f" : "dev";
128
128
  }
129
129
  function delay(ms) {
130
130
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -7370,7 +7370,7 @@ async function runInteractiveLogin(opts = {}) {
7370
7370
  const envName = environment.envName;
7371
7371
  const existingToken = await getValidToken({ env: envName });
7372
7372
  if (existingToken) {
7373
- const { readTokens: readTokens2 } = await import("./token-store-BT5THIAJ.js");
7373
+ const { readTokens: readTokens2 } = await import("./token-store-7OI3CMM4.js");
7374
7374
  const stored = readTokens2(envName);
7375
7375
  if (stored?.tokenType === "service") {
7376
7376
  const label = stored.user.id === SERVICE_TOKEN_LOGIN_USER_ID ? "a service token" : `${stored.user.name} (${stored.user.email})`;
@@ -7898,7 +7898,7 @@ var PACKAGE_NAME = "@fml-inc/fml";
7898
7898
  var UPDATE_TIMEOUT_MS = 12e4;
7899
7899
  var SETUP_TIMEOUT_MS = 3e5;
7900
7900
  function getCurrentVersion() {
7901
- return true ? "0.8.2-rc.1+7fe2ebce" : "unknown";
7901
+ return true ? "0.8.2+e2bf128f" : "unknown";
7902
7902
  }
7903
7903
  function parseVersion(version) {
7904
7904
  const match = SEMVER_PATTERN.exec(version);
@@ -7980,12 +7980,13 @@ function createUpdateEnvironment(env) {
7980
7980
  return updateEnv;
7981
7981
  }
7982
7982
  function parseAvailableVersion(output) {
7983
- let version;
7983
+ let response;
7984
7984
  try {
7985
- version = JSON.parse(output);
7985
+ response = JSON.parse(output);
7986
7986
  } catch {
7987
7987
  throw new Error("Could not read the available FML version from npm.");
7988
7988
  }
7989
+ const version = Array.isArray(response) && response.length === 1 ? response[0] : response;
7989
7990
  if (typeof version !== "string" || !parseVersion(version)) {
7990
7991
  throw new Error("Could not read the available FML version from npm.");
7991
7992
  }
@@ -9036,7 +9037,7 @@ async function handleConfigDetail(opts) {
9036
9037
  // src/commands/tools.ts
9037
9038
  import { readFileSync } from "fs";
9038
9039
  import path29 from "path";
9039
- var pluginVersion = true ? "0.8.2-rc.1+7fe2ebce" : void 0;
9040
+ var pluginVersion = true ? "0.8.2+e2bf128f" : void 0;
9040
9041
  async function getApi() {
9041
9042
  const api = await getAuthenticatedClient();
9042
9043
  if (!api) {
@@ -9193,7 +9194,7 @@ if (process.argv.length <= 2 || process.argv.includes("--help") || process.argv.
9193
9194
  printBanner();
9194
9195
  }
9195
9196
  var program = new Command().name("fml").description("FML CLI and agent tools").version(
9196
- true ? "0.8.2-rc.1+7fe2ebce" : "dev"
9197
+ true ? "0.8.2+e2bf128f" : "dev"
9197
9198
  );
9198
9199
  function formatCommandInventory(cmd, prefix = "") {
9199
9200
  const name = prefix ? `${prefix} ${cmd.name()}` : cmd.name();
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  hookCaptureIsDisabled
4
- } from "./chunk-ENW2GJNO.js";
4
+ } from "./chunk-UZG65JUB.js";
5
5
  import {
6
6
  getActiveHookDestinationBinding
7
- } from "./chunk-DZKYW327.js";
7
+ } from "./chunk-E6YIJCIE.js";
8
8
  import {
9
9
  SHELL_TOOL_NAMES,
10
10
  createHookInboxEntry,
@@ -12,7 +12,7 @@ import {
12
12
  normalizeObserverHookCapture,
13
13
  persistHookInboxEntry,
14
14
  readObserverAuthToken
15
- } from "./chunk-KBT5RMAU.js";
15
+ } from "./chunk-F4A2POJX.js";
16
16
  import {
17
17
  resolveRepositoryRootFromCwd,
18
18
  resolveRepositorySlugFromCwd
@@ -23,7 +23,7 @@ import {
23
23
  FML_OBSERVER_AUTH_TOKEN_FILE,
24
24
  FML_OBSERVER_ENDPOINT_FILE,
25
25
  getValidToken
26
- } from "./chunk-A6HAEVJX.js";
26
+ } from "./chunk-TNJVAET3.js";
27
27
  import "./chunk-MLKGABMK.js";
28
28
 
29
29
  // src/hooks/handler.ts
@@ -46,6 +46,7 @@ var MODEL_CONTEXT_GUIDANCE = "If this FML context materially informs your work,
46
46
  var CONTEXT_GUIDANCE_SEPARATOR = "\n\n";
47
47
  var MAX_PROMPT_CHARS = 2e4;
48
48
  var STATE_MAX_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
49
+ var INJECTION_ID_VERSION = "v1";
49
50
  var EDIT_TOOL_NAMES = /* @__PURE__ */ new Set([
50
51
  "apply_patch",
51
52
  "edit",
@@ -58,6 +59,10 @@ var READ_TOOL_NAMES = /* @__PURE__ */ new Set(["read", "read_file"]);
58
59
  function sameDestination(left, right) {
59
60
  return left.environment === right.environment && left.targetUrl === right.targetUrl && left.destinationIdentity === right.destinationIdentity;
60
61
  }
62
+ function hookContextInjectionId(target2, syncId) {
63
+ const digest = createHash("sha256").update(`${INJECTION_ID_VERSION}\0${target2}\0${syncId}`).digest("base64url");
64
+ return `${INJECTION_ID_VERSION}_${digest}`;
65
+ }
61
66
  function markerPath(stateDir, kind, value) {
62
67
  const digest = createHash("sha256").update(value).digest("hex");
63
68
  return path.join(stateDir, kind, digest);
@@ -160,6 +165,8 @@ function buildServerHookContextRequest(target2, event, stateDir = FML_HOOK_CONTE
160
165
  const base = {
161
166
  repository: event.repository,
162
167
  sessionId: event.sessionId,
168
+ target: target2,
169
+ injectionId: hookContextInjectionId(target2, event.syncId),
163
170
  nowMs: event.timestampMs
164
171
  };
165
172
  if (event.eventType === "SessionStart") {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  createFmlClient,
4
4
  getAuthenticatedClient
5
- } from "../chunk-R45CWWZO.js";
5
+ } from "../chunk-26RJC76L.js";
6
6
  import {
7
7
  resolveRepoFromCwd
8
8
  } from "../chunk-7V7G7NVF.js";
@@ -17,7 +17,7 @@ import {
17
17
  getValidToken,
18
18
  initSentry,
19
19
  readTokens
20
- } from "../chunk-A6HAEVJX.js";
20
+ } from "../chunk-TNJVAET3.js";
21
21
  import "../chunk-MLKGABMK.js";
22
22
 
23
23
  // src/mcp/server.ts
@@ -6,11 +6,11 @@ import {
6
6
  observerLeaseIsOwned,
7
7
  removeObserverStateIfOwned,
8
8
  updateObserverState
9
- } from "./chunk-7DWFJENY.js";
9
+ } from "./chunk-3WDAKM5B.js";
10
10
  import {
11
11
  createHookSyncLoop,
12
12
  getActiveHookDestinationBinding
13
- } from "./chunk-DZKYW327.js";
13
+ } from "./chunk-E6YIJCIE.js";
14
14
  import {
15
15
  OBSERVER_PROTOCOL_VERSION,
16
16
  OBSERVER_SERVICE_NAME,
@@ -25,15 +25,15 @@ import {
25
25
  parseHookInboxMetadata,
26
26
  readHookInboxStatusAsync,
27
27
  retireHookInboxEntry
28
- } from "./chunk-KBT5RMAU.js";
28
+ } from "./chunk-F4A2POJX.js";
29
29
  import "./chunk-7V7G7NVF.js";
30
30
  import {
31
31
  ObserverSyncCycleAbortedError,
32
32
  runObserverSyncCycleSubprocess
33
- } from "./chunk-3KISRT57.js";
33
+ } from "./chunk-IZH4MDS4.js";
34
34
  import {
35
35
  createCliRawSync
36
- } from "./chunk-YSU5CS2V.js";
36
+ } from "./chunk-UGUYQVUW.js";
37
37
  import {
38
38
  FML_OBSERVER_AUTH_TOKEN_FILE,
39
39
  FML_OBSERVER_ENDPOINT_FILE,
@@ -50,7 +50,7 @@ import {
50
50
  getSyncDestinationAuthBinding,
51
51
  getValidToken,
52
52
  observerOnlyOverrideWarning
53
- } from "./chunk-A6HAEVJX.js";
53
+ } from "./chunk-TNJVAET3.js";
54
54
  import "./chunk-MLKGABMK.js";
55
55
 
56
56
  // src/observer-server.ts
@@ -1239,7 +1239,7 @@ var hookRejectionStatus = () => ({
1239
1239
  ...lastRejectedReason !== void 0 ? { lastRejectedReason } : {},
1240
1240
  ...lastRejectedTarget !== void 0 ? { lastRejectedTarget } : {}
1241
1241
  });
1242
- var packageVersion = true ? "0.8.2-rc.1+7fe2ebce" : "dev";
1242
+ var packageVersion = true ? "0.8.2+e2bf128f" : "dev";
1243
1243
  var health = () => ({
1244
1244
  status: "ok",
1245
1245
  service: OBSERVER_SERVICE_NAME,
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runObserverSyncCycle
4
- } from "./chunk-3KISRT57.js";
5
- import "./chunk-YSU5CS2V.js";
6
- import "./chunk-A6HAEVJX.js";
4
+ } from "./chunk-IZH4MDS4.js";
5
+ import "./chunk-UGUYQVUW.js";
6
+ import "./chunk-TNJVAET3.js";
7
7
  import "./chunk-MLKGABMK.js";
8
8
 
9
9
  // src/sync-cycle.ts
@@ -10,7 +10,7 @@ import {
10
10
  setSelectedOrg,
11
11
  storeServiceRefreshToken,
12
12
  writeTokens
13
- } from "./chunk-A6HAEVJX.js";
13
+ } from "./chunk-TNJVAET3.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
  export {
16
16
  SERVICE_TOKEN_LOGIN_USER_ID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fml-inc/fml",
3
- "version": "0.8.2-rc.1",
3
+ "version": "0.8.2",
4
4
  "description": "FML CLI and agent tools",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",