pai-agent-ui 0.1.0 → 0.1.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.
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useRef, useState } from "react";
3
- import { AgentWidgetRenderer } from "./AgentWidgetRenderer";
4
- import { ChatComposer } from "./ChatComposer";
3
+ import { AgentWidgetRenderer } from "./AgentWidgetRenderer.js";
4
+ import { ChatComposer } from "./ChatComposer.js";
5
5
  const ACTIVE_RUN_STATUSES = new Set(["needs_clarification", "waiting_for_confirmation", "waiting_for_next_step", "running_step", "failed"]);
6
6
  const imageRegex = /(https?:\/\/[^\s)"']+\.(?:png|jpg|jpeg|webp)(?:\?[^\s)"']*)?)/gi;
7
7
  export function AgentChatPanel({ messages, runs = [], agentMode = "agent-v2", isWaiting, widgetAdapter, suggestions, composerDisabled, composerSending, composerPlaceholder, onSend, showRunDebug = false, }) {
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { AgentPlanWidget } from "./widgets/AgentPlanWidget";
3
- import { ClarificationRequestWidget } from "./widgets/ClarificationRequestWidget";
4
- import { ExecutionActionWidget } from "./widgets/ExecutionActionWidget";
5
- import { PaceFileViewWidget } from "./widgets/PaceFileViewWidget";
6
- import { PacePatchFormWidget } from "./widgets/PacePatchFormWidget";
7
- import { ProjectMemoryReviewWidget } from "./widgets/ProjectMemoryReviewWidget";
2
+ import { AgentPlanWidget } from "./widgets/AgentPlanWidget.js";
3
+ import { ClarificationRequestWidget } from "./widgets/ClarificationRequestWidget.js";
4
+ import { ExecutionActionWidget } from "./widgets/ExecutionActionWidget.js";
5
+ import { PaceFileViewWidget } from "./widgets/PaceFileViewWidget.js";
6
+ import { PacePatchFormWidget } from "./widgets/PacePatchFormWidget.js";
7
+ import { ProjectMemoryReviewWidget } from "./widgets/ProjectMemoryReviewWidget.js";
8
8
  function baseWidgetType(type) {
9
9
  return type.split("__")[0];
10
10
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from "react";
3
- import { cloneValue, parseJsonPointer, removeValueAtPath, setValueAtPath, unescapeJsonPointerPart, } from "../utils/jsonPointer";
3
+ import { cloneValue, parseJsonPointer, removeValueAtPath, setValueAtPath, unescapeJsonPointerPart, } from "../utils/jsonPointer.js";
4
4
  function getLabel(key, path, terms) {
5
5
  return terms[path]?.zh ?? terms[path]?.label ?? key;
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from "react";
3
- import { WORKER_DEPRECATED_FIELDS, WORKER_SYSTEM_FIELDS, buildWorkerTaskParams, draftAction, initialFormState, toJsonText, } from "../../utils/workerTask";
4
- import { JobStatusLine, jobStatusProps } from "../JobStatusLine";
3
+ import { WORKER_DEPRECATED_FIELDS, WORKER_SYSTEM_FIELDS, buildWorkerTaskParams, draftAction, initialFormState, toJsonText, } from "../../utils/workerTask.js";
4
+ import { JobStatusLine, jobStatusProps } from "../JobStatusLine.js";
5
5
  const TERMINAL_SUCCESS = new Set(["done"]);
6
6
  const TERMINAL_FAILURE = new Set(["failed", "error", "rejected"]);
7
7
  function extractRenderUrls(payload) {
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from "react";
3
- import { applyPendingOperations, diffJsonPatchOperations, pointerToDisplayPath } from "../../utils/jsonPointer";
4
- import { EntityTreeEditor } from "../EntityTreeEditor";
3
+ import { applyPendingOperations, diffJsonPatchOperations, pointerToDisplayPath } from "../../utils/jsonPointer.js";
4
+ import { EntityTreeEditor } from "../EntityTreeEditor.js";
5
5
  function pendingOperationPaths(operations) {
6
6
  return (operations ?? []).map((operation) => operation.path).filter((path) => typeof path === "string");
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo, useState } from "react";
3
- import { getSparseValue, pointerToDisplayPath, setSparseValue } from "../../utils/jsonPointer";
4
- import { EntityTreeEditor } from "../EntityTreeEditor";
3
+ import { getSparseValue, pointerToDisplayPath, setSparseValue } from "../../utils/jsonPointer.js";
4
+ import { EntityTreeEditor } from "../EntityTreeEditor.js";
5
5
  function normalizedProjectId(data, adapter) {
6
6
  return data.projectId || data.project_id || data.project || adapter.selectedProjectId || "";
7
7
  }
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export * from "./types";
2
- export * from "./components/AgentChatPanel";
3
- export * from "./components/AgentWidgetRenderer";
4
- export * from "./components/ChatComposer";
5
- export * from "./components/EntityTreeEditor";
6
- export * from "./components/JobStatusLine";
1
+ export * from "./types.js";
2
+ export * from "./components/AgentChatPanel.js";
3
+ export * from "./components/AgentWidgetRenderer.js";
4
+ export * from "./components/ChatComposer.js";
5
+ export * from "./components/EntityTreeEditor.js";
6
+ export * from "./components/JobStatusLine.js";
7
7
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pai-agent-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Reusable React components for PAI Agent chat and widgets.",
6
6
  "license": "UNLICENSED",
@@ -12,7 +12,7 @@
12
12
  "README.md"
13
13
  ],
14
14
  "scripts": {
15
- "build": "tsc -p tsconfig.build.json && cp src/styles.css dist/styles.css",
15
+ "build": "tsc -p tsconfig.build.json && node scripts/fix-esm-imports.mjs && cp src/styles.css dist/styles.css",
16
16
  "prepack": "npm run build"
17
17
  },
18
18
  "exports": {