@acryldev/blends-frame 0.2.10 → 0.2.12

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.
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Sharing a plugin to npm from the frame: the same plan and the same service as the terminal (`plugin publish <name> --to npm`, plugins/plugin-share), with
3
+ * the person's own npm login. The frame's plan is a view of the service's plan; the confirm is checked against a plan made again, byte for byte (the digest).
4
+ */
5
+ import type { SharePlan } from './contract.ts';
6
+ import type { ShareAppPluginResult } from './app-plugins.ts';
7
+ /** The slice of the app's `pluginShare` service this uses. */
8
+ export interface NpmShareService {
9
+ planPublish(name: string, options: {
10
+ readonly to: 'npm';
11
+ readonly scope?: string;
12
+ }): Promise<NpmPlan | Refused>;
13
+ publish(name: string, confirmed: NpmPlan, options: {
14
+ readonly to: 'npm';
15
+ readonly scope?: string;
16
+ }): Promise<Published | Refused>;
17
+ }
18
+ export interface NpmPlan {
19
+ readonly target?: 'npm';
20
+ readonly package?: string;
21
+ readonly registry?: string;
22
+ readonly owner: string;
23
+ readonly repo: string;
24
+ readonly version: string;
25
+ readonly license: string;
26
+ readonly released?: string;
27
+ readonly digest: string;
28
+ }
29
+ interface Refused {
30
+ readonly ok: false;
31
+ readonly reason: string;
32
+ readonly next: string;
33
+ }
34
+ interface Published {
35
+ readonly ok: true;
36
+ readonly url: string;
37
+ readonly version: string;
38
+ }
39
+ /** The running app's service, read at each call; undefined when the app has none (an app made before plugin-share, or one that left the row out). */
40
+ export declare function npmShareOf(service: () => unknown): NpmShareService | undefined;
41
+ /** @throws with the service's reason when the plan is refused (not signed in to npm, a secret in the plugin, ...). */
42
+ export declare function planNpmShare(service: NpmShareService | undefined, name: string, scope?: string): Promise<SharePlan>;
43
+ /** Publish the plan the person confirmed: a plan made again must be the same, and then the service publishes it. @throws when it changed or was refused. */
44
+ export declare function shareNpm(service: NpmShareService | undefined, name: string, confirmed: SharePlan, scope?: string): Promise<ShareAppPluginResult>;
45
+ export {};
package/lib/registry.d.ts CHANGED
@@ -22,9 +22,13 @@ export interface RegistryMarks {
22
22
  readonly names: ReadonlySet<string>;
23
23
  /** `owner/repo` (lower case) of every plugin the app pulled. */
24
24
  readonly repos: ReadonlySet<string>;
25
+ /** `owner/repo` (lower case) to the version the app pulled it at: a newer one in the registry is an update. */
26
+ readonly pulled?: ReadonlyMap<string, string>;
25
27
  /** GitHub accounts that are the person's own (signed in, or the share account), lower case. */
26
28
  readonly accounts: ReadonlySet<string>;
27
29
  }
30
+ /** Whether dotted version `a` is newer than `b` (numbers, left to right; a pre-release suffix is ignored): `1.10.0` is newer than `1.9.0`. */
31
+ export declare function newerVersion(a: string, b: string): boolean;
28
32
  /** `owner/repo` of a `github:` source, lower case; undefined for any other source. */
29
33
  export declare function repoOfSource(source: string): string | undefined;
30
34
  /** The unpacked size of the native package an entry brings for this computer: its OS and CPU first, then its OS for any CPU (plugin-share/native.ts). */
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { type AppPluginKind, type AppPluginsView, type AppPluginView, type FramePluginView, type SavedPluginResult, type SavedPluginView, type ShareVisibility, type SharedPluginView, type SharePlan } from '../contract.ts';
7
7
  /** Where a share goes: a private repository (the team), a public one (everyone), or a public one the registry lists. */
8
- export type ShareTarget = ShareVisibility | 'registry';
8
+ export type ShareTarget = ShareVisibility | 'registry' | 'npm';
9
9
  /** Sharing a local plugin: first what it would do, then, on the person's yes, exactly that. */
10
10
  export interface PluginShare {
11
11
  /** `owner`: the GitHub account or organization to share to; absent means the person's own. */
@@ -21,6 +21,8 @@ export interface PluginActions {
21
21
  }
22
22
  /** The command another app runs to take a shared plugin, from its repository address and version. */
23
23
  export declare function pullCommand(shared: SharedPluginView): string | undefined;
24
+ /** Where a share went, in words: npm or GitHub. */
25
+ export declare const sharedOn: (shared: SharedPluginView) => string;
24
26
  /** What to send a colleague so they can add a shared plugin: the address the Registry tab's "Add by address" takes. */
25
27
  export declare function colleagueAddress(shared: SharedPluginView): string | undefined;
26
28
  /**
@@ -252,6 +252,12 @@ export interface SharePlan {
252
252
  readonly license?: string;
253
253
  /** The public registry (cordisplugins.github.io) lists it: the share sets the `cordis-plugin` topic. Only a public share can be listed. */
254
254
  readonly registry?: boolean;
255
+ /** npm, not GitHub: the package, the registry and the digest of the bytes that were planned. `owner` is the package's scope and `repo` the plugin's name. */
256
+ readonly npm?: {
257
+ readonly package: string;
258
+ readonly registry: string;
259
+ readonly digest: string;
260
+ };
255
261
  /** Where the registry lists it (category slugs of acrylblends.github.io/blends): the app's own store place, written as package.json keywords. */
256
262
  readonly placement?: {
257
263
  readonly category: string;
@@ -415,6 +421,8 @@ export interface RegistryEntryView {
415
421
  readonly installed: boolean;
416
422
  /** The account the person is signed in to GitHub with (or shares to) released it. */
417
423
  readonly mine: boolean;
424
+ /** The version the app pulled it at, when the registry lists a newer one: the row offers the update. */
425
+ readonly updateFrom?: string;
418
426
  /** Bytes it downloads besides itself for this computer (a native package, plugin-share/native.ts), when the index says. */
419
427
  readonly download?: number;
420
428
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/blends-frame",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "ACRYL Blends frame: the workbench around an app being built - a top bar, the branches and versions on the left, the app alone in the centre, and the agents on the right - as one Cordis plugin with a Host and a client half",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -54,7 +54,7 @@
54
54
  "dependencies": {
55
55
  "@acryldev/app-persistence": "^0.1.6",
56
56
  "@acryldev/app-shell": "0.2.1",
57
- "@acryldev/blends-core": "^0.6.0",
57
+ "@acryldev/blends-core": "^0.6.1",
58
58
  "@acryldev/loopback-http": "0.2.1",
59
59
  "@acryldev/plugin-hub-core": "^0.2.3",
60
60
  "@acryldev/versions": "0.2.0",
@@ -71,7 +71,7 @@
71
71
  "react-dom": "18.3.1"
72
72
  },
73
73
  "devDependencies": {
74
- "@acryldev/blends": "1.7.13",
74
+ "@acryldev/blends": "1.7.20",
75
75
  "@acryldev/ui": "0.4.0",
76
76
  "@deepseek-ai/cordis": "4.0.4",
77
77
  "@deepseek-ai/cordis-plugin-loader": "1.0.5",