@omercnet/paseo-omp 5.4.0-next.405.1 → 5.4.0-next.406.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.
@@ -14,6 +14,7 @@ import type { ComposerPillSettings } from "../shared/composer-pill-settings";
14
14
  import { listOmpAgents } from "../shared/omp-agents";
15
15
  import { listOmpConfig, type OmpConfig } from "../shared/omp-config";
16
16
  import { listOmpModels } from "../shared/omp-models";
17
+ import { getOmpPromptFiles } from "../shared/omp-prompt-files";
17
18
  import {
18
19
  categorizeOmpSetting,
19
20
  formatOmpSettingLabel,
@@ -63,6 +64,7 @@ import {
63
64
  mcpTone,
64
65
  type PathStateSummary,
65
66
  processTone,
67
+ promptFileNotices,
66
68
  refreshProviderDiagnostics,
67
69
  rpcUiTone,
68
70
  selectKnownOmpProviders,
@@ -85,6 +87,7 @@ import {
85
87
  const SETTINGS_QUERY_KEY = ["paseo-omp", "settings"] as const;
86
88
  const CONFIG_POLL_MS = 30_000;
87
89
  const HEALTH_QUERY_KEY = ["paseo-omp", "provider-health"] as const;
90
+ const PROMPT_FILES_QUERY_KEY = ["paseo-omp", "prompt-files"] as const;
88
91
  const PROVIDERS_QUERY_KEY = ["paseo-omp", "provider-snapshot"] as const;
89
92
 
90
93
  function KeyValueRow({
@@ -376,6 +379,42 @@ function ProcessSection({
376
379
  );
377
380
  }
378
381
 
382
+ function PromptFilesSection({
383
+ theme,
384
+ styles,
385
+ cwd,
386
+ store,
387
+ }: {
388
+ theme: PluginSurfaceProps["theme"];
389
+ styles: OmpConfigStyles;
390
+ cwd?: string;
391
+ store?: OmpStore;
392
+ }) {
393
+ const loadPromptFiles = useRpc(getOmpPromptFiles);
394
+ const files = useQuery({
395
+ queryKey: [...PROMPT_FILES_QUERY_KEY, ompStoreKey(store), cwd ?? "global"],
396
+ queryFn: () => loadPromptFiles({ store, ...(cwd ? { cwd } : {}) }),
397
+ });
398
+ if (files.error) {
399
+ return <Text style={styles.error}>Could not read the OMP prompt files. Try refreshing.</Text>;
400
+ }
401
+ const notices = files.data ? promptFileNotices(files.data) : [];
402
+ if (notices.length === 0) return null;
403
+ return (
404
+ <SectionCard styles={styles} title="Prompt files">
405
+ {notices.map((notice) => (
406
+ <KeyValueRow
407
+ key={notice.file}
408
+ styles={styles}
409
+ label={notice.file}
410
+ value={notice.text}
411
+ valueColor={theme.colors.statusWarning}
412
+ />
413
+ ))}
414
+ </SectionCard>
415
+ );
416
+ }
417
+
379
418
  function ProviderHealthSection({
380
419
  theme,
381
420
  styles,
@@ -418,6 +457,7 @@ function ProviderHealthSection({
418
457
  cwd ? undefined : loadUpdateStatus({ force: true }).catch(() => undefined),
419
458
  ]);
420
459
  if (update) queryClient.setQueryData(UPDATE_QUERY_KEY, update);
460
+ await queryClient.invalidateQueries({ queryKey: PROMPT_FILES_QUERY_KEY });
421
461
  if (result.failed) throw new Error("Could not fully refresh OMP provider health.");
422
462
  },
423
463
  });
@@ -473,6 +513,7 @@ function ProviderHealthSection({
473
513
  ) : null}
474
514
  {health.data ? <StorageSection theme={theme} styles={styles} health={health.data} /> : null}
475
515
  {health.data ? <ProcessSection theme={theme} styles={styles} health={health.data} /> : null}
516
+ <PromptFilesSection theme={theme} styles={styles} cwd={cwd} store={store} />
476
517
 
477
518
  {providers.isLoading ? <Text style={styles.muted}>Loading provider status…</Text> : null}
478
519
  {providers.error ? (
@@ -1,3 +1,4 @@
1
+ import type { OmpPromptFiles } from "../shared/omp-prompt-files";
1
2
  import type {
2
3
  OmpLspDiagnostics,
3
4
  OmpMcpDiagnostics,
@@ -259,3 +260,30 @@ export function selectKnownOmpProviders(
259
260
  : [],
260
261
  );
261
262
  }
263
+
264
+ export interface PromptFileNotice {
265
+ file: "APPEND_SYSTEM.md" | "SYSTEM.md";
266
+ text: string;
267
+ }
268
+
269
+ /**
270
+ * Paseo's built-in omp provider passes the host Append system prompt as `--append-system-prompt`
271
+ * on create and resume, which makes OMP skip a discovered APPEND_SYSTEM.md. With no host prompt
272
+ * there is no APPEND_SYSTEM.md notice; per-agent prompts are not visible to a plugin.
273
+ */
274
+ export function promptFileNotices(files: OmpPromptFiles): PromptFileNotice[] {
275
+ const notices: PromptFileNotice[] = [];
276
+ if (files.appendSystemFile && files.hostAppendPrompt) {
277
+ notices.push({
278
+ file: "APPEND_SYSTEM.md",
279
+ text: "Paseo's Append system prompt is set, so agents on the built-in omp provider and newly created agents on the omp-plugin provider ignore this file.",
280
+ });
281
+ }
282
+ if (files.systemFile) {
283
+ notices.push({
284
+ file: "SYSTEM.md",
285
+ text: "Active. It replaces OMP's default prompt, so OMP's default tool policy is off.",
286
+ });
287
+ }
288
+ return notices;
289
+ }
package/index.server.ts CHANGED
@@ -20,6 +20,7 @@ import {
20
20
  resolveMutateOmpPlugin,
21
21
  resolveMutateOmpPluginConfig,
22
22
  } from "./server/omp-plugins";
23
+ import { readHostAppendPrompt, readOmpPromptFiles } from "./server/omp-prompt-files";
23
24
  import { resolveListOmpRules } from "./server/omp-rules";
24
25
  import { resolveListOmpSettings, resolveUpdateOmpSettings } from "./server/omp-settings";
25
26
  import {
@@ -85,6 +86,7 @@ import {
85
86
  mutateOmpPlugin,
86
87
  mutateOmpPluginConfig,
87
88
  } from "./shared/omp-plugins";
89
+ import { getOmpPromptFiles } from "./shared/omp-prompt-files";
88
90
  import { listOmpRules } from "./shared/omp-rules";
89
91
  import { listOmpSettings, updateOmpSettings } from "./shared/omp-settings";
90
92
  import { deleteOmpManagedSkill, listOmpSkills, setOmpSkillEnabled } from "./shared/omp-skills";
@@ -220,6 +222,10 @@ export default function contribute(server: PluginServerContext) {
220
222
  server.handle(listOmpSettings, scoped(resolveListOmpSettings));
221
223
  server.handle(updateOmpSettings, scoped(resolveUpdateOmpSettings));
222
224
  server.handle(getOmpProviderHealth, scoped(resolveGetOmpProviderHealth));
225
+ // Not `scoped`: the handler also needs the host context to read Paseo's Append system prompt.
226
+ server.handle(getOmpPromptFiles, ({ store, cwd }, { paseo }) =>
227
+ withOmpStore(store, async () => readOmpPromptFiles(cwd, await readHostAppendPrompt(paseo))),
228
+ );
223
229
  server.handle(getOmpUpdateStatus, resolveGetOmpUpdateStatus);
224
230
  server.handle(installOmpUpdate, resolveInstallOmpUpdate);
225
231
  server.handle(getOmpImage, (input) => resolveGetOmpImage(input, ompImageCache()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omercnet/paseo-omp",
3
- "version": "5.4.0-next.405.1",
3
+ "version": "5.4.0-next.406.1",
4
4
  "type": "module",
5
5
  "description": "Paseo integration for OMP, including its direct provider and workspace tooling.",
6
6
  "license": "MIT",
@@ -0,0 +1,41 @@
1
+ import { stat } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import type { PluginHandlerContext } from "@getpaseo/plugin/server";
4
+ import type { OmpPromptFiles } from "../shared/omp-prompt-files";
5
+ import { ompAgentDir } from "./paths";
6
+
7
+ // OMP checks for the file's existence, so an empty file still counts. A `.omp` that is a file
8
+ // (ENOTDIR) simply has no prompt files in it.
9
+ async function hasFile(path: string): Promise<boolean> {
10
+ try {
11
+ return (await stat(path)).isFile();
12
+ } catch (error) {
13
+ const code = (error as NodeJS.ErrnoException).code;
14
+ if (code === "ENOENT" || code === "ENOTDIR") return false;
15
+ throw error;
16
+ }
17
+ }
18
+
19
+ async function hasPromptFile(directories: readonly string[], name: string): Promise<boolean> {
20
+ const found = await Promise.all(directories.map((directory) => hasFile(join(directory, name))));
21
+ return found.some(Boolean);
22
+ }
23
+
24
+ /** Paseo's host Append system prompt as a yes/no; the text never leaves this function. */
25
+ export async function readHostAppendPrompt(paseo: PluginHandlerContext["paseo"]): Promise<boolean> {
26
+ const { config } = await paseo.config.get();
27
+ return config.appendSystemPrompt.trim() !== "";
28
+ }
29
+
30
+ /** Where OMP looks: the agent directory, plus the workspace's `.omp/` for a project view. */
31
+ export async function readOmpPromptFiles(
32
+ cwd: string | undefined,
33
+ hostAppendPrompt: boolean,
34
+ ): Promise<OmpPromptFiles> {
35
+ const directories = [ompAgentDir(), ...(cwd ? [join(cwd, ".omp")] : [])];
36
+ const [appendSystemFile, systemFile] = await Promise.all([
37
+ hasPromptFile(directories, "APPEND_SYSTEM.md"),
38
+ hasPromptFile(directories, "SYSTEM.md"),
39
+ ]);
40
+ return { appendSystemFile, systemFile, hostAppendPrompt };
41
+ }
@@ -1,2 +1,2 @@
1
1
  /** Release Please keeps this bundle-safe constant aligned with package.json. */
2
- export const PASEO_OMP_PACKAGE_VERSION = "5.4.0-next.405.1"; // x-release-please-version
2
+ export const PASEO_OMP_PACKAGE_VERSION = "5.4.0-next.406.1"; // x-release-please-version
@@ -0,0 +1,24 @@
1
+ import { defineRpc } from "@getpaseo/plugin";
2
+ import { z } from "zod";
3
+ import { OmpWorkspaceCwdSchema } from "./hub";
4
+ import { OmpStoreSchema } from "./omp-store";
5
+
6
+ /** Facts only: never the text of a prompt file or of Paseo's Append system prompt. */
7
+ export const OmpPromptFilesSchema = z.object({
8
+ /** An APPEND_SYSTEM.md exists in the agent directory (or the workspace's `.omp/`). */
9
+ appendSystemFile: z.boolean(),
10
+ /** A SYSTEM.md exists there: it replaces OMP's default instruction template. */
11
+ systemFile: z.boolean(),
12
+ /** Whether Paseo has an Append system prompt set. */
13
+ hostAppendPrompt: z.boolean(),
14
+ });
15
+ export type OmpPromptFiles = z.infer<typeof OmpPromptFilesSchema>;
16
+
17
+ export const getOmpPromptFiles = defineRpc({
18
+ name: "paseo-omp.get-prompt-files",
19
+ input: z.object({
20
+ store: OmpStoreSchema.optional(),
21
+ cwd: OmpWorkspaceCwdSchema.optional(),
22
+ }),
23
+ output: OmpPromptFilesSchema,
24
+ });