Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33,688 changes: 33,688 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dist/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lib/openclaw-plugin-sdk-core.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module "openclaw/plugin-sdk/core" {
export function jsonResult(...args: any[]): any;
}
28 changes: 28 additions & 0 deletions lib/sdk-compat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as pluginSdk from "openclaw/plugin-sdk";

type JsonResultFn = (...args: any[]) => any;

let coreJsonResult: JsonResultFn | undefined;
try {
const coreModule = await import("openclaw/plugin-sdk/core");
if (typeof coreModule.jsonResult === "function") {
coreJsonResult = coreModule.jsonResult as JsonResultFn;
}
} catch {
// Older OpenClaw builds may not expose the core entrypoint.
}

const rootJsonResult =
typeof (pluginSdk as { jsonResult?: unknown }).jsonResult === "function"
? ((pluginSdk as { jsonResult: JsonResultFn }).jsonResult)
: undefined;

export const jsonResult: JsonResultFn = ((...args: any[]) => {
const fn = rootJsonResult ?? coreJsonResult;
if (!fn) {
throw new Error(
"DevClaw could not resolve jsonResult from openclaw/plugin-sdk or openclaw/plugin-sdk/core"
);
}
return fn(...args);
}) as JsonResultFn;
2 changes: 1 addition & 1 deletion lib/tools/admin/autoconfigure-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Queries available authenticated models and intelligently assigns them to DevClaw roles.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext, RunCommand } from "../../context.js";
import {
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/channel-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* (auto-detach). This is the primary way to switch which project a chat
* controls.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { readProjects, writeProjects, type Channel } from "../../projects/index.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/channel-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Shows registered channels with their type, ID, name, and event subscriptions.
* Can list channels for a specific project or all projects.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { readProjects } from "../../projects/index.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/channel-unlink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* exists and prevents removing the last channel from a project (projects must
* have at least one notification endpoint).
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { readProjects, writeProjects } from "../../projects/index.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/config-diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import fs from "node:fs/promises";
import path from "node:path";
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext } from "../../context.js";
import { requireWorkspaceDir } from "../helpers.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/config-reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import fs from "node:fs/promises";
import path from "node:path";
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext } from "../../context.js";
import { requireWorkspaceDir } from "../helpers.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import fs from "node:fs/promises";
import path from "node:path";
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext } from "../../context.js";
import { writeAllDefaults, backupAndWrite, fileExists } from "../../setup/workspace.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/health.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* Read-only by default (surfaces issues). Pass fix=true to apply fixes.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { readProjects, getProject } from "../../projects/index.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Returns step-by-step guidance. Call this before setup.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext } from "../../context.js";
import { isPluginConfigured, hasWorkspaceFiles, buildOnboardToolContext, buildReconfigContext } from "../../setup/onboarding.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/project-register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Replaces the manual steps of running glab/gh label create + editing projects.json.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext } from "../../context.js";
import fs from "node:fs/promises";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/project-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* workflow config, and execution settings. No issue-tracker API calls.
* Use `tasks_status` for live issue counts.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext } from "../../context.js";
import { requireWorkspaceDir, resolveChannelId, resolveProject } from "../helpers.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Creates agent, configures model levels, writes workspace files.
* Thin wrapper around lib/setup/.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext } from "../../context.js";
import { runSetup, type SetupOpts } from "../../setup/index.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/sync-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Calls provider.ensureLabel() directly instead of provider.ensureAllStateLabels()
* so that custom workflow states from workspace/project overrides are included.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext } from "../../context.js";
import { requireWorkspaceDir } from "../helpers.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/admin/workflow-guide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* No parameters, no side effects — pure documentation.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { requireWorkspaceDir } from "../helpers.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/tasks/research-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* → architect calls work_finish(result="done") → "Researching" → "Done" (issue closed)
* → operator reviews created tasks in Planning, moves to "To Do" when ready
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext } from "../../context.js";
import type { StateLabel } from "../../providers/provider.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/tasks/task-attach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* - Manually attach a local file to an issue
* - View attachment metadata and local paths
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { log as auditLog } from "../../audit.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/tasks/task-comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* - Developer worker posts implementation notes
* - Orchestrator adds summary comments
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { log as auditLog } from "../../audit.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/tasks/task-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* - A sub-agent finds a bug and needs to file a follow-up issue
* - Breaking down an epic into smaller tasks
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { log as auditLog } from "../../audit.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/tasks/task-edit-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* DevClaw adds an explicit audit entry with who, when, and what changed.
* Optionally posts an auto-comment on the issue for traceability.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { log as auditLog } from "../../audit.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/tasks/task-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Lists issues grouped by state label with optional filtering by state type,
* specific label, or text search. Supports terminal (closed) issues.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { log as auditLog } from "../../audit.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/tasks/task-owner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* owns them for queue scanning and dispatch. Supports claiming a
* single issue or all unclaimed queued issues for a project.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { requireWorkspaceDir, resolveChannelId, resolveProject, resolveProvider } from "../helpers.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/tasks/task-set-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* applied as a role:level label and respected by the heartbeat when the
* issue is later advanced via task_start.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { log as auditLog } from "../../audit.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/tasks/task-start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* The heartbeat is the sole dispatcher — this tool only places issues in
* queues, never dispatches workers directly.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { PluginContext } from "../../context.js";
import type { ToolContext } from "../../types.js";
import { log as auditLog } from "../../audit.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/tasks/tasks-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Fetches all non-terminal issues grouped by state type (hold, active, queue).
* Use `project_status` for instant local info, this tool for live issue data.
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import type { ToolContext } from "../../types.js";
import type { PluginContext } from "../../context.js";
import { log as auditLog } from "../../audit.js";
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/worker/work-finish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* All roles (including architect) use the standard pipeline via executeCompletion.
* Architect workflow: Researching → Done (done, closes issue), Researching → Refining (blocked).
*/
import { jsonResult } from "openclaw/plugin-sdk";
import { jsonResult } from "../../sdk-compat.js";
import { readFile } from "node:fs/promises";
import { join } from "node:path";
import type { ToolContext } from "../../types.js";
Expand Down
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.