larkin 0.2.70
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/CONTRIBUTING.md +48 -0
- package/LICENSE +201 -0
- package/README.md +122 -0
- package/SECURITY.md +14 -0
- package/artifacts/release/THIRD_PARTY_NOTICES.txt +5488 -0
- package/dist/agent/agent-cli-capabilities.cjs +43 -0
- package/dist/agent/agent-cli-capabilities.mjs +35 -0
- package/dist/agent/agent-state-store.cjs +961 -0
- package/dist/agent/agent-state-store.mjs +923 -0
- package/dist/agent/agent-transport.cjs +201 -0
- package/dist/agent/agent-transport.mjs +194 -0
- package/dist/agent/config-cli-contract.cjs +19 -0
- package/dist/agent/config-cli-contract.mjs +16 -0
- package/dist/agent/context-prompt.cjs +159 -0
- package/dist/agent/context-prompt.mjs +155 -0
- package/dist/agent/freshness-gate.mjs +24 -0
- package/dist/agent/history-projection.cjs +72 -0
- package/dist/agent/history-projection.mjs +65 -0
- package/dist/agent/host-reminder-orchestrator.cjs +289 -0
- package/dist/agent/host-reminder-orchestrator.mjs +252 -0
- package/dist/agent/inbox-projection.cjs +92 -0
- package/dist/agent/inbox-projection.mjs +85 -0
- package/dist/agent/interaction-state-machine.cjs +710 -0
- package/dist/agent/interaction-state-machine.mjs +705 -0
- package/dist/agent/reminder-routes.cjs +192 -0
- package/dist/agent/reminder-routes.mjs +156 -0
- package/dist/agent/reminder-store.cjs +220 -0
- package/dist/agent/reminder-store.mjs +205 -0
- package/dist/agent/transport-business-context.cjs +486 -0
- package/dist/agent/transport-business-context.mjs +446 -0
- package/dist/agent/transport-shell.cjs +45 -0
- package/dist/agent/transport-shell.mjs +39 -0
- package/dist/app/agent-cli.mjs +596 -0
- package/dist/app/agent-config.mjs +633 -0
- package/dist/app/agent-lark-cli-workspace.cjs +95 -0
- package/dist/app/agent-lark-cli-workspace.mjs +85 -0
- package/dist/app/agent-readiness.cjs +42 -0
- package/dist/app/agent-readiness.mjs +38 -0
- package/dist/app/binary-entry.mjs +86 -0
- package/dist/app/cli.mjs +176 -0
- package/dist/app/dashboard.mjs +205 -0
- package/dist/app/internal-command.cjs +57 -0
- package/dist/app/internal-command.mjs +48 -0
- package/dist/app/lark-channel-secret.mjs +22 -0
- package/dist/app/lark-cli.mjs +887 -0
- package/dist/app/lark.mjs +45 -0
- package/dist/app/local-control.mjs +728 -0
- package/dist/app/official-lark-cli.cjs +138 -0
- package/dist/app/official-lark-cli.mjs +128 -0
- package/dist/app/pi-auth-cli.mjs +67 -0
- package/dist/app/run.mjs +364 -0
- package/dist/app/runtime-agent-config.mjs +416 -0
- package/dist/app/runtime-model-directory.mjs +78 -0
- package/dist/app/runtime-process.mjs +113 -0
- package/dist/app/session-cli.mjs +83 -0
- package/dist/app/setup-dashboard.mjs +26 -0
- package/dist/app/setup.mjs +166 -0
- package/dist/app/telemetry.mjs +83 -0
- package/dist/dashboard/dashboard-assets.mjs +21 -0
- package/dist/dashboard/dashboard-avatar.mjs +128 -0
- package/dist/dashboard/dashboard-config-controller.mjs +525 -0
- package/dist/dashboard/dashboard-lifecycle.cjs +97 -0
- package/dist/dashboard/dashboard-lifecycle.mjs +88 -0
- package/dist/dashboard/dashboard-template.mjs +29 -0
- package/dist/dashboard/dashboard-view-model.mjs +556 -0
- package/dist/dashboard/dashboard-workspace.mjs +104 -0
- package/dist/dashboard/web/assets/dashboard.css +3 -0
- package/dist/dashboard/web/assets/dashboard.js +49 -0
- package/dist/feishu/channel-transport.cjs +151 -0
- package/dist/feishu/channel-transport.mjs +148 -0
- package/dist/feishu/document-comment.cjs +120 -0
- package/dist/feishu/document-comment.mjs +109 -0
- package/dist/feishu/host-business-state.cjs +477 -0
- package/dist/feishu/host-business-state.mjs +462 -0
- package/dist/feishu/host-channel-business.cjs +161 -0
- package/dist/feishu/host-channel-business.mjs +157 -0
- package/dist/feishu/host-processing-eye.cjs +185 -0
- package/dist/feishu/host-processing-eye.mjs +181 -0
- package/dist/feishu/host-shell.cjs +1425 -0
- package/dist/feishu/host-shell.mjs +1385 -0
- package/dist/feishu/im-freshness-adapter.mjs +89 -0
- package/dist/feishu/interaction-orchestrator.cjs +279 -0
- package/dist/feishu/interaction-orchestrator.mjs +242 -0
- package/dist/feishu/lark-passthrough.mjs +70 -0
- package/dist/feishu/message-policy.cjs +111 -0
- package/dist/feishu/message-policy.mjs +98 -0
- package/dist/feishu/outbound-transport.cjs +221 -0
- package/dist/feishu/outbound-transport.mjs +215 -0
- package/dist/platform/build-info.cjs +25 -0
- package/dist/platform/build-info.mjs +18 -0
- package/dist/platform/callback-capability.cjs +301 -0
- package/dist/platform/callback-capability.mjs +252 -0
- package/dist/platform/check-bun-version.cjs +12 -0
- package/dist/platform/config.cjs +751 -0
- package/dist/platform/config.mjs +694 -0
- package/dist/platform/process-inspect.cjs +89 -0
- package/dist/platform/process-state.cjs +237 -0
- package/dist/platform/process-state.mjs +223 -0
- package/dist/platform/release-artifacts.mjs +61 -0
- package/dist/platform/root-layout.cjs +111 -0
- package/dist/platform/root-layout.mjs +72 -0
- package/dist/platform/telemetry-config.cjs +64 -0
- package/dist/platform/telemetry-config.mjs +56 -0
- package/dist/platform/telemetry-spool.cjs +661 -0
- package/dist/platform/telemetry-spool.mjs +653 -0
- package/dist/platform/telemetry-tracing.cjs +602 -0
- package/dist/platform/telemetry-tracing.mjs +596 -0
- package/dist/platform/telemetry-uploader.cjs +150 -0
- package/dist/platform/telemetry-uploader.mjs +146 -0
- package/dist/platform/workspace-service.cjs +469 -0
- package/dist/platform/workspace-service.mjs +430 -0
- package/dist/runtime/builtin-pi-assets.mjs +33 -0
- package/dist/runtime/claude-model-catalog.cjs +102 -0
- package/dist/runtime/claude-model-catalog.mjs +99 -0
- package/dist/runtime/codex-model-catalog.cjs +108 -0
- package/dist/runtime/codex-model-catalog.mjs +105 -0
- package/dist/runtime/pi-bash-timeout-extension.mjs +60 -0
- package/dist/runtime/pi-bash-timeout-injection.mjs +60 -0
- package/dist/runtime/pi-bash-timeout.bundle.js +43 -0
- package/dist/runtime/pi-model-catalog.cjs +116 -0
- package/dist/runtime/pi-model-catalog.mjs +75 -0
- package/dist/runtime/pi-official-auth.mjs +480 -0
- package/dist/runtime/pi-provider-config.cjs +252 -0
- package/dist/runtime/pi-provider-config.mjs +239 -0
- package/dist/runtime/pi-rpc-client.cjs +255 -0
- package/dist/runtime/pi-rpc-client.mjs +251 -0
- package/dist/runtime/pi-subagent-injection.mjs +129 -0
- package/dist/runtime/pi-subagents.bundle.js +8990 -0
- package/dist/runtime/runtime-adapters.mjs +1019 -0
- package/dist/runtime/runtime-contracts.cjs +2 -0
- package/dist/runtime/runtime-contracts.mjs +1 -0
- package/dist/runtime/runtime-host.cjs +930 -0
- package/dist/runtime/runtime-host.mjs +922 -0
- package/dist/runtime/runtime-model-catalog.cjs +43 -0
- package/dist/runtime/runtime-model-catalog.mjs +40 -0
- package/dist/runtime/runtime-readiness.cjs +177 -0
- package/dist/runtime/runtime-readiness.mjs +133 -0
- package/dist/setup/bot-register.mjs +655 -0
- package/dist/setup/grant-scopes.mjs +133 -0
- package/dist/setup/run-credential-preflight.mjs +89 -0
- package/dist/setup/setup-agent-choice.mjs +172 -0
- package/dist/setup/setup-bind.mjs +337 -0
- package/dist/setup/setup-binding.mjs +52 -0
- package/package.json +112 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AGENT_CLI_CAPABILITIES = void 0;
|
|
7
|
+
exports.resolveAgentCliExecutable = resolveAgentCliExecutable;
|
|
8
|
+
exports.agentCliPromptCapabilities = agentCliPromptCapabilities;
|
|
9
|
+
const node_process_1 = __importDefault(require("node:process"));
|
|
10
|
+
const config_cli_contract_js_1 = require("./config-cli-contract.cjs");
|
|
11
|
+
const internal_command_js_1 = require("../app/internal-command.cjs");
|
|
12
|
+
exports.AGENT_CLI_CAPABILITIES = Object.freeze({
|
|
13
|
+
version: 1,
|
|
14
|
+
commands: Object.freeze({
|
|
15
|
+
inbox: Object.freeze(["check", "poll"]),
|
|
16
|
+
comment: Object.freeze(["reply"]),
|
|
17
|
+
reminder: Object.freeze(["schedule", "list", "snooze", "update", "cancel", "log"]),
|
|
18
|
+
interaction: Object.freeze(["callback-status", "callback-probe", "create", "get", "resolve"]),
|
|
19
|
+
profile: Object.freeze(["show"]),
|
|
20
|
+
config: config_cli_contract_js_1.CONFIG_CLI_OPERATIONS,
|
|
21
|
+
}),
|
|
22
|
+
});
|
|
23
|
+
function posixQuote(value) {
|
|
24
|
+
return `'${value.replaceAll("'", `'"'"'`)}'`;
|
|
25
|
+
}
|
|
26
|
+
function resolveAgentCliExecutable(cliPath, runtimeExecutable = node_process_1.default.execPath) {
|
|
27
|
+
if (cliPath === internal_command_js_1.INTERNAL_AGENT_CLI)
|
|
28
|
+
return (0, internal_command_js_1.internalCommandShell)("agent-cli");
|
|
29
|
+
return cliPath ? `${posixQuote(runtimeExecutable)} ${posixQuote(cliPath)}` : "larkin";
|
|
30
|
+
}
|
|
31
|
+
function agentCliPromptCapabilities(executable = "larkin") {
|
|
32
|
+
const commands = Object.entries(exports.AGENT_CLI_CAPABILITIES.commands).flatMap(([group, operations]) => operations.map((operation) => ({
|
|
33
|
+
command: `${group} ${operation}`,
|
|
34
|
+
purpose: group === "inbox" ? (operation === "check" ? "Read pending target summaries without consuming messages." : "Poll full messages and direct-ack the returned batch.") :
|
|
35
|
+
group === "comment" ? "Reply once to the exact cloud-document comment bound by a polled Inbox message id." :
|
|
36
|
+
group === "reminder" ? "Manage this Agent's durable reminders." :
|
|
37
|
+
group === "interaction" ? "Create, inspect, or resolve a durable interactive card run." :
|
|
38
|
+
group === "profile" ? "Show this Agent's locked identity." :
|
|
39
|
+
group === "config" ? "Read or update safe Larkin configuration; credentials and Feishu identity stay locked." :
|
|
40
|
+
"Use this Larkin-owned command.",
|
|
41
|
+
})));
|
|
42
|
+
return { executable, commands: commands };
|
|
43
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { CONFIG_CLI_OPERATIONS } from "./config-cli-contract.mjs";
|
|
3
|
+
import { INTERNAL_AGENT_CLI, internalCommandShell } from "../app/internal-command.mjs";
|
|
4
|
+
export const AGENT_CLI_CAPABILITIES = Object.freeze({
|
|
5
|
+
version: 1,
|
|
6
|
+
commands: Object.freeze({
|
|
7
|
+
inbox: Object.freeze(["check", "poll"]),
|
|
8
|
+
comment: Object.freeze(["reply"]),
|
|
9
|
+
reminder: Object.freeze(["schedule", "list", "snooze", "update", "cancel", "log"]),
|
|
10
|
+
interaction: Object.freeze(["callback-status", "callback-probe", "create", "get", "resolve"]),
|
|
11
|
+
profile: Object.freeze(["show"]),
|
|
12
|
+
config: CONFIG_CLI_OPERATIONS,
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
function posixQuote(value) {
|
|
16
|
+
return `'${value.replaceAll("'", `'"'"'`)}'`;
|
|
17
|
+
}
|
|
18
|
+
export function resolveAgentCliExecutable(cliPath, runtimeExecutable = process.execPath) {
|
|
19
|
+
if (cliPath === INTERNAL_AGENT_CLI)
|
|
20
|
+
return internalCommandShell("agent-cli");
|
|
21
|
+
return cliPath ? `${posixQuote(runtimeExecutable)} ${posixQuote(cliPath)}` : "larkin";
|
|
22
|
+
}
|
|
23
|
+
export function agentCliPromptCapabilities(executable = "larkin") {
|
|
24
|
+
const commands = Object.entries(AGENT_CLI_CAPABILITIES.commands).flatMap(([group, operations]) => operations.map((operation) => ({
|
|
25
|
+
command: `${group} ${operation}`,
|
|
26
|
+
purpose: group === "inbox" ? (operation === "check" ? "Read pending target summaries without consuming messages." : "Poll full messages and direct-ack the returned batch.") :
|
|
27
|
+
group === "comment" ? "Reply once to the exact cloud-document comment bound by a polled Inbox message id." :
|
|
28
|
+
group === "reminder" ? "Manage this Agent's durable reminders." :
|
|
29
|
+
group === "interaction" ? "Create, inspect, or resolve a durable interactive card run." :
|
|
30
|
+
group === "profile" ? "Show this Agent's locked identity." :
|
|
31
|
+
group === "config" ? "Read or update safe Larkin configuration; credentials and Feishu identity stay locked." :
|
|
32
|
+
"Use this Larkin-owned command.",
|
|
33
|
+
})));
|
|
34
|
+
return { executable, commands: commands };
|
|
35
|
+
}
|