@compforge/harness-common 0.5.5 → 0.5.7

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.
Files changed (39) hide show
  1. package/README.md +7 -0
  2. package/dist/{context.d.ts → access/context.d.ts} +1 -1
  3. package/dist/{datasource.d.ts → access/datasource.d.ts} +1 -1
  4. package/dist/execution.d.ts +1 -1
  5. package/dist/index.d.ts +17 -16
  6. package/dist/index.js +16 -15
  7. package/dist/system/pull-request.d.ts +27 -0
  8. package/dist/system/pull-request.js +5 -0
  9. package/dist/{repository.d.ts → system/repository.d.ts} +1 -1
  10. package/package.json +1 -1
  11. /package/dist/{client-manager.d.ts → access/client-manager.d.ts} +0 -0
  12. /package/dist/{client-manager.js → access/client-manager.js} +0 -0
  13. /package/dist/{client-provider.d.ts → access/client-provider.d.ts} +0 -0
  14. /package/dist/{client-provider.js → access/client-provider.js} +0 -0
  15. /package/dist/{client.d.ts → access/client.d.ts} +0 -0
  16. /package/dist/{client.js → access/client.js} +0 -0
  17. /package/dist/{context.js → access/context.js} +0 -0
  18. /package/dist/{datasource.js → access/datasource.js} +0 -0
  19. /package/dist/{file.d.ts → access/file.d.ts} +0 -0
  20. /package/dist/{file.js → access/file.js} +0 -0
  21. /package/dist/{component.d.ts → system/component.d.ts} +0 -0
  22. /package/dist/{component.js → system/component.js} +0 -0
  23. /package/dist/{environment.d.ts → system/environment.d.ts} +0 -0
  24. /package/dist/{environment.js → system/environment.js} +0 -0
  25. /package/dist/{forge.d.ts → system/forge.d.ts} +0 -0
  26. /package/dist/{forge.js → system/forge.js} +0 -0
  27. /package/dist/{host.d.ts → system/host.d.ts} +0 -0
  28. /package/dist/{host.js → system/host.js} +0 -0
  29. /package/dist/{knowledge.d.ts → system/knowledge.d.ts} +0 -0
  30. /package/dist/{knowledge.js → system/knowledge.js} +0 -0
  31. /package/dist/{product.d.ts → system/product.d.ts} +0 -0
  32. /package/dist/{product.js → system/product.js} +0 -0
  33. /package/dist/{repository.js → system/repository.js} +0 -0
  34. /package/dist/{resource.d.ts → system/resource.d.ts} +0 -0
  35. /package/dist/{resource.js → system/resource.js} +0 -0
  36. /package/dist/{service.d.ts → system/service.d.ts} +0 -0
  37. /package/dist/{service.js → system/service.js} +0 -0
  38. /package/dist/{workload.d.ts → system/workload.d.ts} +0 -0
  39. /package/dist/{workload.js → system/workload.js} +0 -0
package/README.md CHANGED
@@ -183,3 +183,10 @@ custom Entry now renders consistently when shown alone or through its Dictionary
183
183
  relationships without duplicating identity. `ResourceSnapshot` retains typed instances, unit-bearing
184
184
  measurements, independently known totals and complete/partial/unavailable coverage. Discovery and
185
185
  rendering remain consumer-owned. See [the shared contract](../../../docs/resource.md).
186
+
187
+ ## PullRequest
188
+
189
+ `PullRequest` identifies a PR/MR by its target `Repository` and repository-local number.
190
+ State, branches, source repository, revisions and provider timestamps are optional facts.
191
+ See [the shared contract](../../../docs/pull-request.md) for identity and unknown-state semantics.
192
+ Forge access and polling remain consumer/toolkit responsibilities.
@@ -1,5 +1,5 @@
1
1
  import type { ClientManager } from "./client-manager.js";
2
- import type { Environment } from "./environment.js";
2
+ import type { Environment } from "../system/environment.js";
3
3
  /**
4
4
  * Execution-scoped environment access, independent of fixture orchestration.
5
5
  * @rule Borrows clients; does not initialize or dispose resources.
@@ -1,6 +1,6 @@
1
1
  import type { Client } from "./client.js";
2
2
  import type { ClientProvider } from "./client-provider.js";
3
- import type { Service } from "./service.js";
3
+ import type { Service } from "../system/service.js";
4
4
  /** A source of data; accessible environments implement ClientProvider directly. */
