net-snmp 3.26.2 → 3.26.3

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,111 @@
1
+ ---
2
+ name: propose-action
3
+ description: Review a GitHub issue or PR by number and propose a concrete action plan — either a reasoned recommendation not to action it, or the code and test changes required to action it. Use when the user asks to "propose an action" for an issue/PR, "look at issue/PR #N", or invokes /propose-action with an issue or PR number. Ends by asking whether to proceed, proceed with modifications, or abandon.
4
+ ---
5
+
6
+ # Propose Action
7
+
8
+ ## When to use
9
+
10
+ - The user asks to review a GitHub issue or PR and recommend what to do about it.
11
+ - The user invokes `/propose-action <number>`.
12
+
13
+ This skill **plans only** for steps 1–5 — it does not edit code, run tests, commit, push, or comment on the issue/PR during the proposal phase. Implementation happens after the user approves the plan in step 5's closing question. Once the user has approved and you have carried out the agreed actions, step 6 produces a ready-to-paste reply to the issue/PR aligned with what was actually done — but never posts it.
14
+
15
+ ## Arguments
16
+
17
+ - `<number>` (required) — the GitHub issue or PR number. Bare integer, or `#N`, or a full GitHub URL are all acceptable forms.
18
+
19
+ If the number is missing, ambiguous, or does not resolve to an issue/PR in the current repository, stop and ask the user to clarify.
20
+
21
+ ## Workflow
22
+
23
+ ### 1. Identify the target
24
+
25
+ - Determine the current repository: `gh repo view --json nameWithOwner -q .nameWithOwner`.
26
+ - Resolve the number to either an issue or a PR. GitHub numbers them in the same namespace, so try PR first, then issue:
27
+ - `gh pr view <number> --json number,title,state,author,body,headRefName,baseRefName,isDraft,mergeable,additions,deletions,changedFiles,labels,comments,reviews`
28
+ - If that fails, `gh issue view <number> --json number,title,state,author,body,labels,comments,assignees`
29
+ - Record whether the target is an **issue** or a **PR** — the two branches below differ.
30
+
31
+ ### 2a. If the target is an issue
32
+
33
+ Gather context in parallel:
34
+ - The issue body and all comments (from the `gh issue view` JSON above).
35
+ - `gh issue view <number> --json linkedPullRequests` — check for linked PRs that may already address it.
36
+ - Identify the files or subsystems the issue points at. Search the repo (`Grep`, `Glob`, `Read`) for the relevant code. Do not guess — read the actual files the issue describes.
37
+ - If the issue references specific OIDs, error messages, function names, or SNMP behaviours, locate them in the source.
38
+
39
+ ### 2b. If the target is a PR
40
+
41
+ Gather context in parallel:
42
+ - PR body, comments, and reviews (from the `gh pr view` JSON above).
43
+ - `gh pr diff <number>` — the full diff.
44
+ - `gh pr view <number> --json files -q '.files[].path'` — changed files.
45
+ - Read the **current** version of each changed file on the base branch so you understand what the PR is replacing, not just what it adds.
46
+ - If the PR closes or references an issue (via `Fixes #N`, `Closes #N`, etc.), also fetch that issue for context.
47
+ - Check CI status if available: `gh pr checks <number>`.
48
+
49
+ ### 3. Form a judgement
50
+
51
+ Decide which of these recommendations fits, and be willing to recommend **against** actioning:
52
+
53
+ - **Do not action** — the issue is invalid, already fixed, out of scope, based on a misunderstanding, a duplicate, or the PR is the wrong approach / would regress behaviour / conflicts with project direction. Explain *why* clearly, citing the code or prior commits that support the conclusion.
54
+ - **Action as-is** — the issue is valid and the fix is clear, or the PR is correct and should be merged as submitted.
55
+ - **Action with modifications** — the issue is valid but the obvious fix is wrong; or the PR has the right idea but needs specific changes before it can be merged.
56
+ - **Needs more information** — the report is plausible but underspecified. List the exact questions to ask the reporter / author before any code change is possible.
57
+
58
+ Base the judgement on what the code actually does today, not on what the issue/PR claims. If the two disagree, surface the disagreement.
59
+
60
+ ### 4. Draft the proposal
61
+
62
+ Structure the written proposal in this order. Keep it concrete — name files, line numbers, function names, and the specific behaviours being changed.
63
+
64
+ 1. **Target** — `Issue #N: <title>` or `PR #N: <title>`, plus one sentence on its state (open/closed/draft/merged, CI status for PRs).
65
+ 2. **Summary of the report** — one short paragraph in your own words describing what the reporter is asking for or proposing. Do not just quote the body.
66
+ 3. **Findings** — what the code currently does, whether the report is accurate, and any related context (linked issues/PRs, prior commits, existing tests covering this area). Cite `file:line` locations.
67
+ 4. **Recommendation** — one of the four options from step 3, stated plainly in a sentence or two.
68
+ 5. **Proposed changes** (omit if the recommendation is *do not action* or *needs more information*):
69
+ - **Code** — for each file to change, list the edit as a bullet: `path/to/file.js:<line-range> — <what changes and why>`. For non-trivial edits, include a short before/after sketch (a few lines, not a full diff).
70
+ - **Tests** — list tests to **add**, **modify**, or **delete**, each with the file and a one-line description of what the test asserts. If no test changes are needed, say so explicitly and justify (e.g. "covered by existing test at `test/x.test.js:42`").
71
+ - **Docs / README** — note any README or inline-doc updates required. Release-note bullets are handled by `/prepare-release`; do not pre-empt them here.
72
+ 6. **Risks and unknowns** — anything that could make the plan wrong: behaviours you could not verify, edge cases the tests would not catch, compatibility concerns, or assumptions about the reporter's environment.
73
+ 7. **Out of scope** — closely-related issues you noticed while investigating but are **not** proposing to fix in this action. Keeps the scope honest.
74
+
75
+ ### 5. Closing question
76
+
77
+ End the response with exactly one question, offering three choices:
78
+
79
+ > Proceed with this plan as-is, proceed with modifications (tell me what to change), or abandon it?
80
+
81
+ Do not start implementing until the user answers. If the user says "proceed", begin implementing the plan in the next turn. If the user asks for modifications, revise the proposal and ask the same question again. If the user says to abandon, stop and skip step 6.
82
+
83
+ ### 6. Ready-to-paste issue/PR reply
84
+
85
+ After the agreed actions have been carried out (code edits, tests, docs, or a reasoned decision not to action), produce a single ready-to-paste reply for the issue/PR. This is the **last** thing you output, rendered in a fenced block or delimited by `---` so the user can copy it cleanly.
86
+
87
+ The reply must be aligned with **what actually happened**, not with the original plan — if the user asked for modifications during implementation, reflect the modified outcome. If a step was skipped or failed, say so honestly; do not describe work that was not done.
88
+
89
+ Tailor the content to the recommendation from step 3:
90
+
91
+ - **Action as-is / with modifications** — acknowledge the report, give the user a short, concrete summary of the fix (with the key code change or snippet inline if it helps them adopt it), point at the files/sections that changed (e.g. "updated in `README.md` under *Scalar providers*"), and note when it will ship (e.g. "will land in the next release" — do not invent a version number unless `package.json` has already been bumped). If there's a workaround the reporter can apply before the release, include it.
92
+ - **Do not action** — explain the reasoning in the reporter's terms, citing the code or prior history that supports the decision. Be respectful: the reporter put effort into the report. Offer an alternative path if one exists (a different API, a related issue, a config change). If the issue should be closed, say so; do not close it yourself.
93
+ - **Needs more information** — list the specific questions you need answered, each as its own bullet. Explain briefly *why* each is needed so the reporter can see what would unblock progress.
94
+
95
+ Style:
96
+
97
+ - Match the tone of prior replies in this repository if they are visible in the issue/PR thread — don't suddenly adopt a different register.
98
+ - Write as the maintainer would: first person, conversational, no corporate voice, no marketing copy, no emoji unless the repo's existing replies use them.
99
+ - Do not include a signature, do not add attribution trailers (no "generated by", no `Co-Authored-By`), do not tag the reporter more than once.
100
+ - Keep it focused — one screen of text is almost always enough. If the reply needs code blocks, prefer short, complete snippets over long diffs.
101
+
102
+ Hand the reply to the user with one sentence above it saying where to paste it (e.g. "Ready-to-paste reply for issue #297:"). Do **not** run `gh issue comment` / `gh pr comment` / `gh issue close` / `gh pr merge` — the user posts it.
103
+
104
+ ## Rules
105
+
106
+ - **Never** edit files, run tests, or modify git state during steps 1–5. Planning only.
107
+ - **Never** post a comment on the issue/PR, add labels, request reviews, merge, or close — not in step 6, not ever within this skill. Those are the user's decision.
108
+ - **Never** fabricate line numbers or function names — if you cite `file:line`, you must have read it.
109
+ - If `gh` is not authenticated or the number does not exist, stop and report the error verbatim.
110
+ - If the issue/PR is in a different repository than the current working directory, stop and confirm with the user before proceeding — the plan would target the wrong codebase.
111
+ - Keep the proposal focused. A plan that touches ten files for a one-line bug is a signal to re-read the issue, not to write a bigger plan.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: publish-release
3
+ description: Publish the currently-committed release by pushing master to origin, publishing to npm, tagging the commit with the package.json version, and pushing the tag. Use when the user asks to "publish the release", "push and publish", or invokes /publish-release. Stops immediately on any failure.
4
+ ---
5
+
6
+ # Publish Release
7
+
8
+ ## When to use
9
+
10
+ - After `/prepare-release` and the release commit have both been completed — this skill assumes the release commit (version bump + README entry + fix) is already `HEAD` on `master`.
11
+ - User asks to publish / ship / release to npm.
12
+ - User invokes `/publish-release`.
13
+
14
+ Run after `/prepare-release` + `/git-commit`, never in place of them. This skill does not run lint, tests, or modify any files.
15
+
16
+ ## Workflow
17
+
18
+ Run steps in order. **If any step fails, stop immediately, report the failure, and do not proceed.** There is no rollback — each step is externally observable (a push, a publish, a tag on origin), so a mid-flight failure leaves the release in a partial state the user will need to reason about. Be explicit about which steps succeeded and which did not.
19
+
20
+ ### 1. Pre-flight checks (parallel)
21
+
22
+ - `git rev-parse --abbrev-ref HEAD` — confirm the current branch is `master`. If not, stop and ask the user.
23
+ - `git status --short` — confirm the working tree is clean. If not, stop — the release commit must already exist as `HEAD`, with nothing else pending.
24
+ - Read the current version from `package.json` (this becomes the tag name).
25
+ - `git tag --list <version>` — confirm the tag does not already exist locally. If it does, stop.
26
+ - `git ls-remote --tags origin refs/tags/<version>` — confirm the tag does not already exist on the remote. If it does, stop.
27
+ - `git log -1 --format=%s` — capture the subject of the HEAD commit for the summary.
28
+
29
+ ### 2. Push master to origin
30
+
31
+ Run `git push origin master`. **Stop on non-zero exit.** Report the output.
32
+
33
+ ### 3. Publish to npm
34
+
35
+ Run `npm publish`. **Stop on non-zero exit.**
36
+
37
+ Notes:
38
+ - If the registry prompts for a one-time password (2FA OTP), relay the prompt to the user and wait for their input. Do not attempt to bypass 2FA.
39
+ - If the registry rejects with `403` or `You do not have permission`, stop and surface the full error — the user may need to `npm login` or check their credentials.
40
+ - If the registry rejects with `You cannot publish over the previously published versions`, stop — the version was not bumped correctly upstream of this skill.
41
+
42
+ ### 4. Tag the release
43
+
44
+ Tags in this repo are bare version numbers (no `v` prefix) — verified against the existing tag list.
45
+
46
+ Run `git tag <version>` where `<version>` is the exact value read from `package.json` in step 1 (e.g., `3.26.2`, not `v3.26.2`).
47
+
48
+ **Stop on non-zero exit.**
49
+
50
+ ### 5. Push the tag
51
+
52
+ Run `git push origin <version>`. **Stop on non-zero exit.**
53
+
54
+ ### 6. Summary
55
+
56
+ Report to the user, concisely:
57
+ - The version that was published.
58
+ - Confirmation of: master pushed, npm publish succeeded, tag created, tag pushed.
59
+ - The release commit subject (from pre-flight).
60
+ - The npm package URL, if it can be derived from `package.json` name (`https://www.npmjs.com/package/<name>`).
61
+
62
+ ## Things to watch for
63
+
64
+ - If step 2 (push master) succeeds but step 3 (npm publish) fails, the commit is on GitHub but not on npm. Do not tag — the user must either resolve the npm issue and re-run publish, or roll back the push.
65
+ - If step 3 (npm publish) succeeds but step 4 (tag) or step 5 (tag push) fails, the package is on npm but not tagged. Surface this clearly — the user needs to manually create / push the tag, and an un-tagged published release is a fix-it-now situation, not something to leave for later.
66
+ - Never use `--force`, `--no-verify`, or any flag that bypasses checks, even to recover from a mid-flight failure. Always ask the user.
67
+ - Never create or push tags for versions other than the one in `package.json`.
68
+ - Never run this skill on a branch other than `master` without explicit user confirmation.
package/README.md CHANGED
@@ -1950,7 +1950,12 @@ var myScalarProvider = {
1950
1950
  scalarType: snmp.ObjectType.OctetString,
1951
1951
  maxAccess: snmp.MaxAccess["read-write"],
1952
1952
  handler: function (mibRequest) {
1953
- // e.g. can update the MIB data before responding to the request here
1953
+ // For a dynamically-calculated read-only scalar, publish the current value
1954
+ // by assigning to the instance node before calling done(). For read-write scalars,
1955
+ // the agent has already cast and validated mibRequest.setValue by the
1956
+ // time the handler runs, and will commit it on your behalf — the handler
1957
+ // usually just needs to call done().
1958
+ mibRequest.instanceNode.value = yourFunctionToComputeCurrentValue ();
1954
1959
  mibRequest.done ();
1955
1960
  }
1956
1961
  // Note: handler is optional for scalar providers - if omitted,
@@ -2174,6 +2179,29 @@ objects`, below, for details.
2174
2179
  with the instance OID being operated on, and an `operation` field with the request type from
2175
2180
  `snmp.PduType`. If the `MibRequest` is for a `SetRequest` PDU, then variables `setValue` and
2176
2181
  `setType` contain the value and type received in the `SetRequest` varbind.
2182
+
2183
+ How the handler should interact with the MIB value depends on the request type:
2184
+
2185
+ * For `GetRequest`, `GetNextRequest` and `GetBulkRequest`, the response varbind is taken
2186
+ from `mibRequest.instanceNode.value` at the moment `done()` is called. A handler that
2187
+ serves a dynamically-computed read-only scalar (e.g. `sysUpTime`) should therefore
2188
+ assign the current value to `mibRequest.instanceNode.value` before calling `done()`.
2189
+ Equivalent and validated alternative: call `mib.setScalarValue(providerName, value)`
2190
+ from the handler, which casts and constraint-checks the value before storing it.
2191
+ For table columns the pattern is the same — assign to `mibRequest.instanceNode.value`.
2192
+ * For `SetRequest`, the agent has already cast and validated the incoming value into
2193
+ `mibRequest.setValue` before the handler runs, and will commit it to
2194
+ `mibRequest.instanceNode.value` on your behalf during the commit pass. A handler
2195
+ typically only needs to call `done()` (or `done({errorStatus: ...})` to reject the set).
2196
+ You generally don't need to assign to `instanceNode.value` yourself on the set path.
2197
+
2198
+ If you do need to validate an externally-supplied value inside a handler, three helpers
2199
+ are exposed on the public API: `ObjectTypeUtil.castSetValue(type, value, constraints)`
2200
+ casts and range/constraint-checks a value (throwing on bad input);
2201
+ `MibNode#validateValue(type, value)` returns a boolean against the node's provider
2202
+ constraints; and `MibNode#getConstraintsFromProvider()` returns the constraints object
2203
+ for the current instance node.
2204
+
2177
2205
  * `constraints` *(optional for scalar types)* - an optional object to specify constraints for
2178
2206
  integer-based enumerated types, integer range restrictions and string size restrictions. Note that
2179
2207
  table columns can specify such `constraints` in an identical way, except that these are stored under
@@ -3723,6 +3751,10 @@ Example programs are included under the module's `example` directory.
3723
3751
 
3724
3752
  * Fix TypeError in oidInSubtree when varbind OID is null
3725
3753
 
3754
+ # Version 3.26.3 - 21/04/2026
3755
+
3756
+ * Document how MIB scalar and table handlers should interact with `mibRequest.instanceNode.value` for Get vs Set operations
3757
+
3726
3758
  # License
3727
3759
 
3728
3760
  Copyright (c) 2020 Mark Abrahams <mark@abrahams.co.nz>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "net-snmp",
3
- "version": "3.26.2",
3
+ "version": "3.26.3",
4
4
  "description": "JavaScript implementation of the Simple Network Management Protocol (SNMP)",
5
5
  "author": "Mark Abrahams <mark@abrahams.co.nz>",
6
6
  "license": "MIT",