Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .agents/pm/history/pm-github-zjxx.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"ts":"2026-07-26T06:18:58.086Z","author":"codex","author_source":"configured","agent_harness":"claude-code","op":"create","patch":[{"op":"add","path":"/metadata/id","value":"pm-github-zjxx"},{"op":"add","path":"/metadata/title","value":"Adopt pm-cli 2026.7.26 typed authoring contracts and remove the any-cast defineExtension shim"},{"op":"add","path":"/metadata/description","value":"Replace the forced-any defineExtension shim with a locally declared identity helper constrained by the SDK ExtensionModule contract, and type activate with the real ExtensionApi. Keeps the package's dependency on @unbrained/pm-cli type-only so no runtime module edge is introduced."},{"op":"add","path":"/metadata/type","value":"Task"},{"op":"add","path":"/metadata/status","value":"open"},{"op":"add","path":"/metadata/priority","value":2},{"op":"add","path":"/metadata/tags","value":[]},{"op":"add","path":"/metadata/created_at","value":"2026-07-26T06:18:58.086Z"},{"op":"add","path":"/metadata/updated_at","value":"2026-07-26T06:18:58.086Z"},{"op":"add","path":"/metadata/author","value":"codex"},{"op":"add","path":"/metadata/acceptance_criteria","value":"No any casts remain in the extension definition path; activate is typed with the real ExtensionApi; Dependency on @unbrained/pm-cli stays type-only at runtime; typecheck and the full test suite pass"}],"before_hash":"3cc22dff72be7b14824654a7a64ea62b04799939b2fee54c1b5f52ca60bf6df0","after_hash":"145ff478899448b2d2209646e9a759d5c28a93d83d6f00465b8924dfe7500ec8","message":""}
{"ts":"2026-07-26T06:18:58.580Z","author":"codex","author_source":"configured","agent_harness":"claude-code","op":"update","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-07-26T06:18:58.580Z"},{"op":"replace","path":"/metadata/status","value":"in_progress"}],"before_hash":"145ff478899448b2d2209646e9a759d5c28a93d83d6f00465b8924dfe7500ec8","after_hash":"9ba9c77e784e1a5c86f263207905455114cad0045f196768dc437af73b5ef3a9"}
{"ts":"2026-07-26T06:24:29.387Z","author":"codex","author_source":"configured","agent_harness":"claude-code","op":"close","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-07-26T06:24:29.387Z"},{"op":"replace","path":"/metadata/status","value":"closed"},{"op":"add","path":"/metadata/closed_at","value":"2026-07-26T06:24:29.387Z"},{"op":"add","path":"/metadata/resolution","value":"Replaced the forced-any defineExtension shim with a locally declared identity helper constrained by the SDK ExtensionModule contract, and typed activate with the real ExtensionApi from @unbrained/pm-cli/sdk/authoring."},{"op":"add","path":"/metadata/expected_result","value":"No any casts in the extension definition path, activate checked against the host contract, and the dependency on @unbrained/pm-cli kept type-only so no runtime module edge is added."},{"op":"add","path":"/metadata/actual_result","value":"typecheck clean and the full test suite passes; type imports erase at build time so the published extension carries no runtime edge to the CLI."},{"op":"add","path":"/metadata/close_reason","value":"Implemented and verified in PR #17"}],"before_hash":"9ba9c77e784e1a5c86f263207905455114cad0045f196768dc437af73b5ef3a9","after_hash":"46504d505d355bb64d26b3b4df2fa9f331bf7e73db2e7368310d89659ea32e18"}
17 changes: 17 additions & 0 deletions .agents/pm/tasks/pm-github-zjxx.toon
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
id: pm-github-zjxx
title: Adopt pm-cli 2026.7.26 typed authoring contracts and remove the any-cast defineExtension shim
description: "Replace the forced-any defineExtension shim with a locally declared identity helper constrained by the SDK ExtensionModule contract, and type activate with the real ExtensionApi. Keeps the package's dependency on @unbrained/pm-cli type-only so no runtime module edge is introduced."
type: Task
status: closed
priority: 2
tags: []
created_at: "2026-07-26T06:18:58.086Z"
updated_at: "2026-07-26T06:24:29.387Z"
closed_at: "2026-07-26T06:24:29.387Z"
author: codex
acceptance_criteria: No any casts remain in the extension definition path; activate is typed with the real ExtensionApi; Dependency on @unbrained/pm-cli stays type-only at runtime; typecheck and the full test suite pass
resolution: "Replaced the forced-any defineExtension shim with a locally declared identity helper constrained by the SDK ExtensionModule contract, and typed activate with the real ExtensionApi from @unbrained/pm-cli/sdk/authoring."
expected_result: "No any casts in the extension definition path, activate checked against the host contract, and the dependency on @unbrained/pm-cli kept type-only so no runtime module edge is added."
actual_result: typecheck clean and the full test suite passes; type imports erase at build time so the published extension carries no runtime edge to the CLI.
close_reason: Implemented and verified in PR #17
body: ""
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Removed

- Adopt pm-cli 2026.7.26 typed authoring contracts and remove the any-cast defineExtension shim ([pm-github-zjxx](https://github.com/unbraind/pm-github/blob/main/.agents/pm/tasks/pm-github-zjxx.toon))

## 2026.7.26 - 2026-07-26

### Fixed
Expand Down
15 changes: 12 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
// Issues use the REST API; Projects v2 is GraphQL-only (see the Projects v2
// section below and the pure plan/mapping logic in ./projects.ts).

import type { ExtensionApi, ExtensionModule } from "@unbrained/pm-cli/sdk/authoring";
import https from "node:https";
import crypto from "node:crypto";
import fs from "node:fs";
import path from "node:path";
import { spawnSync } from "node:child_process";

import type { defineExtension as defineExtensionType } from "@unbrained/pm-cli/sdk";
import type {
BulkItemMutation,
CommitItemMutationsOptions,
Expand Down Expand Up @@ -63,7 +63,6 @@ import {
projectItemTag,
} from "./projects.js";

const defineExtension: typeof defineExtensionType = ((extension: any) => extension) as any;

// ---------------------------------------------------------------------------
// Types
Expand Down Expand Up @@ -3797,11 +3796,21 @@ const PROJECT_SYNC_FLAGS = [
{ long: "--dry-run", description: "Preview only (always wins over --apply)" },
];

/**
* Local stand-in for the SDK's `defineExtension` identity helper.
*
* Declared here rather than imported so this package keeps a type-only
* dependency on `@unbrained/pm-cli` and adds no runtime module edge. The
* generic constraint is the SDK's own, so the extension object is contract-
* checked against {@link ExtensionModule} exactly as the imported helper would.
*/
const defineExtension = <TModule extends ExtensionModule>(module: TModule): TModule => module;

export default defineExtension({
name: "pm-github",
version: "2026.7.26",

activate(api: any) {
activate(api: ExtensionApi) {
// -----------------------------------------------------------------------
// schema — declare the GitHub provenance fields so the workspace knows them
// -----------------------------------------------------------------------
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
"merge:install": "pm merge install"
},
"peerDependencies": {
"@unbrained/pm-cli": ">=2026.7.20"
"@unbrained/pm-cli": ">=2026.7.26"
},
"devDependencies": {
"@types/node": "^26.1.1",
"@unbrained/pm-cli": "^2026.7.25",
"pm-changelog": "^2026.7.24",
"@unbrained/pm-cli": "^2026.7.26",
"pm-changelog": "^2026.7.25",
"typescript": "^7.0.2"
},
"keywords": [
Expand Down