unfairly 0.8.2 → 0.8.3
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/CHANGELOG.md +6 -0
- package/README.md +3 -1
- package/dist/cmd/pace.d.ts +22 -1
- package/dist/cmd/pace.d.ts.map +1 -1
- package/dist/cmd/pace.js +60 -27
- package/dist/cmd/pace.js.map +1 -1
- package/dist/pace/device.d.ts +3 -0
- package/dist/pace/device.d.ts.map +1 -1
- package/dist/pace/device.js +1 -0
- package/dist/pace/device.js.map +1 -1
- package/dist/pace/enroll.d.ts +80 -0
- package/dist/pace/enroll.d.ts.map +1 -0
- package/dist/pace/enroll.js +138 -0
- package/dist/pace/enroll.js.map +1 -0
- package/dist/pace-runtime.d.ts +2 -0
- package/dist/pace-runtime.d.ts.map +1 -0
- package/dist/pace-runtime.js +67 -0
- package/dist/pace-runtime.js.map +1 -0
- package/package.json +4 -3
- package/plugin/.mcp.json +1 -1
- package/plugin/README.md +3 -7
- package/plugin/gemini/gemini-extension.json +1 -1
- package/plugin/mcp.json +1 -1
- package/plugin/runtime/unfairly-intelligence.mjs +5513 -0
- package/plugin/scripts/capture.cjs +30 -8
- package/plugin/skills/find-company-playbook/SKILL.md +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const { spawn } = require("node:child_process");
|
|
2
|
+
const { spawn, spawnSync } = require("node:child_process");
|
|
3
3
|
const fs = require("node:fs");
|
|
4
4
|
const os = require("node:os");
|
|
5
5
|
const path = require("node:path");
|
|
@@ -13,16 +13,38 @@ const source = process.env.GEMINI_CLI_HOME
|
|
|
13
13
|
? "codex"
|
|
14
14
|
: "claude_code";
|
|
15
15
|
|
|
16
|
+
// Prefer the runtime bundled with this plugin, so installing the plugin from
|
|
17
|
+
// an AI client's plugin store is the whole install. Fall back to a runtime
|
|
18
|
+
// placed by `npx unfairly`, then to a global `unfairly`.
|
|
19
|
+
const bundled = path.join(__dirname, "..", "runtime", "unfairly-intelligence.mjs");
|
|
16
20
|
let command = "unfairly";
|
|
17
21
|
let args = ["pace", "capture", "--source", source, "--event", event];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
let connectArgs = null;
|
|
23
|
+
if (fs.existsSync(bundled)) {
|
|
24
|
+
command = process.execPath;
|
|
25
|
+
args = [bundled, "capture", source, event];
|
|
26
|
+
connectArgs = [bundled, "connect", source, event];
|
|
27
|
+
} else {
|
|
28
|
+
try {
|
|
29
|
+
const pointer = JSON.parse(fs.readFileSync(path.join(os.homedir(), ".unfairly", "runtime", "current.json"), "utf8"));
|
|
30
|
+
if (typeof pointer.node === "string" && typeof pointer.entrypoint === "string") {
|
|
31
|
+
command = pointer.node;
|
|
32
|
+
args = [pointer.entrypoint, ...args];
|
|
33
|
+
}
|
|
34
|
+
} catch {
|
|
35
|
+
// Compatibility fallback for existing global installs.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// On session start, check the connection synchronously (bounded) so a
|
|
40
|
+
// first-run "connect this machine" link can reach the person.
|
|
41
|
+
if (connectArgs && (event === "SessionStart" || event === "sessionStart")) {
|
|
42
|
+
try {
|
|
43
|
+
const result = spawnSync(command, connectArgs, { encoding: "utf8", timeout: 4000, env: process.env, stdio: ["ignore", "pipe", "ignore"] });
|
|
44
|
+
if (result.stdout && result.stdout.trim()) process.stdout.write(result.stdout);
|
|
45
|
+
} catch {
|
|
46
|
+
// Never block or fail the session over telemetry.
|
|
23
47
|
}
|
|
24
|
-
} catch {
|
|
25
|
-
// Compatibility fallback for existing global installs.
|
|
26
48
|
}
|
|
27
49
|
|
|
28
50
|
// Read the hook payload, hand it to a detached runtime process, and return at
|
|
@@ -5,7 +5,7 @@ description: Find and apply an approved company playbook when an employee asks h
|
|
|
5
5
|
|
|
6
6
|
# Find a company playbook
|
|
7
7
|
|
|
8
|
-
Search the approved Unfairly
|
|
8
|
+
Search the company's approved methods before inventing a new workflow: use the Unfairly connector's `find_skill` tool (then `run_skill` to load one), or `unfairly intelligence playbooks --query "<employee goal>"` if the Unfairly CLI is installed. Prefer a published playbook; label a pilot-ready playbook as a pilot.
|
|
9
9
|
|
|
10
10
|
Show the employee the playbook title, intended outcome, owner, source requirements, and ordered steps. Ask before taking consequential actions. When the playbook is used, preserve its identifier and version in Unfairly Intelligence workflow context so reuse and downstream outcomes can be measured.
|
|
11
11
|
|