A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and deploying solutions.
JavaScript claude-code-pluginclaude-code-skillscode-appsgithub-copilot-pluginpower-appspower-pagespower-platform
Support local files in native PDF viewer (#263)
Nikhil agrawal5036db3685dd
diff --git a/plugins/mobile-apps/agents/data-model-architect.md b/plugins/mobile-apps/agents/data-model-architect.mdindex b95effd15..533951ad0 100644--- a/plugins/mobile-apps/agents/data-model-architect.md+++ b/plugins/mobile-apps/agents/data-model-architect.md@@ -237,7 +237,7 @@ Before writing, scan the requirements for artifact signals and encode the storag| Signature, sign-off, approval signature, pen, ink, drawing | Use an Image column for one current PNG signature on the parent record, or a child Evidence/Signature table when history/multiple captures matter || Generated PDF, export report, print report, evidence packet, certificate PDF | Ask/preserve whether it is retained. Retained PDFs use a File column on the parent or a child Evidence/Attachment table. Transient PDFs need no Dataverse column. || Upload PDF, attach file, import document | Use a File column or child Attachment table with lookup to the parent |-| View/open PDF | Only model a durable HTTPS URL when the app has one; native PDF viewer does not support local `file://`, `content://`, or `blob:` URIs |+| View/open PDF | Model a durable HTTPS URL when the app has one; native PDF viewer 0.2.9+ also supports local `file://` URIs. `content://`, `blob:`, and `http://` remain unsupported. || Track location, background GPS, follow route, breadcrumb, field-worker location | Do not model an app-owned Dataverse table for the control. Record only the prerequisite: the geolocation control's Dataverse target table must already exist before the control is used. Default entity set is `msdyn_locationrecords` with the `msdyn_*` field map; for a custom table, every column named in the wrapper's `fieldMap` must exist. If the table or mapped columns are missing, block `geolocation` until the geolocation-control table provisioning/setup mechanism has created them; do not model File/Image columns for this control. |Never model retained PDF bytes as long text/base64. File columns store PDF content. Signature PNGs may use Image columns when the generated service supports image payloads; otherwise use File columns or child Evidence rows.diff --git a/plugins/mobile-apps/agents/native-app-planner.md b/plugins/mobile-apps/agents/native-app-planner.mdindex de55fd557..c2cda4d88 100644--- a/plugins/mobile-apps/agents/native-app-planner.md+++ b/plugins/mobile-apps/agents/native-app-planner.md@@ -66,7 +66,7 @@ Do NOT attempt to read `app.config.js` from the working directory — scaffoldinFrom the planner prompt extract:- **Target platforms** — iOS + Android by default. If the user picked just one platform, native modules need `Platform.OS` branching notes in the screen plan.-- **Native capability hints** — words like "scan", "photo", "camera" -> `expo-camera`; "pick file", "upload PDF", "import document", "attach file" -> `expo-document-picker`; "generate PDF", "export report", "print report", "evidence packet" -> `pdf-report` (`expo-print` plus optional `expo-sharing`); "view PDF", "open PDF", "preview PDF" -> `native-pdf-viewer` only for HTTPS URLs with `@microsoft/power-apps-native-pdf-viewer`; "signature", "sign off", "approval", "pen", "ink", "draw" -> `pen-input` with `@microsoft/power-apps-native-pen-input`; "track location", "background location", "GPS tracking", "follow my route", "breadcrumb", "field worker location" -> `geolocation` with `@microsoft/power-apps-native-bglocation` (continuous/background tracking + Dataverse sync); "where am I", "current location", "one-shot location", "tag this with my coordinates" -> one-shot `location` with `expo-location`; "save token", "credentials" -> `expo-secure-store`; "share / send" -> `expo-sharing`; "save file / download" -> `expo-file-system`. **Capability hints that the template does NOT ship** (including PDF viewer, PDF report, sharing, pen, or geolocation packages when absent) are surfaced to the user as transparency notes per Step 3 - never silently promoted into the plan. If the request is generated-report-shaped and the Power Apps PDF viewer package is absent, fall back to `pdf-report` only when `expo-print` is present; otherwise drop the PDF capability.+- **Native capability hints** — words like "scan", "photo", "camera" -> `expo-camera`; "pick file", "upload PDF", "import document", "attach file" -> `expo-document-picker`; "generate PDF", "export report", "print report", "evidence packet" -> `pdf-report` (`expo-print` plus optional `expo-sharing`); "view PDF", "open PDF", "preview PDF" -> `native-pdf-viewer` for HTTPS URLs or local `file://` URIs with `@microsoft/power-apps-native-pdf-viewer` 0.2.9+; "signature", "sign off", "approval", "pen", "ink", "draw" -> `pen-input` with `@microsoft/power-apps-native-pen-input`; "track location", "background location", "GPS tracking", "follow my route", "breadcrumb", "field worker location" -> `geolocation` with `@microsoft/power-apps-native-bglocation` (continuous/background tracking + Dataverse sync); "where am I", "current location", "one-shot location", "tag this with my coordinates" -> one-shot `location` with `expo-location`; "save token", "credentials" -> `expo-secure-store`; "share / send" -> `expo-sharing`; "save file / download" -> `expo-file-system`. **Capability hints that the template does NOT ship** (including PDF viewer, PDF report, sharing, pen, or geolocation packages when absent) are surfaced to the user as transparency notes per Step 3 - never silently promoted into the plan. If the request is generated-report-shaped and the Power Apps PDF viewer package is absent, fall back to `pdf-report` only when `expo-print` is present; otherwise drop the PDF capability.- **Industry confirmed** — if the prompt contains a line `Industry confirmed: <slug>`, the orchestrator already ran the industry-confidence check (see Step 3c). Treat that slug as the locked industry for Step 3c — skip detection, skip the confidence check, jump straight to mapping the industry to aesthetic direction / palette / tone.Capture these for the native capabilities section in Step 4.@@ -145,25 +145,25 @@ Map each shipped module to a user-facing capability slug. Use this known mapping| `screen-orientation` | `expo-screen-orientation` | `/add-native screen-orientation` || `date-time-picker` | `@react-native-community/datetimepicker` | screen-builder form component rule |-Do not propose `native-pdf-viewer` or `pen-input` unless the exact extension package is present in the template allowlist output (`@microsoft/power-apps-native-pdf-viewer` and `@microsoft/power-apps-native-pen-input`). Do not propose `geolocation` unless `@microsoft/power-apps-native-bglocation` is present, and only for continuous/background tracking or durable Dataverse upload — use one-shot `location` (`expo-location`) for a single foreground coordinate read. When proposing `geolocation`, record that its Dataverse target table must already exist and must be verified by `/add-native geolocation` (default entity set `msdyn_locationrecords`, or a custom `tableName` whose `fieldMap` columns exist). Do not propose `pdf-report` unless `expo-print` is present. Do not propose local share/open behavior for generated PDFs unless `expo-sharing` is present. If a user asks to view a PDF but only a local generated file URI will exist, do not use `native-pdf-viewer`; plan `pdf-report` plus `sharing` only when both `expo-print` and `expo-sharing` are present, or plan `pdf-report` plus Dataverse File upload when `expo-print` is present and retained storage is required. If neither package path is present, drop the PDF capability and add a transparency note.+Do not propose `native-pdf-viewer` or `pen-input` unless the exact extension package is present in the template allowlist output (`@microsoft/power-apps-native-pdf-viewer` and `@microsoft/power-apps-native-pen-input`). Do not propose `geolocation` unless `@microsoft/power-apps-native-bglocation` is present, and only for continuous/background tracking or durable Dataverse upload — use one-shot `location` (`expo-location`) for a single foreground coordinate read. When proposing `geolocation`, record that its Dataverse target table must already exist and must be verified by `/add-native geolocation` (default entity set `msdyn_locationrecords`, or a custom `tableName` whose `fieldMap` columns exist). Do not propose `pdf-report` unless `expo-print` is present. Do not propose local sharing for generated PDFs unless `expo-sharing` is present. If neither package path is present, drop the PDF capability and add a transparency note.PDF fallback order:-1. Existing HTTPS PDF URL + `@microsoft/power-apps-native-pdf-viewer` present -> `native-pdf-viewer`.+1. Existing HTTPS PDF URL or local `file://` URI + `@microsoft/power-apps-native-pdf-viewer` 0.2.9+ present -> `native-pdf-viewer`.2. App-generated PDF + `expo-print` present -> `pdf-report`.-3. App-generated PDF + `expo-print` and `expo-sharing` present -> `pdf-report` plus `sharing` when local share/open is required.+3. App-generated PDF + `expo-print` and `expo-sharing` present -> `pdf-report` plus `sharing` when sharing is required.4. User-selected/uploaded PDF -> `document-picker` or Dataverse host `<FilePicker>` when those packages/controls are present.5. None of the required packages are present -> do not add a PDF capability; write an excluded-capability note.Control planning gate:- Classify the intent, resolve the exact package/control from the allowlist, confirm it is not runtime-banned, and record storage/output plus add path (`/add-native <capability>` or host File/Image control).- If any required gate is false — missing package/control, runtime-banned package, unsupported URL/output type, or missing Dataverse storage for a persisted artifact — do not propose that native capability; write a transparency note instead.-- Do not use Power Apps extensions as generic replacements: PDF viewer is HTTPS viewing, pen input is ink/signature capture, generated reports are `expo-print`.+- Do not use Power Apps extensions as generic replacements: PDF viewer opens HTTPS and local file PDFs, pen input is ink/signature capture, generated reports are `expo-print`.- The table is not closed. For unlisted native hints, use the exact relevant package when present and safe; otherwise drop the capability. Multi-part asks must update every affected surface.PDF/pen inference rules:- `document-picker` means user-selected local files only: pick/import/upload PDF/document/attachment.- `pdf-report` means app-generated PDFs. Local output is shared with `expo-sharing` only when that package is present, or uploaded to a Dataverse File column if retained.-- `native-pdf-viewer` means opening an HTTPS PDF URL with `@microsoft/power-apps-native-pdf-viewer`. It never supports `file://`, `content://`, `blob:`, or `http://`.+- `native-pdf-viewer` means opening an HTTPS PDF URL or local `file://` URI with `@microsoft/power-apps-native-pdf-viewer` 0.2.9+. It does not support `content://`, `blob:`, or `http://`.- `pen-input` means signature/ink capture with `@microsoft/power-apps-native-pen-input`. It returns PNG data URI and needs a Dataverse Image/File/child-row target when persisted.- `geolocation` means continuous/background GPS tracking with durable storage and inline Dataverse sync via `@microsoft/power-apps-native-bglocation`. Auth is MSAL-only; native uploads each fix to an existing Dataverse table (default entity set `msdyn_locationrecords`). It is distinct from one-shot `location` (`expo-location`). Plan it only for continuous tracking or durable upload, require `/add-native geolocation` to verify the target table exists before use, and never propose the `GeolocationExtension`/HostingSDK path.- The Power Apps extensions are use-case-specific, not generic replacements for Expo modules. For other native needs, choose the relevant Expo module or dependency already present in `template/package.json` and still enforce the allowlist.@@ -204,7 +204,7 @@ For each capability the app needs **AND is in the allowlist**:| Expo module | `expo-camera` || Used by screens | `CaptureReceipt`, `ProfilePhoto` || Justification | One-sentence rationale tied to a user need ("Capture receipts attached to expense reports") |-| Storage/output target | `n/a`, `Dataverse Image`, `Dataverse File`, `child Evidence table`, `on-device/share-only`, or `HTTPS URL only` |+| Storage/output target | `n/a`, `Dataverse Image`, `Dataverse File`, `child Evidence table`, `on-device/share-only`, `local file URI`, or `HTTPS URL` || Add via | `/add-native camera` |If the app needs zero allowlisted native capabilities, include a `## Native Capabilities` section that says "None — this app uses only standard React Native components and Power Platform connectors." Transparency notes for dropped caps still appear under this header — "None proposed" is not the same as "nothing was considered."diff --git a/plugins/mobile-apps/agents/screen-builder.md b/plugins/mobile-apps/agents/screen-builder.mdindex 8d5998ce3..cf7595129 100644--- a/plugins/mobile-apps/agents/screen-builder.md+++ b/plugins/mobile-apps/agents/screen-builder.md@@ -198,7 +198,7 @@ You will be invoked by `/create-mobile-app` Step 11 or `/edit-app` screen-rebuil- **Native capabilities: use `src/native/` wrappers, NOT raw Expo modules.** `/add-native` creates typed wrappers under `src/native/` (e.g., `camera.ts`, `cameraUpload.ts`, `secureStore.ts`, `documentPicker.ts`, `pdfReport.ts`, `pdfViewer.ts`, `penInput.ts`, `geolocation.ts`). For non-Dataverse native workflows, always import from these wrappers — never import `expo-camera`, `expo-image-picker`, `expo-document-picker`, `expo-print`, `expo-secure-store`, `expo-file-system`, `expo-sharing`, `@microsoft/power-apps-native-pdf-viewer`, `@microsoft/power-apps-native-pen-input`, or `@microsoft/power-apps-native-bglocation` directly in screen files. The wrappers handle permissions, iOS/Android platform differences, URL validation, and return discriminated-union results (`{ ok: true, ... } | { ok: false, reason }`). If a wrapper doesn't exist yet, write the screen with the expected import path and a `// TODO(native-not-yet-added): run /add-native <capability> to create src/native/<wrapper>.ts` comment. For `camera.ts`, use `/add-native camera`; for `barcodeScanner.tsx`, use `/add-native barcode-scanner`; for `pdfReport.ts`, use `/add-native pdf-report`; for `pdfViewer.ts`, use `/add-native pdf-viewer` or `/add-native @microsoft/power-apps-native-pdf-viewer`; for `penInput.ts`, use `/add-native pen-input` or `/add-native @microsoft/power-apps-native-pen-input`; for `geolocation.ts`, use `/add-native geolocation` or `/add-native @microsoft/power-apps-native-bglocation`. **`expo-notifications` and `expo-haptics` are NOT available** — per AGENTS.md §2 and the HARD RULE below for haptics. If the plan tells you to use an unavailable capability, return `NEEDS_CONTEXT` — do not import it.-- **PDF and pen capability behavior.** Native PDF viewer actions MUST call an HTTPS-only wrapper such as `openHttpsPdf(url)`. Reject or disable actions for `file://`, `content://`, `blob:`, `http://`, empty, or generated local `expo-print` URIs; local generated PDFs use `pdfReport.ts` sharing only when `expo-sharing` was allowlisted, or upload to Dataverse File storage first and can only be viewed later through a supported HTTPS URL if the app has one. Pen capture cancellation (`USER_CANCELLED`) is not an error; leave the screen state unchanged. Handle `NATIVE_MODULE_MISSING`, `VIEWER_FAILED`, `CAPTURE_FAILED`, `uploadFailed`, and `invalidUrl` with visible inline states rather than silent returns.+- **PDF and pen capability behavior.** Native PDF viewer actions MUST call `openHttpsPdf(url)`, which supports `https://` URLs and local `file://` URIs with viewer 0.2.9+. Reject or disable actions for `content://`, `blob:`, `http://`, or empty inputs. Pen capture cancellation (`USER_CANCELLED`) is not an error; leave the screen state unchanged. Handle `NATIVE_MODULE_MISSING`, `VIEWER_FAILED`, `CAPTURE_FAILED`, `uploadFailed`, and `invalidUrl` with visible inline states rather than silent returns.- **Pen signatures and generated PDFs follow Dataverse artifact boundaries.** Pen input returns `data:image/png;base64,...`; for Image columns, normalize to the generated service payload shape and strip the prefix when raw base64 is required. Generated PDFs and signature PNGs stored in File columns are uploaded only after the parent row exists and the create/update result is successful. If the spec says `Artifact persistence: child Evidence/Attachment table`, create that child row first, then upload File bytes or write the Image payload against the child row ID. Never include File bytes in create/update JSON.diff --git a/plugins/mobile-apps/agents/screen-planner.md b/plugins/mobile-apps/agents/screen-planner.mdindex 485ab3268..179f4e7a6 100644--- a/plugins/mobile-apps/agents/screen-planner.md+++ b/plugins/mobile-apps/agents/screen-planner.md@@ -405,12 +405,12 @@ For each screen the user adds, provide this compact shape:- **Audit** (omit for read-only / non-write screens) — one line per audit-bearing action: `<trigger>: event <code> (<event label>); payload: <field, field, field>`. Example: `On submit: event 100000006 (Inspection Submitted); payload: inspectionId, submittedAt, defectCount, openCriticalCount.` The screen-builder wraps the payload field list in `JSON.stringify({...})` and writes the full `cr3e9_audit_log_entriesService.create(...)` call from the Generated Services table — do NOT spell out the wrapper or service name.- **Lookup writes** — for form/edit screens that set a parent reference (Task → Project, Comment → Task, etc.), explicitly list each lookup field with its `@odata.bind` name + entity set, e.g. `'[email protected]': '/cr3e9_projects(<guid>)'`. Without this the screen-builder will guess and silently lose the relationship. Skip for read-only and no-lookup screens.- **Pagination** — `cursor` if the table has no natural record ceiling (visits, inspections, work orders, tickets, any user-created records over time); `none` if the table is a bounded lookup (status types, categories, job types). When `cursor`, include SDK `maxPageSize: 50`, deterministic `orderBy` with a unique key, `select`, `skipToken` continuation support, and server-side `filter` for search in the data spec. Do not imply that `top: 50` alone is pagination.-- **Native capabilities** — which native modules/wrappers it uses, and which iOS/Android platforms or permission states need fallback handling. For PDF/pen screens, be precise: `document-picker` (`expo-document-picker`) for user-picked files; `pdf-report` (`expo-print`, plus `expo-sharing` only when present and local share/open is required) for generated local PDFs; `native-pdf-viewer` (`@microsoft/power-apps-native-pdf-viewer`) for HTTPS PDF URLs only; `pen-input` (`@microsoft/power-apps-native-pen-input`) for signature/ink capture. For location screens, distinguish `geolocation` (`@microsoft/power-apps-native-bglocation`) — continuous/background tracking with native Dataverse sync, needs start/stop/tracking-status UI plus a permission-denied state — from one-shot `location` (`expo-location`) for a single foreground coordinate read.+- **Native capabilities** — which native modules/wrappers it uses, and which iOS/Android platforms or permission states need fallback handling. For PDF/pen screens, be precise: `document-picker` (`expo-document-picker`) for user-picked files; `pdf-report` (`expo-print`, plus `expo-sharing` only when present and sharing is required) for generated local PDFs; `native-pdf-viewer` (`@microsoft/power-apps-native-pdf-viewer` 0.2.9+) for HTTPS PDF URLs and local `file://` URIs; `pen-input` (`@microsoft/power-apps-native-pen-input`) for signature/ink capture. For location screens, distinguish `geolocation` (`@microsoft/power-apps-native-bglocation`) — continuous/background tracking with native Dataverse sync, needs start/stop/tracking-status UI plus a permission-denied state — from one-shot `location` (`expo-location`) for a single foreground coordinate read.- **Calendar library** — REQUIRED for screens with `Calendar pattern` unless the pattern is `timeline-day-list`. Write `react-native-calendars` and name the exact components expected, for example `CalendarProvider`, `ExpandableCalendar`, `AgendaList`, `Calendar`, `CalendarList`, or `Agenda`. The screen-builder imports this library directly; no `/add-native` wrapper is involved.- **Navigation** — what links to it / what it links to- **Navigation intent** — for each outgoing action, explicitly name `navigate`, `push`, or `replace` (must match Navigation Contracts `Intent`)-- **State delta** — loading/error are inherited; specify only domain-specific empty copy/icon/CTA or non-standard state behavior. Empty state copy must be domain-specific (not "No items yet"). If the screen has filters, include filter-empty copy that names the active filter and recovery action. If the data source can fail independently, name the error action (`retry inspections`, `refresh assignments`) rather than treating failures as empty. For PDF/pen screens, include the specific native/artifact states: `invalidUrl` for non-HTTPS PDF viewer input, `viewerFailed`, `pdfGenerationFailed`, `uploadFailed`, `signatureCancelled` (non-error), `signatureCaptureFailed`, and `nativeModuleMissing` where applicable. Examples: `empty: calendar-outline, "No inspections scheduled", CTA "Schedule inspection"`; `filterEmpty: "No critical defects", recovery "Clear severity filter"`.-- **Artifact persistence** (REQUIRED for generated PDFs, signatures, drawings, and uploaded PDFs/docs; omit otherwise) — one line naming the target: `on-device/share-only`, `Dataverse Image column <logicalName>`, `Dataverse File column <logicalName>`, `child Evidence/Attachment table <logicalName>`, or `HTTPS URL from <source>`. For PDF viewer screens, state `HTTPS URL only`; never plan local `file://`, `content://`, or `blob:` viewer input.+- **State delta** — loading/error are inherited; specify only domain-specific empty copy/icon/CTA or non-standard state behavior. Empty state copy must be domain-specific (not "No items yet"). If the screen has filters, include filter-empty copy that names the active filter and recovery action. If the data source can fail independently, name the error action (`retry inspections`, `refresh assignments`) rather than treating failures as empty. For PDF/pen screens, include the specific native/artifact states: `invalidUrl` for malformed or unsupported PDF viewer input, `viewerFailed`, `pdfGenerationFailed`, `uploadFailed`, `signatureCancelled` (non-error), `signatureCaptureFailed`, and `nativeModuleMissing` where applicable. Examples: `empty: calendar-outline, "No inspections scheduled", CTA "Schedule inspection"`; `filterEmpty: "No critical defects", recovery "Clear severity filter"`.+- **Artifact persistence** (REQUIRED for generated PDFs, signatures, drawings, and uploaded PDFs/docs; omit otherwise) — one line naming the target: `on-device/share-only`, `Dataverse Image column <logicalName>`, `Dataverse File column <logicalName>`, `child Evidence/Attachment table <logicalName>`, `HTTPS URL from <source>`, or `local file URI from <source>`. For PDF viewer screens, never plan `content://`, `blob:`, or `http://` input.- **Input ergonomics override** (Form screens only, omit if Shared Conventions field controls cover it) — list only fields that differ from the entity default or require special native input behavior.- **Key user actions** — buttons / forms / gestures- **Idempotency guards** — primary navigation action uses `isNavigating`; async submit uses `isSubmitting`/`isPending`; failed submits stay on-screen with values preserveddiff --git a/plugins/mobile-apps/skills/add-native/SKILL.md b/plugins/mobile-apps/skills/add-native/SKILL.mdindex c79b4174e..1d59aab52 100644--- a/plugins/mobile-apps/skills/add-native/SKILL.md+++ b/plugins/mobile-apps/skills/add-native/SKILL.md@@ -31,7 +31,7 @@ Current dedicated implementations:|---|---|---|| `camera`, `take-photo`, `photo`, `expo-camera`, `image-picker`, `gallery`, `expo-image-picker`, `barcode-scanner`, `qr-scanner`, `scanner` | [`add-camera`](add-camera/SKILL.md) internal helper | Owns photo capture, gallery image picking, and barcode/QR scanner controls backed by `expo-camera` / `expo-image-picker` || `pdf-report`, `pdf-export`, `generate-pdf`, `print-report`, `evidence-packet` | [`add-pdf-report`](add-pdf-report/SKILL.md) internal helper | Generates app-owned local PDFs with `expo-print` and shares them only when `expo-sharing` is present |-| `pdf-viewer`, `native-pdf-viewer`, `pdf-control`, `open-pdf`, `@microsoft/power-apps-native-pdf-viewer` | [`add-pdf-viewer`](add-pdf-viewer/SKILL.md) internal helper | Enforces HTTPS-only viewer URLs and native viewer result handling |+| `pdf-viewer`, `native-pdf-viewer`, `pdf-control`, `open-pdf`, `@microsoft/power-apps-native-pdf-viewer` | [`add-pdf-viewer`](add-pdf-viewer/SKILL.md) internal helper | Enforces `https://` / `file://` viewer inputs and native viewer result handling || `pen-input`, `signature`, `ink`, `draw`, `@microsoft/power-apps-native-pen-input` | [`add-pen-input`](add-pen-input/SKILL.md) internal helper | Captures PNG data URI and documents Dataverse Image/File persistence || `geolocation`, `location-tracking`, `background-location`, `gps-tracking`, `geo-tracking`, `@microsoft/power-apps-native-bglocation` | [`add-geolocation`](add-geolocation/SKILL.md) internal helper | Native background GPS tracking with durable storage and inline Dataverse sync; distinct from one-shot `expo-location` |@@ -48,8 +48,8 @@ Before adding any native control or wrapper, apply every gate: classify the inte| Dedicated photo/gallery/scanner workflow | `/add-native camera`, `image-picker`, or `barcode-scanner` | `expo-camera` and/or `expo-image-picker` present | If packages are absent, stop with missing-package guidance || Pick/import/upload a user-selected PDF/document | `/add-native document-picker`, or host `<FilePicker>` for Dataverse File fields | `expo-document-picker` present, or host File control | Do not treat this as `pdf-report` or native PDF viewer || Generate/export/print an app-owned report PDF | `/add-native pdf-report` | `expo-print` present | If `expo-print` is absent, do not add PDF report capability |-| Share/open a generated local PDF | `pdfReport.ts` share helper | `expo-sharing` present | If `expo-sharing` is absent, allow Dataverse upload only; do not render local share/open UI |-| Open/preview an existing PDF URL | `/add-native pdf-viewer` | `@microsoft/power-apps-native-pdf-viewer` present and URL is `https://` | Do not pass `file://`, `content://`, `blob:`, `http://`, or generated local URIs to the viewer |+| Share a generated local PDF | `pdfReport.ts` share helper | `expo-sharing` present | If `expo-sharing` is absent, do not render sharing UI |+| Open/preview an HTTPS or local file PDF | `/add-native pdf-viewer` | `@microsoft/power-apps-native-pdf-viewer` 0.2.9+ present and input is `https://` or `file://` | Do not pass `content://`, `blob:`, or `http://` URIs to the viewer || Capture signature, ink, drawing, or sign-off | `/add-native pen-input` | `@microsoft/power-apps-native-pen-input` present | If persisted, plan Dataverse Image/File/child Evidence target first || Continuous/background GPS tracking with durable Dataverse upload | `/add-native geolocation` | `@microsoft/power-apps-native-bglocation` present | Do not use one-shot `expo-location` for background tracking; do not use the `GeolocationExtension`/HostingSDK path || Store generated PDF/signature artifact | Generated Dataverse services after parent row exists | File/Image column or child Evidence/Attachment table exists | Never put File bytes in create/update JSON |@@ -130,7 +130,7 @@ Apply the Native capability gate above. This table is a known capability-to-pack| `image-picker`, `gallery`, `expo-image-picker` | `expo-image-picker` | `src/native/imagePicker.ts` | `/add-native` routes internally to `add-camera` || `barcode-scanner`, `qr-scanner`, `scanner`, `barcode`, `qr` | `expo-camera` | `src/native/barcodeScanner.tsx` | `/add-native` routes internally to `add-camera` || `document-picker` | `expo-document-picker` | `src/native/documentPicker.ts` | Picks/imports user-selected files (PDF, docs, etc.) from the device |-| `pdf-viewer`, `native-pdf-viewer`, `pdf-control`, `open-pdf`, `@microsoft/power-apps-native-pdf-viewer` | `@microsoft/power-apps-native-pdf-viewer` | `src/native/pdfViewer.ts` | `/add-native` routes internally to `add-pdf-viewer`; opens HTTPS PDF URLs only |+| `pdf-viewer`, `native-pdf-viewer`, `pdf-control`, `open-pdf`, `@microsoft/power-apps-native-pdf-viewer` | `@microsoft/power-apps-native-pdf-viewer` | `src/native/pdfViewer.ts` | `/add-native` routes internally to `add-pdf-viewer`; 0.2.9+ opens HTTPS URLs and file URIs || `pdf-report`, `pdf-export`, `generate-pdf`, `print-report`, `evidence-packet` | `expo-print` (+ optional `expo-sharing`) | `src/native/pdfReport.ts` | `/add-native` routes internally to `add-pdf-report`; generated local files are shared only when `expo-sharing` is present, or uploaded to Dataverse || `pen-input`, `signature`, `ink`, `draw`, `@microsoft/power-apps-native-pen-input` | `@microsoft/power-apps-native-pen-input` | `src/native/penInput.ts` | `/add-native` routes internally to `add-pen-input`; captures PNG data URI || `geolocation`, `location-tracking`, `background-location`, `gps-tracking`, `geo-tracking`, `@microsoft/power-apps-native-bglocation` | `@microsoft/power-apps-native-bglocation` | `src/native/geolocation.ts` | `/add-native` routes internally to `add-geolocation`; native background tracking + durable Dataverse sync. Distinct from one-shot `location` below |@@ -156,11 +156,11 @@ Apply the Native capability gate above. This table is a known capability-to-pack- Do not treat every PDF request as `document-picker`.- Use `document-picker` when the user wants to pick, import, or upload a local PDF/document. This remains supported and should still be used for that use case.- Use `pdf-report` when the app generates a PDF from records, evidence, inspection data, certificates, receipts, or reports, but only if `expo-print` is present in `package.json`.-- Use `native-pdf-viewer` / `pdf-control` only when the app opens/previews an HTTPS PDF URL with `@microsoft/power-apps-native-pdf-viewer`. Local `file://`, `content://`, and `blob:` URIs are unsupported by the native viewer path.+- Use `native-pdf-viewer` / `pdf-control` when the app opens/previews an HTTPS PDF URL or local `file://` URI with `@microsoft/power-apps-native-pdf-viewer` 0.2.9+. `content://`, `blob:`, and `http://` URIs are unsupported.- If a request says "view/open PDF" but the Power Apps viewer package is absent, fall back to `pdf-report` only when the app is generating its own report and `expo-print` is present. Do not claim generic PDF viewing support through `expo-print`; it generates local files, it does not view arbitrary PDFs.- Use `pen-input` only for signatures, drawn approvals, ink notes, sketches, and handwritten sign-off with `@microsoft/power-apps-native-pen-input`.- For other use cases, use the relevant Expo module or other dependency already present in `package.json`; do not force the Power Apps extensions into unrelated flows.-- For generated local PDFs from `expo-print`, use `expo-sharing` for local share/open behavior only if `expo-sharing` is present. If `expo-sharing` is absent, generated PDFs can still be uploaded to Dataverse File storage; otherwise do not add local share/open behavior.+- For generated local PDFs from `expo-print`, use native PDF viewer 0.2.9+ for open/preview, `expo-sharing` for sharing, and Dataverse File storage for retention. Do not require `expo-sharing` merely to preview a local PDF.- Host `FilePicker` and `ImagePicker` are still correct for user-selected Dataverse File/Image form fields. Generated PDFs and pen captures use native wrappers first, then Dataverse persistence helpers.### Dataverse artifact persistence rulesdiff --git a/plugins/mobile-apps/skills/add-native/add-pdf-report/SKILL.md b/plugins/mobile-apps/skills/add-native/add-pdf-report/SKILL.mdindex c371237d2..2aaab68ab 100644--- a/plugins/mobile-apps/skills/add-native/add-pdf-report/SKILL.md+++ b/plugins/mobile-apps/skills/add-native/add-pdf-report/SKILL.md@@ -12,19 +12,19 @@ model: sonnet**Internal helper.** Users should invoke `/add-native pdf-report`, `/add-native generate-pdf`, or `/add-native pdf-export`; `/add-native` routes here after resolving the capability.-Generate or verify a local PDF report wrapper for app-owned PDFs created from records, evidence, certificates, receipts, or summaries. This helper uses `expo-print` to create a local PDF file URI. It may use `expo-sharing` only when that package is already present. It never installs packages and never routes local PDF URIs to the native PDF viewer.+Generate or verify a local PDF report wrapper for app-owned PDFs created from records, evidence, certificates, receipts, or summaries. This helper uses `expo-print` to create a local PDF file URI. It may use `expo-sharing` only when that package is already present. It never installs packages or imports the native PDF viewer directly.## Capability boundaries| User need | Correct path ||---|---|| Generate/export/print a report from app data | This helper: `expo-print` -> local PDF URI |-| Share/open the generated local PDF from the device | Add share method only if `expo-sharing` is already in `package.json` |+| Share the generated local PDF from the device | Add share method only if `expo-sharing` is already in `package.json` || Retain the generated PDF in Dataverse | Create/update parent row first, then upload to a Dataverse File column with generated services |-| Open an existing HTTPS PDF URL in the Power Apps native viewer | `/add-native pdf-viewer`, only if `@microsoft/power-apps-native-pdf-viewer` is already present |+| Open an existing HTTPS or local file PDF in the Power Apps native viewer | `/add-native pdf-viewer`, only if `@microsoft/power-apps-native-pdf-viewer` 0.2.9+ is already present || Pick/import/upload a user-selected PDF | `/add-native document-picker` or host `<FilePicker>` for Dataverse File columns |-Local generated PDFs are usually `file://` URIs. They are not valid input for `openHttpsPdf(...)` and must not be passed to `@microsoft/power-apps-native-pdf-viewer`.+Local generated PDFs are usually `file://` URIs and can be passed to `openHttpsPdf(...)` with `@microsoft/power-apps-native-pdf-viewer` 0.2.9+.## Steps@@ -38,20 +38,20 @@ If this fails, tell the user to run `/create-mobile-app` first and STOP.### 2. Verify packages are already present-`expo-print` is required. `expo-sharing` is optional unless the plan specifically needs local share/open behavior.+`expo-print` is required. `expo-sharing` is optional unless the plan specifically needs sharing behavior.```bash-node -e "const p=require('./package.json'); const deps={...p.dependencies,...p.devDependencies}; const required='expo-print'; if (!deps[required]) { console.error('MISSING: expo-print is not in package.json. The template/app must already ship it for /add-native pdf-report. This skill will not install it or edit native config. Capability not added.'); process.exit(1); } console.log('OK: expo-print package present'); console.log(deps['expo-sharing'] ? 'OK: expo-sharing package present' : 'OPTIONAL_MISSING: expo-sharing is not in package.json; generated PDFs can be created/uploaded, but local share/open helpers must not be generated.');"+node -e "const p=require('./package.json'); const deps={...p.dependencies,...p.devDependencies}; const required='expo-print'; if (!deps[required]) { console.error('MISSING: expo-print is not in package.json. The template/app must already ship it for /add-native pdf-report. This skill will not install it or edit native config. Capability not added.'); process.exit(1); } console.log('OK: expo-print package present'); console.log(deps['expo-sharing'] ? 'OK: expo-sharing package present' : 'OPTIONAL_MISSING: expo-sharing is not in package.json; generated PDFs can be created/viewed/uploaded, but sharing helpers must not be generated.');"```If `expo-print` is missing, STOP. Do not run `npm install`, `npx expo install`, `pod install`, or edit `app.config.js`. Do not add `pdf-report` to the plan or generated wrappers for this app.If `expo-sharing` is missing:-- Continue only for generate-only or Dataverse-upload flows.+- Continue for generate-only, native-viewer preview, or Dataverse-upload flows.- Do not import `expo-sharing`.- Do not generate `sharePdfReport(...)`.-- If the user's requirement is specifically local share/open and there is no Dataverse upload alternative, STOP and say the requested share/open behavior is not supported by this template.+- If the user's requirement specifically includes sharing, STOP and say sharing is not supported by this template.### 3. Write or verify `src/native/pdfReport.ts`@@ -62,8 +62,8 @@ The wrapper MUST:- Import `expo-print` only after Step 2 confirms it is present.- Import `expo-sharing` only when Step 2 confirms it is present.- Return discriminated unions and never throw.-- Treat generated local PDFs as local files for share/upload only.-- Never call `openHttpsPdf(...)` or import `@microsoft/power-apps-native-pdf-viewer`.+- Treat generated local PDFs as local files for view/share/upload flows.+- Never import `@microsoft/power-apps-native-pdf-viewer` directly from this wrapper.- Keep HTML generation deterministic and app-owned; do not fetch remote HTML inside the wrapper.Base wrapper when `expo-sharing` is present:@@ -185,7 +185,7 @@ if (!share.ok) {}```-If `expo-sharing` is absent, screens may still call `createPdfReport(...)` and then upload the generated PDF to a Dataverse File column through generated services. They must not render a local Share/Open button unless another supported app-specific path exists.+If `expo-sharing` is absent, screens may still call `createPdfReport(...)`, preview the returned `file://` URI through native PDF viewer 0.2.9+, or upload it to a Dataverse File column through generated services. They must not render a Share button.### 5. Optional Dataverse upload@@ -251,7 +251,7 @@ Required package : expo-printOptional share : expo-sharing <present | absent>Wrapper : src/native/pdfReport.tsOutput : local PDF file URI-Native viewer : not used; generated local URIs are not HTTPS viewer input+Native viewer : optional; 0.2.9+ can open the generated file:// URIType-check : PASSNative rebuild : not performed by this skill```diff --git a/plugins/mobile-apps/skills/add-native/add-pdf-viewer/SKILL.md b/plugins/mobile-apps/skills/add-native/add-pdf-viewer/SKILL.mdindex 5850ae910..bba1b6e28 100644--- a/plugins/mobile-apps/skills/add-native/add-pdf-viewer/SKILL.md+++ b/plugins/mobile-apps/skills/add-native/add-pdf-viewer/SKILL.md@@ -1,6 +1,6 @@---name: add-pdf-viewer-description: Internal implementation skill invoked by /add-native for native PDF control workflows. Handles HTTPS-only PDF viewing with @microsoft/power-apps-native-pdf-viewer.+description: Internal implementation skill invoked by /add-native for native PDF control workflows. Handles HTTPS and file URI PDF viewing with @microsoft/power-apps-native-pdf-viewer 0.2.9+.user-invocable: falseallowed-tools: Read, Edit, Write, Grep, Glob, Bash, AskUserQuestionmodel: sonnet@@ -12,7 +12,7 @@ model: sonnet**Internal helper.** Users should invoke `/add-native pdf-viewer`, `/add-native pdf-control`, or `/add-native @microsoft/power-apps-native-pdf-viewer`; `/add-native` routes here after resolving the capability.-Generate or verify the native PDF viewer wrapper and show how to call its **native React Native API**. This skill supports HTTPS PDF URLs only. Do not use the HostingSDK / PCF path from the package README; that is for a different use case.+Generate or verify the native PDF viewer wrapper and show how to call its **native React Native API**. Version 0.2.9 and later support HTTPS PDF URLs and local `file://` URIs. Do not use the HostingSDK / PCF path from the package README; that is for a different use case.## Steps@@ -27,19 +27,19 @@ If this fails, tell the user to run `/create-mobile-app` first and STOP.### 2. Verify package is already present```bash-node -e "const p=require('./package.json'); const m='@microsoft/power-apps-native-pdf-viewer'; if (!p.dependencies?.[m]) { console.error('MISSING: ' + m + ' is not in package.json. The template/app must already ship this native extension. This skill will not install it or edit native config.'); process.exit(1); } console.log('OK: native PDF viewer package present');"+node -e "const p=require('./package.json'); const m='@microsoft/power-apps-native-pdf-viewer'; if (!p.dependencies?.[m]) { console.error('MISSING: ' + m + ' is not in package.json. The template/app must already ship this native extension. This skill will not install it or edit native config.'); process.exit(1); } let v; try { v=require('./node_modules/' + m + '/package.json').version; } catch { console.error('MISSING_INSTALL: cannot verify the installed ' + m + ' version. Run the project package install first.'); process.exit(1); } const [major,minor,patch]=v.split('.').map(Number); if (!(major > 0 || minor > 2 || (minor === 2 && patch >= 9))) { console.error('UNSUPPORTED_VERSION: ' + m + ' ' + v + ' does not support file:// URIs. Version 0.2.9+ is required.'); process.exit(1); } console.log('OK: native PDF viewer ' + v + ' supports https:// and file://');"```-If the check fails, STOP. Do not run `npm install`, `npx expo install`, `pod install`, or edit `app.config.js`. This package contains native iOS/Android code and must already be part of the app's native build.+If the check fails, STOP. Do not run `npm install`, `npx expo install`, `pod install`, or edit `app.config.js`. Version 0.2.9+ must already be part of the app's native build.### 3. Write or verify `src/native/pdfViewer.ts`-Create `src/native/pdfViewer.ts` if it does not exist. If it already exists, inspect it and patch only if it violates the HTTPS-only rule or throws instead of returning a result.+Create `src/native/pdfViewer.ts` if it does not exist. If it already exists, inspect it and patch only if it violates the supported URI rules or throws instead of returning a result.The wrapper MUST:-- Accept only `https://` URLs.-- Reject `file://`, `content://`, `blob:`, `http://`, empty, and malformed URLs before calling native code.+- Accept `https://` URLs and `file://` URIs.+- Reject `content://`, `blob:`, `http://`, empty, and malformed URLs before calling native code.- Return a discriminated union and never throw.- Return `NATIVE_MODULE_MISSING` when the extension is installed in JS but unavailable in the native build.- Surface viewer action results (`shared`, `printed`, `dismissed`) when available.@@ -61,11 +61,13 @@ export async function openHttpsPdf(try {parsed = new URL(url);} catch {- return { ok: false, reason: 'INVALID_URL', message: 'PDF URL must be a valid HTTPS URL.' };+ return { ok: false, reason: 'INVALID_URL', message: 'PDF location must be a valid https:// URL or file:// URI.' };}- if (parsed.protocol !== 'https:') {- return { ok: false, reason: 'INVALID_URL', message: 'Native PDF viewer supports HTTPS PDF URLs only.' };+ const isHttpsUrl = parsed.protocol === 'https:';+ const isFileUri = parsed.protocol === 'file:' && url.startsWith('file://') && parsed.pathname !== '/';+ if (!isHttpsUrl && !isFileUri) {+ return { ok: false, reason: 'INVALID_URL', message: 'Native PDF viewer supports https:// and file:// inputs only.' };}if (!NativePdfViewer?.openPdf) {@@ -119,11 +121,11 @@ if (response.ok) {```Notes:-- URLs must be `https://`. Local `file://`, `content://`, and `blob:` URIs are not supported by this skill.-- Use `@microsoft/power-apps-native-pdf-viewer` only for this native HTTPS PDF viewing use case.+- URLs must use `https://` or a non-empty `file://` URI. `content://`, `blob:`, and `http://` are not supported by this skill.+- Use `@microsoft/power-apps-native-pdf-viewer` only for this native PDF viewing use case.- Use `expo-document-picker` for picking/importing/uploading a local PDF or document.-- Use `/add-native pdf-report` for generated local PDFs. That helper requires `expo-print` and adds local share/open behavior only when `expo-sharing` is already present.-- Generated local PDFs from `expo-print` must either open through the `pdfReport` share wrapper when `expo-sharing` is present, or be uploaded to Dataverse File storage first and viewed later through a supported HTTPS URL if one is available.+- Use `/add-native pdf-report` for generated local PDFs. That helper requires `expo-print` and adds sharing behavior only when `expo-sharing` is already present.+- Generated local PDFs from `expo-print` may be opened by native PDF viewer 0.2.9+ as `file://` URIs.- Share and Print are built into the native viewer; there are no separate JS share/print calls.- The wrapper returns `{ ok: true } | { ok: false }`; handle every non-ok reason in UI.@@ -157,7 +159,7 @@ Tell the user:PDF viewer addedPackage present : @microsoft/power-apps-native-pdf-viewerWrapper : src/native/pdfViewer.ts-URL support : HTTPS only+URL support : HTTPS and file:// (0.2.9+)Type-check : PASSNative rebuild : not performed by this skillUsage : openHttpsPdf(...)diff --git a/plugins/mobile-apps/skills/create-mobile-app/references/requirements-discovery.md b/plugins/mobile-apps/skills/create-mobile-app/references/requirements-discovery.mdindex 58eed13d6..ea61f8818 100644--- a/plugins/mobile-apps/skills/create-mobile-app/references/requirements-discovery.md+++ b/plugins/mobile-apps/skills/create-mobile-app/references/requirements-discovery.md@@ -12,7 +12,7 @@ Scan the user's description and wizard answers for these signals, then confirm i| "photo", "attach", "image", "camera" | Camera capability + image column || "pick file", "upload PDF", "import document", "attach file" | Document-picker capability + optional Dataverse File column || "generate PDF", "export report", "print report", "evidence packet", "certificate PDF" | PDF-report capability + optional Dataverse File column when retained |-| "view PDF", "open PDF", "preview PDF" | Native PDF viewer capability for HTTPS PDF URLs only |+| "view PDF", "open PDF", "preview PDF" | Native PDF viewer capability for HTTPS URLs or local `file://` URIs with viewer 0.2.9+ || "signature", "sign", "sign off", "approval", "pen", "ink", "draw" | Pen-input capability + Dataverse Image/File storage target || "track location", "background location", "GPS tracking", "follow route", "breadcrumb", "field worker location" | Geolocation capability (`@microsoft/power-apps-native-bglocation`) + Dataverse location table (default `msdyn_locationrecords`) || "current location", "where am I", "tag with coordinates", "one-shot location" | One-shot location capability (`expo-location`) |@@ -28,8 +28,8 @@ Do not infer capabilities the template does not ship. Resolve every native signaPDF/pen rules:- Do not infer `document-picker` from generic "PDF" alone; use the specific signal rows above.-- Native PDF viewing supports HTTPS URLs only and requires `@microsoft/power-apps-native-pdf-viewer`.-- Local generated PDFs require `expo-print`; share/open behavior also requires `expo-sharing`.+- Native PDF viewing supports HTTPS URLs and local `file://` URIs with `@microsoft/power-apps-native-pdf-viewer` 0.2.9+.+- Local generated PDFs require `expo-print`; preview requires native PDF viewer 0.2.9+, while sharing requires `expo-sharing`.- Retained generated PDFs require a Dataverse File column or child Evidence/Attachment table.- Signature/ink capture must record a Dataverse target in `native-app-plan.md`: Image column, File column, or child Evidence/Signature table.- Background/continuous location tracking uses the `geolocation` capability (`@microsoft/power-apps-native-bglocation`, MSAL-only) and requires an existing Dataverse target table (default entity set `msdyn_locationrecords`, or a custom `tableName` whose `fieldMap` columns exist). `/add-native geolocation` must verify that table; if it is missing, do not allow the control to be used. The missing control table is not created through `/add-dataverse`; use the geolocation-control table provisioning/setup mechanism, then re-run `/add-native geolocation`. Use one-shot `location` (`expo-location`) for a single foreground coordinate read; do not conflate the two.diff --git a/plugins/mobile-apps/skills/debug-app/SKILL.md b/plugins/mobile-apps/skills/debug-app/SKILL.mdindex baddaeca2..a59b6aeec 100644--- a/plugins/mobile-apps/skills/debug-app/SKILL.md+++ b/plugins/mobile-apps/skills/debug-app/SKILL.md@@ -323,7 +323,7 @@ Apply the 8-category table. Treat each unique stack trace / error message as one| Critical | `Cannot read properties of undefined`, `is not a function` | JS Runtime || High | `NATIVE_MODULE_MISSING` from `pdfViewer` or `penInput` wrapper | Native || High | `NATIVE_MODULE_MISSING`, `PERMISSION_DENIED`, or `TRACKING_FAILED` from `geolocation` wrapper | Native |-| High | `INVALID_URL` from `pdfViewer`, or logs mentioning `file://`, `content://`, `blob:`, or `http://` PDF viewer input | JS Runtime |+| High | `INVALID_URL` from `pdfViewer`, or logs mentioning `content://`, `blob:`, or `http://` PDF viewer input | JS Runtime || High | `VIEWER_FAILED` or `CAPTURE_FAILED` from PDF/pen wrapper | Native || High | `ERROR` level runtime log | JS Runtime || High | HTTP 4xx / 5xx surfaced in logs | Network / API |@@ -438,8 +438,8 @@ Read the relevant source file(s). Identify:| Unrecognized error pattern | **Best-effort autonomous fix** — see D3.2 below. The skill attempts a single named hypothesis instead of stopping; the existing 2-attempt escalation rule is the safety net. |PDF/pen/geolocation-specific routing:-- `INVALID_URL` for PDF viewer input is an inline screen/wrapper fix. Enforce `https://` before dispatch. Never add support for `file://`, `content://`, `blob:`, or `http://` in the native viewer path.-- A generated PDF local URI must be handled through `src/native/pdfReport.ts` sharing only when `expo-sharing` is present, or uploaded to Dataverse File storage first and viewed only through a supported HTTPS URL if the app has one.+- `INVALID_URL` for PDF viewer input is an inline screen/wrapper fix. Allow `https://` and non-empty `file://` inputs with viewer 0.2.9+. Never add support for `content://`, `blob:`, or `http://` in the native viewer path.+- A generated PDF local `file://` URI may be opened by native PDF viewer 0.2.9+.- `NATIVE_MODULE_MISSING` for PDF viewer or pen input means the native extension is not in the running build. Do not install packages or edit native config from debug; route to `/add-native pdf-viewer` or `/add-native pen-input` to verify wrapper/package state, then tell the user a native rebuild/template update is needed if the package is absent from the app build.- For `geolocation`, debug the actual failure dimension: can tracking start (`startTracking`, permissions, native module), are rows reaching Dataverse (default `msdyn_locationrecords` exists, native upload/auth errors, no JS upload path), and does behavior match the user expectation (background, restart persistence, breadcrumb/route continuity). Fix visible screen handling inline; if the native module/table is missing, block use and route to the relevant geolocation setup path, not `/add-dataverse`.- `USER_CANCELLED` from pen input is not a bug unless the screen renders it as an error. Inline fix screens that show cancellation as failure.diff --git a/plugins/mobile-apps/skills/edit-app/SKILL.md b/plugins/mobile-apps/skills/edit-app/SKILL.mdindex 61bfad536..b83e8face 100644--- a/plugins/mobile-apps/skills/edit-app/SKILL.md+++ b/plugins/mobile-apps/skills/edit-app/SKILL.md@@ -210,7 +210,7 @@ For PDF/signature requests, map the change to every affected section instead of| Store signed approval as Dataverse image | Data Model: Image column; Screens: normalize `data:image/png;base64,...` before update; Native Capabilities: `pen-input` if capture is in-app || Generate/export/print evidence PDF | Native Capabilities: `pdf-report` only when `expo-print` is present, plus `sharing` only when local share is needed and `expo-sharing` is present; Data Model: File column only if retained; Screens: generation pending/failed/success states || Persist generated PDFs | Data Model: Dataverse File column or child Attachment table; Screens: create/update row first, then upload File bytes; Native Capabilities: `pdf-report` |-| View/open/preview PDF | Native Capabilities: `native-pdf-viewer` only for HTTPS PDF URLs and only when `@microsoft/power-apps-native-pdf-viewer` is present; Screens: invalid URL and viewer failed states |+| View/open/preview PDF | Native Capabilities: `native-pdf-viewer` for HTTPS URLs or local `file://` URIs when `@microsoft/power-apps-native-pdf-viewer` 0.2.9+ is present; Screens: invalid URL and viewer failed states |If a single PDF/signature request requires multiple plan sections, say so and run the edit loop section-by-section. Do not write a native capability entry that references a Dataverse column or screen state that remains absent from the plan.@@ -329,8 +329,8 @@ Parse the first line of every agent result using the return-status protocol in `For Native Capabilities (no separate agent), do it inline: read the current capability table, apply the change, regenerate the table. For PDF/pen rows, include storage/output notes in the table or immediately below it:-- `native-pdf-viewer` opens HTTPS URLs only; it does not support `file://`, `content://`, or `blob:`.-- `pdf-report` generates a local PDF only when `expo-print` is present; local output is shared with `expo-sharing` only when that package is present, or uploaded to Dataverse File storage before later HTTPS viewing.+- `native-pdf-viewer` 0.2.9+ opens HTTPS URLs and local `file://` URIs; it does not support `content://`, `blob:`, or `http://`.+- `pdf-report` generates a local PDF only when `expo-print` is present; local output may be opened by `native-pdf-viewer` 0.2.9+, shared with `expo-sharing` when present, or uploaded to Dataverse File storage.- `pen-input` returns a PNG data URI; cancellation is a non-error state; Dataverse target must be Image, File, or child Evidence/Signature row.For connector/data-source edits, read and execute `/add-datasource` when the source type is unclear; use `/add-sharepoint`, `/add-connector`, or `/add-dataverse` directly only when the source type is clear. If the connector drives new screens or forms, update the Screens section too before applying code.diff --git a/plugins/mobile-apps/skills/setup-datamodel/SKILL.md b/plugins/mobile-apps/skills/setup-datamodel/SKILL.mdindex df38eb280..c34ca401f 100644--- a/plugins/mobile-apps/skills/setup-datamodel/SKILL.md+++ b/plugins/mobile-apps/skills/setup-datamodel/SKILL.md@@ -58,7 +58,7 @@ When requirements mention signatures, sign-off, ink, drawings, generated PDFs, e| "capture signature", "sign off", "approval signature", "ink" | Image column on the signed record for one current signature, or child Evidence/Signature table for multiple captures/history || "generate PDF", "export report", "evidence packet", "certificate PDF" | Ask whether the generated PDF should be retained. If yes, use a Dataverse File column, usually on the parent record or a child Evidence/Attachment table. If no, document on-device/share-only behavior and add no column. || "upload PDF", "attach file", "import document" | File column or child Attachment table with lookup to parent |-| "view PDF" | Store or reference an HTTPS URL only if the app has a durable source. Native PDF viewer does not support local `file://`, `content://`, or `blob:` URIs. |+| "view PDF" | Store or reference an HTTPS URL if the app has a durable source. Native PDF viewer 0.2.9+ also supports local `file://` URIs; `content://`, `blob:`, and `http://` remain unsupported. |PDF content must never be modeled as long text/base64 text. Use Dataverse File columns for retained PDFs. Signature PNGs may use Image columns when the generated service supports image payloads; use File columns or child Evidence rows when the capture should behave like an attachment.