@agent-native/core 0.157.9 → 0.157.11
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/corpus/templates/analytics/scripts/first-party-analytics-postgres-retention-dry-run.sql +5 -2
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +3 -1
- package/corpus/templates/analytics/server/lib/first-party-analytics-purge.ts +18 -6
- package/corpus/templates/analytics/server/plugins/db.ts +139 -0
- package/corpus/templates/slides/AGENTS.md +14 -10
- package/corpus/templates/slides/actions/export-pptx.ts +1215 -94
- package/corpus/templates/slides/actions/import-file.ts +16 -1
- package/corpus/templates/slides/actions/import-pptx.ts +61 -43
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +222 -29
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +71 -0
- package/corpus/templates/slides/app/global.css +19 -1
- package/corpus/templates/slides/app/lib/export-google-slides-client.ts +44 -5
- package/corpus/templates/slides/app/lib/export-pdf-client.ts +13 -6
- package/corpus/templates/slides/app/lib/export-pptx-client.ts +556 -25
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +18 -1
- package/corpus/templates/slides/server/handlers/import/html-converter.ts +1176 -26
- package/corpus/templates/slides/server/handlers/import/pdf-fidelity-parser.ts +13 -0
- package/corpus/templates/slides/server/handlers/import/pptx-assets.ts +24 -0
- package/corpus/templates/slides/server/routes/api/exports/google-slides.post.ts +12 -4
- package/corpus/templates/slides/shared/aspect-ratios.ts +13 -1
- package/dist/agent/harness/migrations.js +24 -3
- package/dist/agent/production-agent.js +11 -0
- package/dist/agent/run-loop-with-resume.js +21 -4
- package/dist/automations/service.d.ts +6 -0
- package/dist/automations/service.js +35 -0
- package/dist/cli/code-agent-connector.d.ts +4 -1
- package/dist/cli/code-agent-connector.js +154 -23
- package/dist/cli/code-agent-executor.js +255 -13
- package/dist/cli/code-agent-runs.d.ts +1 -0
- package/dist/cli/code-agent-runs.js +2 -1
- package/dist/cli/portal-workspace.d.ts +49 -0
- package/dist/cli/portal-workspace.js +320 -0
- package/dist/client/AssistantChat.d.ts +1 -1
- package/dist/client/AssistantChat.js +39 -61
- package/dist/client/ConnectBuilderCard.js +33 -5
- package/dist/client/agent-chat-adapter.js +4 -0
- package/dist/client/analytics-platform.d.ts +2 -0
- package/dist/client/analytics-platform.js +12 -0
- package/dist/client/analytics.d.ts +3 -0
- package/dist/client/analytics.js +10 -1
- package/dist/client/chat/index.d.ts +1 -0
- package/dist/client/chat/index.js +1 -0
- package/dist/client/chat/run-recovery.d.ts +2 -1
- package/dist/client/chat/run-recovery.js +2 -2
- package/dist/client/chat-first/apps-rail.d.ts +1 -1
- package/dist/client/chat-first/apps-rail.js +11 -11
- package/dist/client/chat-first/surface-tabs.d.ts +1 -1
- package/dist/client/chat-first/surface-tabs.js +38 -36
- package/dist/client/chat-first/types.d.ts +5 -0
- package/dist/client/chat-first.d.ts +1 -1
- package/dist/client/chat-first.js +4 -4
- package/dist/client/desktop-local-code-change.d.ts +10 -0
- package/dist/client/desktop-local-code-change.js +16 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/observability/ThumbsFeedback.js +21 -7
- package/dist/client/terminal/AgentTerminal.d.ts +9 -1
- package/dist/client/terminal/AgentTerminal.js +38 -3
- package/dist/client/terminal/index.d.ts +1 -1
- package/dist/client/terminal/index.js +1 -1
- package/dist/client/track.js +9 -1
- package/dist/client/use-action.js +3 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/client.js +1 -0
- package/dist/deploy/build.js +1 -1
- package/dist/ingestion/pptx.d.ts +78 -0
- package/dist/ingestion/pptx.js +991 -107
- package/dist/integrations/index.d.ts +3 -3
- package/dist/integrations/index.js +2 -2
- package/dist/integrations/plugin.js +95 -6
- package/dist/integrations/remote-commands-store.d.ts +5 -0
- package/dist/integrations/remote-commands-store.js +63 -22
- package/dist/integrations/remote-devices-store.d.ts +2 -1
- package/dist/integrations/remote-devices-store.js +46 -0
- package/dist/integrations/remote-types.d.ts +20 -0
- package/dist/jobs/actions/list-recurring-jobs.d.ts +3 -0
- package/dist/jobs/actions/list-recurring-jobs.js +5 -1
- package/dist/jobs/frontmatter.d.ts +16 -0
- package/dist/jobs/frontmatter.js +53 -0
- package/dist/jobs/remote-execution.d.ts +42 -0
- package/dist/jobs/remote-execution.js +287 -0
- package/dist/jobs/scheduler.js +102 -3
- package/dist/jobs/tools.js +50 -3
- package/dist/notifications/routes.d.ts +4 -4
- package/dist/observability/routes.d.ts +5 -5
- package/dist/provider-api/actions/custom-provider-registration.d.ts +9 -9
- package/dist/provider-api/actions/provider-api.d.ts +14 -14
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/action-routes.js +4 -2
- package/dist/server/agent-chat-plugin.js +6 -0
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-run-context.d.ts +1 -0
- package/dist/server/agent-run-context.js +9 -0
- package/dist/server/core-routes-plugin.js +8 -1
- package/dist/server/request-context.d.ts +2 -0
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/analytics-platform.d.ts +6 -0
- package/dist/shared/analytics-platform.js +14 -0
- package/dist/shared/mcp-embed-headers.d.ts +1 -1
- package/dist/shared/mcp-embed-headers.js +1 -1
- package/dist/styles/agent-native.css +83 -103
- package/dist/terminal/cli-registry.js +5 -0
- package/dist/tracking/registry.js +9 -1
- package/dist/triggers/actions/list-automations.d.ts +3 -0
- package/dist/triggers/actions/list-automations.js +3 -0
- package/dist/triggers/actions/manage-automation.d.ts +9 -0
- package/dist/triggers/actions/manage-automation.js +14 -2
- package/dist/triggers/actions.js +82 -7
- package/docs/content/template-content-developers.mdx +48 -0
- package/docs/content/toolkit-ui.mdx +57 -0
- package/package.json +2 -2
|
@@ -33,7 +33,7 @@ function injectXtermCss() {
|
|
|
33
33
|
.xterm .composition-view { display: none; position: absolute; white-space: nowrap; z-index: 1; }
|
|
34
34
|
.xterm .composition-view.active { display: block; }
|
|
35
35
|
.xterm .xterm-viewport {
|
|
36
|
-
background-color:
|
|
36
|
+
background-color: var(--agent-terminal-background); overflow-y: scroll;
|
|
37
37
|
cursor: default; position: absolute; right: 0; left: 0; top: 0; bottom: 0;
|
|
38
38
|
}
|
|
39
39
|
.xterm .xterm-screen { position: relative; }
|
|
@@ -85,8 +85,12 @@ export function formatWebSocketHostname(hostname) {
|
|
|
85
85
|
? `[${hostname}]`
|
|
86
86
|
: hostname;
|
|
87
87
|
}
|
|
88
|
-
export function AgentTerminal({ command, flags, wsUrl: wsUrlProp, hideInFrame = true, theme, fontSize = 12, className, style, onConnectionChange, onAgentRunningChange, }) {
|
|
88
|
+
export function AgentTerminal({ command, flags, wsUrl: wsUrlProp, hideInFrame = true, theme, fontSize = 12, className, style, onConnectionChange, onAgentRunningChange, submitRequest, onPromptSubmitted, }) {
|
|
89
89
|
const termRef = useRef(null);
|
|
90
|
+
const submitPromptRef = useRef(null);
|
|
91
|
+
const pendingSubmitRequestRef = useRef(null);
|
|
92
|
+
const onPromptSubmittedRef = useRef(onPromptSubmitted);
|
|
93
|
+
onPromptSubmittedRef.current = onPromptSubmitted;
|
|
90
94
|
const [connected, setConnected] = useState(false);
|
|
91
95
|
const [error, setError] = useState(null);
|
|
92
96
|
const [inFrame, setInFrame] = useState(false);
|
|
@@ -226,6 +230,22 @@ export function AgentTerminal({ command, flags, wsUrl: wsUrlProp, hideInFrame =
|
|
|
226
230
|
let agentRunning = false;
|
|
227
231
|
let idleTimer = null;
|
|
228
232
|
let connectionId = 0;
|
|
233
|
+
function submitPrompt(request) {
|
|
234
|
+
const text = request.text.trim();
|
|
235
|
+
if (!text)
|
|
236
|
+
return;
|
|
237
|
+
if (!ws || ws.readyState !== WebSocket.OPEN) {
|
|
238
|
+
pendingSubmitRequestRef.current = request;
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
ws.send(text + "\r");
|
|
242
|
+
agentRunning = true;
|
|
243
|
+
notifyAgentRunning(true);
|
|
244
|
+
if (pendingSubmitRequestRef.current?.id === request.id) {
|
|
245
|
+
pendingSubmitRequestRef.current = null;
|
|
246
|
+
}
|
|
247
|
+
onPromptSubmittedRef.current?.(request);
|
|
248
|
+
}
|
|
229
249
|
function sendResize() {
|
|
230
250
|
if (ws && ws.readyState === WebSocket.OPEN && term) {
|
|
231
251
|
ws.send(JSON.stringify({
|
|
@@ -258,6 +278,9 @@ export function AgentTerminal({ command, flags, wsUrl: wsUrlProp, hideInFrame =
|
|
|
258
278
|
cols: term.cols,
|
|
259
279
|
rows: term.rows,
|
|
260
280
|
}));
|
|
281
|
+
const pendingRequest = pendingSubmitRequestRef.current;
|
|
282
|
+
if (pendingRequest)
|
|
283
|
+
submitPrompt(pendingRequest);
|
|
261
284
|
};
|
|
262
285
|
socket.onmessage = (event) => {
|
|
263
286
|
const data = event.data instanceof ArrayBuffer
|
|
@@ -328,6 +351,10 @@ export function AgentTerminal({ command, flags, wsUrl: wsUrlProp, hideInFrame =
|
|
|
328
351
|
};
|
|
329
352
|
window.addEventListener("message", messageHandler);
|
|
330
353
|
cleanupMessageHandler = () => window.removeEventListener("message", messageHandler);
|
|
354
|
+
submitPromptRef.current = submitPrompt;
|
|
355
|
+
const initialRequest = pendingSubmitRequestRef.current;
|
|
356
|
+
if (initialRequest)
|
|
357
|
+
submitPrompt(initialRequest);
|
|
331
358
|
connect(fullWsUrl);
|
|
332
359
|
// Store cleanup references
|
|
333
360
|
return () => {
|
|
@@ -340,6 +367,7 @@ export function AgentTerminal({ command, flags, wsUrl: wsUrlProp, hideInFrame =
|
|
|
340
367
|
ws.close();
|
|
341
368
|
ws = null;
|
|
342
369
|
}
|
|
370
|
+
submitPromptRef.current = null;
|
|
343
371
|
};
|
|
344
372
|
}
|
|
345
373
|
let cleanup;
|
|
@@ -353,6 +381,12 @@ export function AgentTerminal({ command, flags, wsUrl: wsUrlProp, hideInFrame =
|
|
|
353
381
|
};
|
|
354
382
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
355
383
|
}, [hideInFrame, inFrame, command, flags, wsUrlProp]);
|
|
384
|
+
useEffect(() => {
|
|
385
|
+
if (!submitRequest)
|
|
386
|
+
return;
|
|
387
|
+
pendingSubmitRequestRef.current = submitRequest;
|
|
388
|
+
submitPromptRef.current?.(submitRequest);
|
|
389
|
+
}, [submitRequest?.id, submitRequest?.text]);
|
|
356
390
|
if (hideInFrame && inFrame) {
|
|
357
391
|
return null;
|
|
358
392
|
}
|
|
@@ -361,6 +395,7 @@ export function AgentTerminal({ command, flags, wsUrl: wsUrlProp, hideInFrame =
|
|
|
361
395
|
...style,
|
|
362
396
|
background: terminalBackground,
|
|
363
397
|
backgroundColor: terminalBackground,
|
|
398
|
+
"--agent-terminal-background": terminalBackground,
|
|
364
399
|
};
|
|
365
400
|
return (_jsx("div", { ref: termRef, className: className, style: {
|
|
366
401
|
width: "100%",
|
|
@@ -374,7 +409,7 @@ export function AgentTerminal({ command, flags, wsUrl: wsUrlProp, hideInFrame =
|
|
|
374
409
|
display: "flex",
|
|
375
410
|
alignItems: "center",
|
|
376
411
|
justifyContent: "center",
|
|
377
|
-
backgroundColor:
|
|
412
|
+
backgroundColor: terminalBackground,
|
|
378
413
|
color: "#ff7b72",
|
|
379
414
|
fontSize: "13px",
|
|
380
415
|
fontFamily: "monospace",
|
package/dist/client/track.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ANALYTICS_CLIENT_PLATFORM_HEADER, ANALYTICS_CLIENT_PLATFORM_PROPERTY, } from "../shared/analytics-platform.js";
|
|
2
|
+
import { getAnalyticsClientPlatform } from "./analytics-platform.js";
|
|
1
3
|
import { getOrCreateAnalyticsSessionId } from "./analytics-session.js";
|
|
2
4
|
import { agentNativePath } from "./api-path.js";
|
|
3
5
|
/**
|
|
@@ -28,9 +30,14 @@ export function track(name, properties) {
|
|
|
28
30
|
return Promise.resolve();
|
|
29
31
|
if (typeof name !== "string" || !name.trim())
|
|
30
32
|
return Promise.resolve();
|
|
33
|
+
const clientPlatform = getAnalyticsClientPlatform();
|
|
34
|
+
const trackedProperties = {
|
|
35
|
+
...(properties ?? {}),
|
|
36
|
+
[ANALYTICS_CLIENT_PLATFORM_PROPERTY]: clientPlatform,
|
|
37
|
+
};
|
|
31
38
|
let body;
|
|
32
39
|
try {
|
|
33
|
-
body = JSON.stringify(
|
|
40
|
+
body = JSON.stringify({ name, properties: trackedProperties });
|
|
34
41
|
}
|
|
35
42
|
catch {
|
|
36
43
|
// Non-serializable properties — drop rather than throw into the caller.
|
|
@@ -45,6 +52,7 @@ export function track(name, properties) {
|
|
|
45
52
|
// middleware trusts it as a first-party marker. Matches the convention
|
|
46
53
|
// used by other client writes (application-state, guided-questions).
|
|
47
54
|
"X-Agent-Native-CSRF": "1",
|
|
55
|
+
[ANALYTICS_CLIENT_PLATFORM_HEADER]: clientPlatform,
|
|
48
56
|
// Same session the action client and agent chat send, so a client event
|
|
49
57
|
// and the server events from the same visit share one session.
|
|
50
58
|
...(browserSessionId
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
* compatibility.
|
|
23
23
|
*/
|
|
24
24
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
25
|
+
import { ANALYTICS_CLIENT_PLATFORM_HEADER } from "../shared/analytics-platform.js";
|
|
26
|
+
import { getAnalyticsClientPlatform } from "./analytics-platform.js";
|
|
25
27
|
import { getOrCreateAnalyticsSessionId } from "./analytics-session.js";
|
|
26
28
|
import { trackEvent } from "./analytics.js";
|
|
27
29
|
import { agentNativePath } from "./api-path.js";
|
|
@@ -203,6 +205,7 @@ async function performActionFetch(name, method, params, options) {
|
|
|
203
205
|
if (browserSessionId) {
|
|
204
206
|
headers["X-Agent-Native-Session-Id"] = browserSessionId;
|
|
205
207
|
}
|
|
208
|
+
headers[ANALYTICS_CLIENT_PLATFORM_HEADER] = getAnalyticsClientPlatform();
|
|
206
209
|
const init = {
|
|
207
210
|
method,
|
|
208
211
|
headers,
|
|
@@ -62,11 +62,11 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
62
62
|
error: string;
|
|
63
63
|
states?: undefined;
|
|
64
64
|
} | {
|
|
65
|
-
error?: undefined;
|
|
66
65
|
states: {
|
|
67
66
|
clientId: number;
|
|
68
67
|
state: string;
|
|
69
68
|
}[];
|
|
69
|
+
error?: undefined;
|
|
70
70
|
}>>;
|
|
71
71
|
/**
|
|
72
72
|
* GET /_agent-native/collab/:docId/users
|
|
@@ -77,9 +77,9 @@ export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("
|
|
|
77
77
|
error: string;
|
|
78
78
|
users?: undefined;
|
|
79
79
|
} | {
|
|
80
|
-
error?: undefined;
|
|
81
80
|
users: {
|
|
82
81
|
clientId: number;
|
|
83
82
|
lastSeen: number;
|
|
84
83
|
}[];
|
|
84
|
+
error?: undefined;
|
|
85
85
|
}>>;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* Body: { json: any, fieldName?: string, type?: "map"|"array", requestSource?: string }
|
|
14
14
|
*/
|
|
15
15
|
export declare const postCollabJson: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
16
|
-
error: string;
|
|
17
16
|
ok?: undefined;
|
|
17
|
+
error: string;
|
|
18
18
|
} | {
|
|
19
19
|
error?: undefined;
|
|
20
20
|
ok: boolean;
|
package/dist/db/client.js
CHANGED
|
@@ -763,6 +763,7 @@ export async function withDbTimeout(op, run, ms = dbOpTimeoutMs(), onTimeout) {
|
|
|
763
763
|
*/
|
|
764
764
|
export function isServerlessRuntime() {
|
|
765
765
|
return (!!process.env.NETLIFY ||
|
|
766
|
+
!!process.env.NETLIFY_FUNCTION_NAME ||
|
|
766
767
|
!!process.env.VERCEL ||
|
|
767
768
|
!!process.env.AWS_LAMBDA_FUNCTION_NAME ||
|
|
768
769
|
!!process.env.LAMBDA_TASK_ROOT ||
|
package/dist/deploy/build.js
CHANGED
|
@@ -1245,7 +1245,7 @@ async function getHandler() {
|
|
|
1245
1245
|
headers: {
|
|
1246
1246
|
"Access-Control-Allow-Origin": "*",
|
|
1247
1247
|
"Access-Control-Allow-Methods": "GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS",
|
|
1248
|
-
"Access-Control-Allow-Headers": "Content-Type,Authorization,X-Requested-With,X-Request-Source,X-Agent-Native-CSRF,X-User-Timezone,X-Agent-Native-Tool-Bridge,X-Agent-Native-Tool-Id,X-Agent-Native-Frontend,X-Agent-Native-Client-Compatibility,X-Agent-Native-Build-Id,X-Agent-Native-Embed-Target",
|
|
1248
|
+
"Access-Control-Allow-Headers": "Content-Type,Authorization,X-Requested-With,X-Request-Source,X-Agent-Native-CSRF,X-User-Timezone,X-Agent-Native-Session-Id,X-Agent-Native-Client-Platform,X-Agent-Native-Tool-Bridge,X-Agent-Native-Tool-Id,X-Agent-Native-Frontend,X-Agent-Native-Client-Compatibility,X-Agent-Native-Build-Id,X-Agent-Native-Embed-Target",
|
|
1249
1249
|
},
|
|
1250
1250
|
});
|
|
1251
1251
|
}
|
package/dist/ingestion/pptx.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export interface ParsedPptxParagraph {
|
|
|
21
21
|
lineSpacing?: number;
|
|
22
22
|
spaceBeforePt?: number;
|
|
23
23
|
spaceAfterPt?: number;
|
|
24
|
+
/** `a:pPr/@_rtl` — the paragraph's base writing direction is right-to-left. Only set when the source states it; absent means inherit (LTR). */
|
|
25
|
+
rtl?: boolean;
|
|
24
26
|
}
|
|
25
27
|
export interface ParsedPptxElement {
|
|
26
28
|
id: string;
|
|
@@ -32,10 +34,22 @@ export interface ParsedPptxElement {
|
|
|
32
34
|
width: number;
|
|
33
35
|
height: number;
|
|
34
36
|
rotation?: number;
|
|
37
|
+
/** `a:xfrm/@_flipH` — the shape's geometry is mirrored across its own vertical axis before rotation. */
|
|
38
|
+
flipH?: boolean;
|
|
39
|
+
/** `a:xfrm/@_flipV` — the shape's geometry is mirrored across its own horizontal axis before rotation. */
|
|
40
|
+
flipV?: boolean;
|
|
35
41
|
shapeType?: string;
|
|
42
|
+
/** `a:prstGeom/a:avLst` adjustment values keyed by guide name (`adj`, `adj1`, ...), in the preset's own units. Absent when the deck accepts the preset's defaults. */
|
|
43
|
+
shapeAdjustments?: Record<string, number>;
|
|
44
|
+
/** `a:custGeom`'s authored outline, when the shape declares one instead of a preset. */
|
|
45
|
+
geometry?: ParsedPptxGeometry;
|
|
36
46
|
fill?: string;
|
|
37
47
|
lineColor?: string;
|
|
38
48
|
lineWidth?: number;
|
|
49
|
+
/** `a:ln/a:headEnd` — the decoration drawn where the line starts. */
|
|
50
|
+
lineHeadEnd?: ParsedPptxLineEnd;
|
|
51
|
+
/** `a:ln/a:tailEnd` — the decoration drawn where the line ends. */
|
|
52
|
+
lineTailEnd?: ParsedPptxLineEnd;
|
|
39
53
|
padding?: {
|
|
40
54
|
left: number;
|
|
41
55
|
right: number;
|
|
@@ -47,15 +61,77 @@ export interface ParsedPptxElement {
|
|
|
47
61
|
image?: ParsedPptxImage;
|
|
48
62
|
table?: ParsedPptxTable;
|
|
49
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* One end of a line or connector — the round dots a chevron timeline's
|
|
66
|
+
* connectors terminate in (`<a:headEnd type="oval"/>`), an arrowhead, a
|
|
67
|
+
* diamond. Recorded whatever the type, including the ones a consumer cannot
|
|
68
|
+
* draw, so an end a renderer skips stays distinguishable from a line the
|
|
69
|
+
* source drew bare and an export can still round-trip it.
|
|
70
|
+
*/
|
|
71
|
+
export interface ParsedPptxLineEnd {
|
|
72
|
+
/** `@_type`: `none`, `triangle`, `stealth`, `diamond`, `oval`, or `arrow`. */
|
|
73
|
+
type: string;
|
|
74
|
+
/** `@_w`/`@_len` — the end's size across and along the line, as `sm`/`med`/`lg` multiples of the line's own width, not absolute units. Absent means the OOXML default (`med`). */
|
|
75
|
+
w?: string;
|
|
76
|
+
len?: string;
|
|
77
|
+
}
|
|
78
|
+
/** A single `a:path` command, in the path's own `w`/`h` coordinate space. `arcTo` keeps OOXML's radii-and-angles form because converting it needs the current point, which only a consumer walking the whole command list knows. */
|
|
79
|
+
export type ParsedPptxPathCommand = {
|
|
80
|
+
kind: "moveTo" | "lnTo" | "quadBezTo" | "cubicBezTo";
|
|
81
|
+
points: {
|
|
82
|
+
x: number;
|
|
83
|
+
y: number;
|
|
84
|
+
}[];
|
|
85
|
+
} | {
|
|
86
|
+
kind: "arcTo";
|
|
87
|
+
/** Ellipse radii in path units. */
|
|
88
|
+
wR: number;
|
|
89
|
+
hR: number;
|
|
90
|
+
/** Start angle and swing, in 60000ths of a degree, clockwise from the +x axis. */
|
|
91
|
+
stAng: number;
|
|
92
|
+
swAng: number;
|
|
93
|
+
} | {
|
|
94
|
+
kind: "close";
|
|
95
|
+
};
|
|
96
|
+
/** One `a:custGeom/a:pathLst/a:path`. `w`/`h` define the coordinate space its points are expressed in; the shape's own box is what they scale onto. */
|
|
97
|
+
export interface ParsedPptxPath {
|
|
98
|
+
w: number;
|
|
99
|
+
h: number;
|
|
100
|
+
commands: ParsedPptxPathCommand[];
|
|
101
|
+
}
|
|
102
|
+
export interface ParsedPptxGeometry {
|
|
103
|
+
kind: "custom";
|
|
104
|
+
paths: ParsedPptxPath[];
|
|
105
|
+
}
|
|
50
106
|
/** A `p:graphicFrame`'s `a:tbl` flattened into a simple row/cell grid. `hMerge`/`vMerge` continuation cells are omitted — their content is already represented once, by the spanning cell's `colSpan`/`rowSpan`. */
|
|
51
107
|
export interface ParsedPptxTable {
|
|
52
108
|
rows: ParsedPptxTableCell[][];
|
|
109
|
+
/** Authored `a:tblGrid/a:gridCol/@_w` values, in EMUs, when present. */
|
|
110
|
+
columnWidthsEmu?: number[];
|
|
111
|
+
/** Authored `a:tr/@_h` values, in EMUs, when present. */
|
|
112
|
+
rowHeightsEmu?: number[];
|
|
53
113
|
}
|
|
54
114
|
export interface ParsedPptxTableCell {
|
|
55
115
|
paragraphs: ParsedPptxParagraph[];
|
|
56
116
|
colSpan?: number;
|
|
57
117
|
rowSpan?: number;
|
|
58
118
|
fill?: string;
|
|
119
|
+
/** Resolved cell edges. A side is present only when the cell's own `a:tcPr/a:lnL|R|T|B` or the deck table style's `a:tcBdr` draws a line there — a cell the source leaves borderless stays borderless. */
|
|
120
|
+
borders?: ParsedPptxTableCellBorders;
|
|
121
|
+
}
|
|
122
|
+
export interface ParsedPptxTableCellBorders {
|
|
123
|
+
left?: ParsedPptxTableBorder;
|
|
124
|
+
right?: ParsedPptxTableBorder;
|
|
125
|
+
top?: ParsedPptxTableBorder;
|
|
126
|
+
bottom?: ParsedPptxTableBorder;
|
|
127
|
+
}
|
|
128
|
+
/** One resolved table cell edge, from an `a:ln`. */
|
|
129
|
+
export interface ParsedPptxTableBorder {
|
|
130
|
+
color: string;
|
|
131
|
+
/** `a:ln/@_w`, in EMU. Absent when the line declares no width. */
|
|
132
|
+
widthEmu?: number;
|
|
133
|
+
/** `a:prstDash/@_val`, collapsed onto the CSS border styles that can draw it. Absent for a solid line. */
|
|
134
|
+
dash?: "dashed" | "dotted";
|
|
59
135
|
}
|
|
60
136
|
export type ParsedPptxTransition = "instant" | "none" | "fade" | "slide" | "zoom";
|
|
61
137
|
export interface ParsedPptxImage {
|
|
@@ -108,6 +184,8 @@ export interface ParsedPptxPresentation {
|
|
|
108
184
|
colors: string[];
|
|
109
185
|
fonts: string[];
|
|
110
186
|
};
|
|
187
|
+
/** Slides the source deck marked `show="0"` and this import deliberately left out — the only legitimate reason `slides.length` is short of the deck's `p:sldId` count, so callers can say so instead of reporting a silently shorter deck. */
|
|
188
|
+
hiddenSlideCount?: number;
|
|
111
189
|
}
|
|
112
190
|
export declare function parsePptxPresentation(fileBuffer: Uint8Array): Promise<ParsedPptxPresentation>;
|
|
113
191
|
export declare function parsePptxSlideMetadata(value: unknown): ParsedPptxSlideMetadata;
|