5
5
  export interface DataSource<C extends Client> extends ClientProvider<C> {
6
6
  /** Safe descriptive metadata for discovery; never credentials or part of clientKey. */
@@ -1,4 +1,4 @@
1
- import type { Service } from "./service.js";
1
+ import type { Service } from "./system/service.js";
2
2
  /** Stable capability identity, independent of access configuration. */
3
3
  export interface Operation {
4
4
  readonly name: string;
package/dist/index.d.ts CHANGED
@@ -1,18 +1,19 @@
1
- export * from "./client.js";
2
- export * from "./client-provider.js";
3
- export * from "./context.js";
4
- export { ClientManager } from "./client-manager.js";
5
- export * from "./datasource.js";
6
- export * from "./workload.js";
7
- export * from "./forge.js";
8
- export * from "./repository.js";
9
- export * from "./component.js";
10
- export * from "./host.js";
11
- export * from "./environment.js";
12
- export * from "./service.js";
1
+ export * from "./access/client.js";
2
+ export * from "./access/client-provider.js";
3
+ export * from "./access/context.js";
4
+ export { ClientManager } from "./access/client-manager.js";
5
+ export * from "./access/datasource.js";
6
+ export * from "./system/workload.js";
7
+ export * from "./system/forge.js";
8
+ export * from "./system/repository.js";
9
+ export * from "./system/pull-request.js";
10
+ export * from "./system/component.js";
11
+ export * from "./system/host.js";
12
+ export * from "./system/environment.js";
13
+ export * from "./system/service.js";
13
14
  export * from "./execution.js";
14
- export type { Product } from "./product.js";
15
- export * from "./knowledge.js";
15
+ export type { Product } from "./system/product.js";
16
+ export * from "./system/knowledge.js";
16
17
  export type { Identity } from "./identity.js";
17
- export * from "./file.js";
18
- export * from "./resource.js";
18
+ export * from "./access/file.js";
19
+ export * from "./system/resource.js";
package/dist/index.js CHANGED
@@ -1,16 +1,17 @@
1
- export * from "./client.js";
2
- export * from "./client-provider.js";
3
- export * from "./context.js";
4
- export { ClientManager } from "./client-manager.js";
5
- export * from "./datasource.js";
6
- export * from "./workload.js";
7
- export * from "./forge.js";
8
- export * from "./repository.js";
9
- export * from "./component.js";
10
- export * from "./host.js";
11
- export * from "./environment.js";
12
- export * from "./service.js";
1
+ export * from "./access/client.js";
2
+ export * from "./access/client-provider.js";
3
+ export * from "./access/context.js";
4
+ export { ClientManager } from "./access/client-manager.js";
5
+ export * from "./access/datasource.js";
6
+ export * from "./system/workload.js";
7
+ export * from "./system/forge.js";
8
+ export * from "./system/repository.js";
9
+ export * from "./system/pull-request.js";
10
+ export * from "./system/component.js";
11
+ export * from "./system/host.js";
12
+ export * from "./system/environment.js";
13
+ export * from "./system/service.js";
13
14
  export * from "./execution.js";
14
- export * from "./knowledge.js";
15
- export * from "./file.js";
16
- export * from "./resource.js";
15
+ export * from "./system/knowledge.js";
16
+ export * from "./access/file.js";
17
+ export * from "./system/resource.js";
@@ -0,0 +1,27 @@
1
+ import type { Identity } from "../identity.js";
2
+ import { type Repository } from "./repository.js";
3
+ export type PullRequestState = "open" | "merged" | "closed";
4
+ /**
5
+ * A code-review proposal owned by its target Repository (GitHub PR or GitLab MR).
6
+ * @spec Identity is target Repository + repository-local number; source, revisions and state are metadata.
7
+ * @spec Omitted facts are unknown. A missing state or mergedAt never proves closure or merge.
8
+ * @see {@link component://docs/pull-request.md}
9
+ */
10
+ export interface PullRequest extends Identity {
11
+ readonly repository: Repository;
12
+ /** Positive GitHub PR number or GitLab MR iid, not the provider's global database ID. */
13
+ readonly number: number;
14
+ readonly title?: string;
15
+ readonly url?: string;
16
+ readonly state?: PullRequestState;
17
+ readonly sourceRepository?: Repository;
18
+ readonly sourceBranch?: string;
19
+ readonly targetBranch?: string;
20
+ readonly headSha?: string;
21
+ readonly baseSha?: string;
22
+ /** Provider timestamps, represented as ISO 8601 strings. */
23
+ readonly updatedAt?: string;
24
+ readonly mergedAt?: string;
25
+ }
26
+ /** Derive identity from fields; never trust a consumer's display URL or repository id method. */
27
+ export declare function pullRequestId(pr: Pick<PullRequest, "repository" | "number">): string;
@@ -0,0 +1,5 @@
1
+ import { repositoryId } from "./repository.js";
2
+ /** Derive identity from fields; never trust a consumer's display URL or repository id method. */
3
+ export function pullRequestId(pr) {
4
+ return `${repositoryId(pr.repository)}#${pr.number}`;
5
+ }
@@ -1,5 +1,5 @@
1
1
  import type { Forge } from "./forge.js";
2
- import type { Identity } from "./identity.js";
2
+ import type { Identity } from "../identity.js";
3
3
  /**
4
4
  * A repository identified by its Forge and path within that Forge.
5
5
  * @spec forkedFrom is the direct parent path within the same Forge instance, not repository identity.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compforge/harness-common",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Execution-neutral client lifecycle and datasource contracts for harnesses",
5
5
  "type": "module",
6
6
  "scripts": {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes