unfairly 0.8.1 → 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 +14 -0
- package/README.md +17 -2
- package/dist/auth/browser-flow.d.ts +9 -0
- package/dist/auth/browser-flow.d.ts.map +1 -1
- package/dist/auth/browser-flow.js +11 -4
- package/dist/auth/browser-flow.js.map +1 -1
- package/dist/cmd/invite.js +2 -2
- package/dist/cmd/invite.js.map +1 -1
- package/dist/cmd/pace.d.ts +101 -0
- package/dist/cmd/pace.d.ts.map +1 -0
- package/dist/cmd/pace.js +426 -0
- package/dist/cmd/pace.js.map +1 -0
- package/dist/cmd/setup.d.ts +2 -0
- package/dist/cmd/setup.d.ts.map +1 -1
- package/dist/cmd/setup.js +20 -6
- package/dist/cmd/setup.js.map +1 -1
- package/dist/index.js +96 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/types/index.d.ts +6 -6
- package/dist/pace/device.d.ts +104 -0
- package/dist/pace/device.d.ts.map +1 -0
- package/dist/pace/device.js +149 -0
- package/dist/pace/device.js.map +1 -0
- 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/identity.d.ts +10 -0
- package/dist/pace/identity.d.ts.map +1 -0
- package/dist/pace/identity.js +17 -0
- package/dist/pace/identity.js.map +1 -0
- package/dist/pace/install.d.ts +28 -0
- package/dist/pace/install.d.ts.map +1 -0
- package/dist/pace/install.js +127 -0
- package/dist/pace/install.js.map +1 -0
- package/dist/pace/local-evidence.d.ts +75 -0
- package/dist/pace/local-evidence.d.ts.map +1 -0
- package/dist/pace/local-evidence.js +228 -0
- package/dist/pace/local-evidence.js.map +1 -0
- package/dist/pace/local-sessions.d.ts +48 -0
- package/dist/pace/local-sessions.d.ts.map +1 -0
- package/dist/pace/local-sessions.js +254 -0
- package/dist/pace/local-sessions.js.map +1 -0
- package/dist/pace/managed-config.d.ts +21 -0
- package/dist/pace/managed-config.d.ts.map +1 -0
- package/dist/pace/managed-config.js +102 -0
- package/dist/pace/managed-config.js.map +1 -0
- package/dist/pace/normalize.d.ts +10 -0
- package/dist/pace/normalize.d.ts.map +1 -0
- package/dist/pace/normalize.js +293 -0
- package/dist/pace/normalize.js.map +1 -0
- package/dist/pace/repository.d.ts +72 -0
- package/dist/pace/repository.d.ts.map +1 -0
- package/dist/pace/repository.js +120 -0
- package/dist/pace/repository.js.map +1 -0
- package/dist/pace/schema.d.ts +1325 -0
- package/dist/pace/schema.d.ts.map +1 -0
- package/dist/pace/schema.js +134 -0
- package/dist/pace/schema.js.map +1 -0
- package/dist/pace/session-summary.d.ts +179 -0
- package/dist/pace/session-summary.d.ts.map +1 -0
- package/dist/pace/session-summary.js +140 -0
- package/dist/pace/session-summary.js.map +1 -0
- package/dist/pace/spool.d.ts +6 -0
- package/dist/pace/spool.d.ts.map +1 -0
- package/dist/pace/spool.js +87 -0
- package/dist/pace/spool.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 +5 -2
- package/plugin/.claude-plugin/plugin.json +9 -0
- package/plugin/.codex-plugin/plugin.json +21 -0
- package/plugin/.cursor-plugin/plugin.json +16 -0
- package/plugin/.mcp.json +8 -0
- package/plugin/README.md +15 -0
- package/plugin/deploy/README.md +30 -0
- package/plugin/gemini/GEMINI.md +3 -0
- package/plugin/gemini/gemini-extension.json +12 -0
- package/plugin/gemini/hooks/hooks.json +52 -0
- package/plugin/hooks/cursor-hooks.json +25 -0
- package/plugin/hooks/hooks.json +56 -0
- package/plugin/mcp.json +10 -0
- package/plugin/plugin.json +32 -0
- package/plugin/runtime/unfairly-intelligence.mjs +5513 -0
- package/plugin/scripts/capture.cjs +68 -0
- package/plugin/skills/find-company-playbook/SKILL.md +12 -0
- package/plugin/skills/publish-learning/SKILL.md +8 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawn, spawnSync } = require("node:child_process");
|
|
3
|
+
const fs = require("node:fs");
|
|
4
|
+
const os = require("node:os");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
|
|
7
|
+
const event = process.argv[2] || process.env.HOOK_EVENT_NAME || "Unknown";
|
|
8
|
+
const source = process.env.GEMINI_CLI_HOME
|
|
9
|
+
? "gemini_cli"
|
|
10
|
+
: process.env.CURSOR_PLUGIN_ROOT || process.env.CURSOR_PROJECT_DIR
|
|
11
|
+
? "cursor"
|
|
12
|
+
: process.env.PLUGIN_ROOT
|
|
13
|
+
? "codex"
|
|
14
|
+
: "claude_code";
|
|
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");
|
|
20
|
+
let command = "unfairly";
|
|
21
|
+
let args = ["pace", "capture", "--source", source, "--event", event];
|
|
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.
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Read the hook payload, hand it to a detached runtime process, and return at
|
|
51
|
+
// once: summarizing transcripts and uploading must never make the AI client wait.
|
|
52
|
+
const chunks = [];
|
|
53
|
+
process.stdin.on("data", (chunk) => chunks.push(chunk));
|
|
54
|
+
process.stdin.on("error", () => process.exit(0));
|
|
55
|
+
process.stdin.on("end", () => {
|
|
56
|
+
let child;
|
|
57
|
+
try {
|
|
58
|
+
child = spawn(command, args, { stdio: ["pipe", "ignore", "ignore"], env: process.env, detached: true });
|
|
59
|
+
} catch {
|
|
60
|
+
process.exit(0);
|
|
61
|
+
}
|
|
62
|
+
child.on("error", () => process.exit(0));
|
|
63
|
+
child.stdin.on("error", () => undefined);
|
|
64
|
+
child.stdin.end(Buffer.concat(chunks), () => {
|
|
65
|
+
child.unref();
|
|
66
|
+
process.exit(0);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: find-company-playbook
|
|
3
|
+
description: Find and apply an approved company playbook when an employee asks how the organization handles a task, wants a reusable workflow, or starts work that may match an existing method.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Find a company playbook
|
|
7
|
+
|
|
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
|
+
|
|
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
|
+
|
|
12
|
+
Never expose another employee's prompts, responses, files, source code, or private session history. If no playbook matches, complete the work normally and offer to propose the successful method as a new learning.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: publish-learning
|
|
3
|
+
description: Propose a reusable, content-safe team playbook from a successful workflow when the user asks to share or publish a learning.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Publish an Unfairly Intelligence learning
|
|
7
|
+
|
|
8
|
+
Summarize the reusable workflow, not the private work product. Include the goal, tools and skills used, ordered steps, verification method, common failures, and resulting artifact type. Exclude prompts, responses, secrets, source code, customer data, file contents, and raw command output. Ask the employee to approve the proposed playbook before publishing it through Unfairly.
|