@fml-inc/fml 0.8.3-rc.1 → 0.8.4-rc.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/.claude-plugin/plugin.json +1 -1
- package/dist/{chunk-UGUYQVUW.js → chunk-4LJVPXII.js} +4 -2
- package/dist/{chunk-IZH4MDS4.js → chunk-4U4XXSH2.js} +1 -1
- package/dist/{chunk-E6YIJCIE.js → chunk-G5HGOPWY.js} +10 -0
- package/dist/cli.js +5 -5
- package/dist/hook-handler.js +1 -1
- package/dist/mcp/server.js +4 -1
- package/dist/observer-server.js +4 -4
- package/dist/sync-cycle.js +2 -2
- package/package.json +1 -1
|
@@ -235,7 +235,7 @@ function walkFiles(input) {
|
|
|
235
235
|
const root = normalizeFilePath(input.root);
|
|
236
236
|
const files = [];
|
|
237
237
|
const seen = /* @__PURE__ */ new Set();
|
|
238
|
-
const skipDirs = input.skipDirs ??
|
|
238
|
+
const skipDirs = /* @__PURE__ */ new Set([...DEFAULT_SKIP_DIRS, ...input.skipDirs ?? []]);
|
|
239
239
|
function walk(dir, depth) {
|
|
240
240
|
if (depth > input.maxDepth) return;
|
|
241
241
|
for (const entry of safeReaddir(dir)) {
|
|
@@ -741,6 +741,7 @@ var grokArtifactDiscovery = Object.freeze({
|
|
|
741
741
|
|
|
742
742
|
// ../../packages/agent-targets/src/artifacts/targets/pi.ts
|
|
743
743
|
import path15 from "path";
|
|
744
|
+
var PI_SKIP_DIRS = /* @__PURE__ */ new Set(["subagent-artifacts"]);
|
|
744
745
|
function piTranscriptCandidate(sourcePath, context) {
|
|
745
746
|
const fallbackObservedAtMs = (context.nowMs ?? Date.now)();
|
|
746
747
|
for (const record of readJsonlContextRecords(sourcePath)) {
|
|
@@ -779,7 +780,8 @@ var piArtifactDiscovery = Object.freeze({
|
|
|
779
780
|
return walkFiles({
|
|
780
781
|
root: path15.join(homeDir, ".pi", "agent", "sessions"),
|
|
781
782
|
maxDepth: 8,
|
|
782
|
-
includeFile: (filePath) => filePath.endsWith(".jsonl")
|
|
783
|
+
includeFile: (filePath) => filePath.endsWith(".jsonl"),
|
|
784
|
+
skipDirs: PI_SKIP_DIRS
|
|
783
785
|
}).map((sourcePath) => piTranscriptCandidate(sourcePath, context));
|
|
784
786
|
}
|
|
785
787
|
});
|
|
@@ -449,17 +449,27 @@ function hookSessionRow(events) {
|
|
|
449
449
|
const cwds = [...cwdsByPath.values()].sort(
|
|
450
450
|
(left, right) => left.firstSeenMs - right.firstSeenMs || left.order - right.order
|
|
451
451
|
).map(({ order: _order, ...relationship }) => relationship);
|
|
452
|
+
const timezone = machineTimezone();
|
|
452
453
|
return {
|
|
453
454
|
sessionId: first.sessionId,
|
|
454
455
|
target: first.target,
|
|
455
456
|
startedAtMs,
|
|
456
457
|
createdAt: startedAtMs,
|
|
457
458
|
machine: "local",
|
|
459
|
+
...timezone ? { timezone } : {},
|
|
458
460
|
...firstPrompt ? { firstPrompt } : {},
|
|
459
461
|
...repositories.length > 0 ? { repositories } : {},
|
|
460
462
|
...cwds.length > 0 ? { cwds } : {}
|
|
461
463
|
};
|
|
462
464
|
}
|
|
465
|
+
function machineTimezone() {
|
|
466
|
+
try {
|
|
467
|
+
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
468
|
+
return timezone && timezone.length > 0 ? timezone : void 0;
|
|
469
|
+
} catch {
|
|
470
|
+
return void 0;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
463
473
|
function batchesForSession(events) {
|
|
464
474
|
const batches = [];
|
|
465
475
|
let batch = [];
|
package/dist/cli.js
CHANGED
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
initializeSyncSettings,
|
|
35
35
|
resolvePackageRoot,
|
|
36
36
|
runRawSyncOnce
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-4LJVPXII.js";
|
|
38
38
|
import {
|
|
39
39
|
DEFAULT_PROD_URL,
|
|
40
40
|
DEFAULT_TARGET_NAME,
|
|
@@ -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.
|
|
127
|
+
return true ? "0.8.4-rc.1+bb22ea9f" : "dev";
|
|
128
128
|
}
|
|
129
129
|
function delay(ms) {
|
|
130
130
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -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.
|
|
7901
|
+
return true ? "0.8.4-rc.1+bb22ea9f" : "unknown";
|
|
7902
7902
|
}
|
|
7903
7903
|
function parseVersion(version) {
|
|
7904
7904
|
const match = SEMVER_PATTERN.exec(version);
|
|
@@ -9037,7 +9037,7 @@ async function handleConfigDetail(opts) {
|
|
|
9037
9037
|
// src/commands/tools.ts
|
|
9038
9038
|
import { readFileSync } from "fs";
|
|
9039
9039
|
import path29 from "path";
|
|
9040
|
-
var pluginVersion = true ? "0.8.
|
|
9040
|
+
var pluginVersion = true ? "0.8.4-rc.1+bb22ea9f" : void 0;
|
|
9041
9041
|
async function getApi() {
|
|
9042
9042
|
const api = await getAuthenticatedClient();
|
|
9043
9043
|
if (!api) {
|
|
@@ -9194,7 +9194,7 @@ if (process.argv.length <= 2 || process.argv.includes("--help") || process.argv.
|
|
|
9194
9194
|
printBanner();
|
|
9195
9195
|
}
|
|
9196
9196
|
var program = new Command().name("fml").description("FML CLI and agent tools").version(
|
|
9197
|
-
true ? "0.8.
|
|
9197
|
+
true ? "0.8.4-rc.1+bb22ea9f" : "dev"
|
|
9198
9198
|
);
|
|
9199
9199
|
function formatCommandInventory(cmd, prefix = "") {
|
|
9200
9200
|
const name = prefix ? `${prefix} ${cmd.name()}` : cmd.name();
|
package/dist/hook-handler.js
CHANGED
package/dist/mcp/server.js
CHANGED
|
@@ -342,13 +342,16 @@ function registerTools(server2, environment = getActiveEnv()) {
|
|
|
342
342
|
);
|
|
343
343
|
server2.tool(
|
|
344
344
|
"get_ai_spending",
|
|
345
|
-
"Get AI spending and token usage data. Groups by 'session' (default), 'model', or 'day'.",
|
|
345
|
+
"Get AI spending and token usage data. Groups by 'session' (default), 'model', 'day', or 'user'. Usage is event-time attributed: day groups reflect when tokens were actually consumed, in each author's local timezone, not session start times. Time windows have 15-minute bucket resolution.",
|
|
346
346
|
{
|
|
347
347
|
timeRange: z.enum(["1h", "6h", "24h", "7d", "30d"]).optional().describe("Default '7d'."),
|
|
348
348
|
since: z.string().optional().describe("ISO 8601 start timestamp."),
|
|
349
349
|
until: z.string().optional().describe("ISO 8601 end timestamp."),
|
|
350
350
|
groupBy: z.enum(["session", "model", "day", "user"]).optional().describe("How to group results."),
|
|
351
351
|
target: z.enum(["claude", "codex", "gemini", "mastra"]).optional().describe("Filter by agent type. Omit for all."),
|
|
352
|
+
timezone: z.string().optional().describe(
|
|
353
|
+
"IANA timezone fallback for day grouping when a session's author has no recorded timezone (author-recorded timezones win). Defaults to UTC."
|
|
354
|
+
),
|
|
352
355
|
limit: z.number().int().min(1).max(500).optional().describe("Maximum groups to return, default 100."),
|
|
353
356
|
offset: z.number().int().min(0).optional().describe("Groups to skip; use nextOffset from the previous page.")
|
|
354
357
|
},
|
package/dist/observer-server.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
createHookSyncLoop,
|
|
12
12
|
getActiveHookDestinationBinding
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-G5HGOPWY.js";
|
|
14
14
|
import {
|
|
15
15
|
OBSERVER_PROTOCOL_VERSION,
|
|
16
16
|
OBSERVER_SERVICE_NAME,
|
|
@@ -30,10 +30,10 @@ import "./chunk-7V7G7NVF.js";
|
|
|
30
30
|
import {
|
|
31
31
|
ObserverSyncCycleAbortedError,
|
|
32
32
|
runObserverSyncCycleSubprocess
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-4U4XXSH2.js";
|
|
34
34
|
import {
|
|
35
35
|
createCliRawSync
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-4LJVPXII.js";
|
|
37
37
|
import {
|
|
38
38
|
FML_OBSERVER_AUTH_TOKEN_FILE,
|
|
39
39
|
FML_OBSERVER_ENDPOINT_FILE,
|
|
@@ -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.
|
|
1242
|
+
var packageVersion = true ? "0.8.4-rc.1+bb22ea9f" : "dev";
|
|
1243
1243
|
var health = () => ({
|
|
1244
1244
|
status: "ok",
|
|
1245
1245
|
service: OBSERVER_SERVICE_NAME,
|
package/dist/sync-cycle.js
CHANGED