unique-sdk 2026.48.0.dev13__tar.gz → 2026.48.0.dev15__tar.gz

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 (92) hide show
  1. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/PKG-INFO +1 -1
  2. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/pyproject.toml +1 -1
  3. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_agentic_table.py +65 -1
  4. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/cli.py +43 -2
  5. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/agentic_table_write.py +85 -0
  6. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/formatting.py +30 -2
  7. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/skills/unique-cli-agentic-table/SKILL.md +71 -10
  8. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/README.md +0 -0
  9. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/__init__.py +0 -0
  10. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_api_requestor.py +0 -0
  11. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_api_resource.py +0 -0
  12. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_api_version.py +0 -0
  13. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_error.py +0 -0
  14. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_http_client.py +0 -0
  15. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_list_object.py +0 -0
  16. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_object_classes.py +0 -0
  17. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_request_options.py +0 -0
  18. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_unique_object.py +0 -0
  19. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_unique_ql.py +0 -0
  20. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_unique_response.py +0 -0
  21. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_util.py +0 -0
  22. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_version.py +0 -0
  23. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/_webhook.py +0 -0
  24. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/__init__.py +0 -0
  25. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_acronyms.py +0 -0
  26. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_analytics_order.py +0 -0
  27. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_benchmarking.py +0 -0
  28. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_briefing.py +0 -0
  29. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_chat_completion.py +0 -0
  30. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_content.py +0 -0
  31. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_context_memory.py +0 -0
  32. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_elicitation.py +0 -0
  33. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_embedding.py +0 -0
  34. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_event.py +0 -0
  35. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_folder.py +0 -0
  36. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_group.py +0 -0
  37. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_integrated.py +0 -0
  38. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_llm_models.py +0 -0
  39. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_mcp.py +0 -0
  40. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_message.py +0 -0
  41. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_message_assessment.py +0 -0
  42. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_message_execution.py +0 -0
  43. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_message_log.py +0 -0
  44. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_message_tool.py +0 -0
  45. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_module.py +0 -0
  46. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_scheduled_task.py +0 -0
  47. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_search.py +0 -0
  48. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_search_string.py +0 -0
  49. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_short_term_memory.py +0 -0
  50. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_space.py +0 -0
  51. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_user.py +0 -0
  52. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/api_resources/_web_search.py +0 -0
  53. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/__init__.py +0 -0
  54. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/__main__.py +0 -0
  55. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/__init__.py +0 -0
  56. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/_citation_manifest.py +0 -0
  57. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/agentic_table.py +0 -0
  58. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/browser.py +0 -0
  59. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/cite_file.py +0 -0
  60. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/elicitation.py +0 -0
  61. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/files.py +0 -0
  62. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/folders.py +0 -0
  63. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/mcp.py +0 -0
  64. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/navigation.py +0 -0
  65. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/read.py +0 -0
  66. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/scheduled_tasks.py +0 -0
  67. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/search.py +0 -0
  68. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/subagent.py +0 -0
  69. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/web_search.py +0 -0
  70. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/commands/web_search_config.py +0 -0
  71. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/config.py +0 -0
  72. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/identity.py +0 -0
  73. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/metadata_filter.py +0 -0
  74. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/paths.py +0 -0
  75. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/shell.py +0 -0
  76. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/skills/unique-cli-elicitation/SKILL.md +0 -0
  77. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/skills/unique-cli-file-management/SKILL.md +0 -0
  78. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/skills/unique-cli-mcp/SKILL.md +0 -0
  79. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/skills/unique-cli-scheduled-tasks/SKILL.md +0 -0
  80. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/skills/unique-cli-search/SKILL.md +0 -0
  81. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/skills/unique-cli-subagent/SKILL.md +0 -0
  82. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/skills/unique-cli-uploaded-search/SKILL.md +0 -0
  83. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/skills/unique-cli-web-search/SKILL.md +0 -0
  84. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/state.py +0 -0
  85. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/cli/workspace.py +0 -0
  86. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/utils/analytics_order_run.py +0 -0
  87. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/utils/benchmarking_run.py +0 -0
  88. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/utils/chat_history.py +0 -0
  89. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/utils/chat_in_space.py +0 -0
  90. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/utils/file_io.py +0 -0
  91. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/utils/sources.py +0 -0
  92. {unique_sdk-2026.48.0.dev13 → unique_sdk-2026.48.0.dev15}/unique_sdk/utils/token.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: unique-sdk
3
- Version: 2026.48.0.dev13
3
+ Version: 2026.48.0.dev15
4
4
  Summary:
5
5
  Author: Martin Fadler, Konstantin Krauss, Andreas Hauri
6
6
  Author-email: Martin Fadler <martin.fadler@unique.ch>, Konstantin Krauss <konstantin@unique.ch>, Andreas Hauri <andreas@unique.ch>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "unique_sdk"
3
- version = "2026.48.0.dev13"
3
+ version = "2026.48.0.dev15"
4
4
  description = ""
5
5
  readme = "README.md"
6
6
  license = { text = "MIT" }
@@ -6,10 +6,12 @@ from typing import (
6
6
  TypedDict,
7
7
  cast,
8
8
  )
9
+ from urllib.parse import quote
9
10
 
10
11
  from typing_extensions import Unpack
11
12
 
12
13
  from unique_sdk._api_resource import APIResource
14
+ from unique_sdk._error import InvalidRequestError
13
15
  from unique_sdk._request_options import RequestOptions
14
16
 
15
17
 
@@ -163,8 +165,14 @@ class MagicTableActivityResponse(TypedDict):
163
165
 
164
166
 
165
167
  class MagicTableActionResult(TypedDict, total=False):
166
- """Generic `{status, message?}` response from lifecycle mutations (import, generate-artifact, sheet metadata writes)."""
168
+ """Action response from a magic-table lifecycle mutation.
167
169
 
170
+ ``object`` is ``magic-table-action``. ``id`` is the sheet the action was
171
+ performed on. ``message`` is set when the API sent one.
172
+ """
173
+
174
+ object: Literal["magic-table-action"]
175
+ id: str
168
176
  status: bool
169
177
  message: str | None
170
178
 
@@ -766,6 +774,62 @@ class AgenticTable(APIResource["AgenticTable"]):
766
774
  ),
767
775
  )
768
776
 
777
+ @classmethod
778
+ async def delete_row(
779
+ cls,
780
+ user_id: str,
781
+ company_id: str,
782
+ tableId: str,
783
+ rowId: str,
784
+ ) -> MagicTableActionResult:
785
+ """Permanently delete one content row by id.
786
+
787
+ Calls ``DELETE /magic-table/{tableId}/row/{rowId}``. ``rowId`` is the
788
+ id on a cell from ``get_sheet_data(..., includeCells=True)`` or
789
+ ``get_cell``, not the row order.
790
+ The header row, a locked row, and a row in a final review status are
791
+ rejected. A caller who is not a member of the sheet is rejected. A
792
+ row on a completed sheet can be deleted; the sheet status is then
793
+ recomputed. A missing sheet or row is not found.
794
+
795
+ Args:
796
+ user_id (str): Caller user id.
797
+ company_id (str): Caller company id.
798
+ tableId (str): Agentic Table sheet id.
799
+ rowId (str): Row id (``mt_row_...``), not the row order.
800
+
801
+ Returns:
802
+ MagicTableActionResult: ``object`` is ``magic-table-action``,
803
+ ``id`` is the sheet id, ``status`` says whether the delete was
804
+ accepted, and ``message`` is optional.
805
+
806
+ Raises:
807
+ InvalidRequestError: When ``rowId`` is ``.`` or ``..``. Those
808
+ segments are resolved by the HTTP client and would not address
809
+ the row.
810
+ UniqueError: On HTTP failure, including 400 for a rejected row and
811
+ 404 when the sheet or row does not exist.
812
+ """
813
+ # Quote both segments. A raw slash in rowId would select
814
+ # DELETE /magic-table/{tableId}/row/metadata/{metadataId}.
815
+ # "." and ".." are not encoded by quote, and the HTTP client resolves
816
+ # them, so "." becomes DELETE .../row and ".." becomes DELETE .../{tableId}.
817
+ if rowId in {".", ".."}:
818
+ raise InvalidRequestError(
819
+ "rowId must be a row id, not '.' or '..'",
820
+ "rowId",
821
+ )
822
+ url = f"/magic-table/{quote(tableId, safe='')}/row/{quote(rowId, safe='')}"
823
+ return cast(
824
+ MagicTableActionResult,
825
+ await cls._static_request_async(
826
+ "delete",
827
+ url,
828
+ user_id,
829
+ company_id,
830
+ ),
831
+ )
832
+
769
833
  @classmethod
770
834
  async def delete_row_metadata(
771
835
  cls,
@@ -20,6 +20,7 @@ from unique_sdk.cli.commands.agentic_table import (
20
20
  )
21
21
  from unique_sdk.cli.commands.agentic_table_write import (
22
22
  cmd_create_sheet,
23
+ cmd_delete_row,
23
24
  cmd_export,
24
25
  cmd_import,
25
26
  cmd_rerun_row,
@@ -2433,8 +2434,9 @@ Work with Agentic Table (magic table) sheets over the public magic-table API.
2433
2434
  \b
2434
2435
  Reads (get-sheet / get-cell / cell-history / list-exports) are Tier 0: no
2435
2436
  confirmation, no side effects. Writes (create-sheet / import / rerun-row /
2436
- set-cell / export) build and run a sheet — the full loop of create, populate,
2437
- run, and export — plus re-answering a single row or writing one cell's text.
2437
+ delete-row / set-cell / export) build and run a sheet — the full loop of
2438
+ create, populate, run, and export — plus re-answering a single row, deleting
2439
+ one content row, or writing one cell's text.
2438
2440
  Every call is scoped to the current user/company; sheet-role access (Owner / Can
2439
2441
  manage / Can edit) is enforced server-side and a denial is reported as
2440
2442
  `agentic-table: permission denied`.
@@ -2451,6 +2453,7 @@ Write subcommands:
2451
2453
  create-sheet Create a new sheet in a space
2452
2454
  import Import questions/sources (adding questions triggers the run)
2453
2455
  rerun-row Re-run the agent for a single row (import cannot redo a row)
2456
+ delete-row Permanently delete one content row by its row id
2454
2457
  set-cell Write text into one cell by row/column order (no run)
2455
2458
  export Generate export artifacts (report / question export)
2456
2459
 
@@ -2841,6 +2844,44 @@ def agentic_table_rerun_row(
2841
2844
  )
2842
2845
 
2843
2846
 
2847
+ @agentic_table.command(name="delete-row")
2848
+ @click.argument("table_id")
2849
+ @click.argument("row_id")
2850
+ @click.option(
2851
+ "--json", "output_json", is_flag=True, default=False, help="Print raw JSON."
2852
+ )
2853
+ @click.pass_context
2854
+ def agentic_table_delete_row(
2855
+ ctx: click.Context,
2856
+ table_id: str,
2857
+ row_id: str,
2858
+ output_json: bool,
2859
+ ) -> None:
2860
+ """Permanently delete one content row by its row id.
2861
+
2862
+ \b
2863
+ ROW_ID is the rowId on a cell (mt_row_...), not the row order get-cell
2864
+ --row prints. Read it with get-cell --json or get-sheet --cells --json.
2865
+ The header row, a locked row, and a row in a final review status are
2866
+ rejected. A caller who is not a member of the sheet is rejected. A row on
2867
+ a completed sheet can be deleted; the sheet status is then recomputed.
2868
+ One call deletes one row, the same way the sheet UI does.
2869
+
2870
+ \b
2871
+ Examples:
2872
+ unique-cli agentic-table delete-row mt_abc123 mt_row_e4d94icb5mtj99rmu2efhyel
2873
+ """
2874
+ emit(
2875
+ cmd_delete_row(
2876
+ LazyState.get(ctx),
2877
+ table_id,
2878
+ row_id,
2879
+ output_json=output_json,
2880
+ ),
2881
+ is_error=_is_agentic_table_error_output,
2882
+ )
2883
+
2884
+
2844
2885
  @agentic_table.command(name="set-cell")
2845
2886
  @click.argument("table_id")
2846
2887
  @click.option(
@@ -5,6 +5,7 @@ The full-loop write slice over the public magic-table API (``2023-12-06``):
5
5
  - ``create-sheet`` — create an empty sheet in a space.
6
6
  - ``import`` — add questions/sources; adding new questions triggers the agent run.
7
7
  - ``rerun-row`` — re-run the agent for a single row.
8
+ - ``delete-row`` — permanently delete one content row by its row id.
8
9
  - ``set-cell`` — write text into one cell (no run).
9
10
  - ``export`` — generate export artifacts (report / question export) and list them.
10
11
 
@@ -621,6 +622,90 @@ def cmd_rerun_row(
621
622
  return _error(exc)
622
623
 
623
624
 
625
+ def _invalid_row_id(row_id: str) -> str | None:
626
+ """Return a CLI error when *row_id* cannot be one path segment.
627
+
628
+ ``DELETE /magic-table/{tableId}/row/{rowId}`` interpolates the id into the
629
+ URL. A slash or query marker would address a different route. Any
630
+ whitespace, including a space in the middle of the id, is rejected here
631
+ so the HTTP client never sees it. ``.`` and ``..`` are rejected because the
632
+ HTTP client resolves them and the request would leave the row route. A
633
+ blank id names nothing. A digit-only value is a row order, which is a
634
+ different delete and is not this command.
635
+
636
+ Args:
637
+ row_id (str): Candidate row id from the command line.
638
+
639
+ Returns:
640
+ str | None: An ``agentic-table:`` error line, or ``None`` when the id
641
+ can be sent.
642
+ """
643
+ if row_id.strip() == "":
644
+ return f"{AGENTIC_TABLE_ERROR_PREFIX} row id is required"
645
+ if row_id in {".", ".."}:
646
+ return (
647
+ f"{AGENTIC_TABLE_ERROR_PREFIX} delete-row takes a row id, not '.' or '..'"
648
+ )
649
+ if any(char.isspace() for char in row_id) or any(char in row_id for char in "/?#"):
650
+ return (
651
+ f"{AGENTIC_TABLE_ERROR_PREFIX} row id must be a single id with no "
652
+ "whitespace, '/', '?', or '#'"
653
+ )
654
+ if row_id.isdigit():
655
+ return (
656
+ f"{AGENTIC_TABLE_ERROR_PREFIX} delete-row takes a row id "
657
+ "(for example mt_row_...), not a row order. Read rowId from "
658
+ "get-cell --json or get-sheet --cells --json"
659
+ )
660
+ return None
661
+
662
+
663
+ def cmd_delete_row(
664
+ state: ShellState,
665
+ table_id: str,
666
+ row_id: str,
667
+ *,
668
+ output_json: bool = False,
669
+ ) -> str:
670
+ """Permanently delete one content row (``DELETE .../row/{rowId}``).
671
+
672
+ ``row_id`` is the ``rowId`` on a cell from ``get-sheet --cells --json`` or
673
+ ``get-cell --json``, not the row order ``get-cell --row`` prints. The
674
+ header row, a locked row, and a row in a final review status are rejected
675
+ by the API. A caller who is not a member of the sheet is rejected. A row
676
+ on a completed sheet can be deleted; the sheet status is then recomputed.
677
+ One call deletes one row. The delete is permanent.
678
+
679
+ Args:
680
+ state (ShellState): CLI session, including the caller identity.
681
+ table_id (str): Agentic Table sheet id.
682
+ row_id (str): Row id to delete.
683
+ output_json (bool): When true, print the raw action JSON.
684
+
685
+ Returns:
686
+ str: Formatted result, or an ``agentic-table:`` error line.
687
+ """
688
+ invalid = _invalid_row_id(row_id)
689
+ if invalid is not None:
690
+ return invalid
691
+ try:
692
+ result = asyncio.run(
693
+ AgenticTable.delete_row(
694
+ user_id=state.config.user_id,
695
+ company_id=state.config.company_id,
696
+ tableId=table_id,
697
+ rowId=row_id,
698
+ )
699
+ )
700
+ except UniqueError as exc:
701
+ return _error(exc)
702
+ if not result.get("status"):
703
+ return _rejected(result, action="delete")
704
+ if output_json:
705
+ return json.dumps({"result": result}, indent=2, default=str)
706
+ return format_agentic_table_action_result(result, action="delete")
707
+
708
+
624
709
  def cmd_export(
625
710
  state: ShellState,
626
711
  table_id: str,
@@ -402,6 +402,27 @@ def format_agentic_table_sheet(
402
402
 
403
403
  cells = sheet.get("magicTableCells") or []
404
404
  if include_cells and cells:
405
+ # One id per row. The same id is on every cell of that row, and
406
+ # delete-row removes the whole row, so repeating it per cell invites
407
+ # a second delete of an id that is already gone.
408
+ row_ids: list[tuple[str, str]] = []
409
+ seen_orders: set[str] = set()
410
+ for cell in cells:
411
+ row_id = cell.get("rowId")
412
+ if not row_id:
413
+ continue
414
+ row_order = str(cell.get("rowOrder", "?"))
415
+ if row_order in seen_orders:
416
+ continue
417
+ seen_orders.add(row_order)
418
+ row_ids.append((row_order, str(row_id)))
419
+ if row_ids:
420
+ lines.append("")
421
+ lines.append("Row ids:")
422
+ id_rows: list[list[str]] = [["ROW", "ROW_ID"]]
423
+ id_rows.extend([list(pair) for pair in row_ids])
424
+ lines.extend(_pad_columns(id_rows))
425
+
405
426
  lines.append("")
406
427
  lines.append(f"Cells ({len(cells)}):")
407
428
  cell_rows: list[list[str]] = [["ROW", "COL", "TEXT"]]
@@ -423,9 +444,16 @@ def format_agentic_table_cell(cell: AgenticTableCell) -> str:
423
444
  rows = [
424
445
  ["Sheet:", cell.get("sheetId", "?")],
425
446
  ["Row:", str(cell.get("rowOrder", "?"))],
426
- ["Column:", str(cell.get("columnOrder", "?"))],
427
- ["Locked:", "yes" if cell.get("rowLocked") else "no"],
428
447
  ]
448
+ row_id = cell.get("rowId")
449
+ if row_id:
450
+ rows.append(["Row id:", row_id])
451
+ rows.extend(
452
+ [
453
+ ["Column:", str(cell.get("columnOrder", "?"))],
454
+ ["Locked:", "yes" if cell.get("rowLocked") else "no"],
455
+ ]
456
+ )
429
457
  lines = _pad_columns(rows)
430
458
  lines.append("")
431
459
  lines.append("Text:")
@@ -5,7 +5,8 @@ description: >-
5
5
  unique-cli agentic-table command. Use when the user or task involves an
6
6
  Agentic Table: inspecting a sheet's state, a cell's value or lock state, a
7
7
  cell's edit history or its export artifacts; writing text into a specific
8
- cell; or running the full loop — creating a sheet, importing a questionnaire
8
+ cell; deleting one content row by its row id; or running the full loop —
9
+ creating a sheet, importing a questionnaire
9
10
  and sources, waiting for the agent to answer, and exporting the result.
10
11
  Access is enforced per sheet by the platform and varies from sheet to sheet;
11
12
  a denial is reported as `agentic-table: permission denied`.
@@ -22,18 +23,28 @@ Commands fall into two groups:
22
23
  - **Read (Tier 0)** — `get-sheet`, `get-cell`, `cell-history`, `list-exports`.
23
24
  Never modify anything, never need confirmation.
24
25
  - **Write (Tier 1)** — `create-sheet`, `import`, `export`, `rerun-row`,
25
- `set-cell`. These create a sheet, add questions and sources, start the agent
26
- run, produce export artifacts, redo a single generated answer, or write
27
- text you already have into one cell. None of them prompts for confirmation,
28
- but they do change a shared artifact, so say what you did afterwards.
26
+ `delete-row`, `set-cell`. These create a sheet, add questions and sources,
27
+ start the agent run, produce export artifacts, redo a single generated
28
+ answer, permanently delete one content row, or write text you already have
29
+ into one cell. The commands themselves do not prompt. They change a shared
30
+ artifact, so say what you did afterwards.
31
+
32
+ `delete-row` is permanent, so it is the exception for you. Before you run
33
+ it, get a confirmation elicitation: an empty-properties schema, and proceed
34
+ only when the status is `ACCEPTED`. Name the sheet and the row id, and say
35
+ the delete cannot be undone. `DECLINED`, `REJECTED`, `CANCELLED`, and
36
+ `EXPIRED` mean stop. A person running the CLI directly does not take this
37
+ step.
29
38
 
30
39
  `create-sheet`, `import`, and `export` only add. `rerun-row` asks the table
31
- agent to regenerate one **row** from sources (no text from you). `set-cell`
40
+ agent to regenerate one **row** from sources (no text from you).
41
+ `delete-row` permanently removes one content row by its `rowId`. `set-cell`
32
42
  writes **your** text into one cell immediately — it is not a run. Name the
33
43
  row (and column, for `set-cell`) when you report back.
34
44
 
35
- Some rows are protected. A locked or final-review row rejects both
36
- `set-cell` and `rerun-row`. That is deliberate — do not route around it.
45
+ Some rows are protected. A locked or final-review row rejects `set-cell`,
46
+ `rerun-row`, and `delete-row`. The header row also rejects `delete-row`.
47
+ That is deliberate — do not route around it.
37
48
 
38
49
  ## Permissions
39
50
 
@@ -87,7 +98,9 @@ unique-cli agentic-table get-cell <table_id> --row N --col N
87
98
  ```
88
99
 
89
100
  Shows one cell's text and lock state. `--row`/`--col` are 0-based orders.
90
- Add `--json` for the raw cell record.
101
+ Add `--json` for the raw cell record, including `rowId`. The formatted view
102
+ prints `Row id` when the API returned it. `delete-row` takes that id, not
103
+ `--row`.
91
104
 
92
105
  ```bash
93
106
  unique-cli agentic-table get-cell mt_abc123 --row 1 --col 2
@@ -206,6 +219,50 @@ run at a time, so a second `rerun-row` fired before the first finishes is
206
219
  declined. There is no batch form. If most of the sheet needs redoing, consider
207
220
  a fresh sheet instead.
208
221
 
222
+ ### Delete one row
223
+
224
+ ```bash
225
+ unique-cli agentic-table delete-row <table_id> <row_id>
226
+ ```
227
+
228
+ Permanently deletes one content row, the same way the sheet UI does.
229
+ Before you run it, get a confirmation elicitation. The command does not ask.
230
+ Name the sheet and the row id, and say the delete cannot be undone. Use an
231
+ empty-properties schema and proceed only on `ACCEPTED`. Stop on `DECLINED`,
232
+ `REJECTED`, `CANCELLED`, or `EXPIRED`.
233
+
234
+ `<row_id>` is the `rowId` on a cell (`mt_row_...`), **not** the row order
235
+ `--row` prints. A row order shifts when rows above it are removed, so it is
236
+ not a safe address for a delete. Read the id first:
237
+
238
+ ```bash
239
+ unique-cli agentic-table get-cell mt_abc123 --row 1 --col 0 --json
240
+ ```
241
+
242
+ Use the `rowId` field. `get-sheet --cells --json` carries the same field on
243
+ each cell. `get-sheet --cells` prints each row id once, under `Row ids`. One
244
+ call deletes one row. There is no batch form. A digit-only argument is
245
+ refused before the request is sent.
246
+
247
+ Report these refusals. Do not look for another way to remove the row:
248
+
249
+ - The header row cannot be deleted.
250
+ - A locked row, or a row in a final review status, cannot be deleted.
251
+ - A caller who is not a member of the sheet is rejected. That arrives as a
252
+ 400 with the API message, not as `permission denied`. A 403 is still
253
+ `permission denied`.
254
+ - A missing sheet or row is not found.
255
+
256
+ A row on a completed sheet can be deleted. The sheet status is then
257
+ recomputed. Confirm with `get-sheet <table_id> --cells --json`. The row is
258
+ gone when the returned cells include `rowId` and none of them is the deleted
259
+ id. Cells that omit `rowId` leave the check inconclusive. A summary-only
260
+ `get-sheet` does not include cells.
261
+
262
+ ```bash
263
+ unique-cli agentic-table delete-row mt_abc123 mt_row_e4d94icb5mtj99rmu2efhyel
264
+ ```
265
+
209
266
  ### Write one cell
210
267
 
211
268
  ```bash
@@ -289,7 +346,7 @@ re-import.
289
346
  question is row 1. This holds for `--row`/`--col` on `get-cell`,
290
347
  `cell-history`, and `set-cell`, and for `<row_order>` on `rerun-row`; the
291
348
  same number means the same row in every command. `set-cell` may write row 0;
292
- `rerun-row` may not.
349
+ `rerun-row` may not. `delete-row` does not take a row order: pass `rowId`.
293
350
  2. Fetch what you need, not everything. `get-cell` for one value,
294
351
  `get-sheet --cells` for an overview — don't dump a whole sheet unless asked.
295
352
  Look up coordinates before `set-cell`; do not guess a column index.
@@ -307,6 +364,10 @@ re-import.
307
364
  when summarising for a person.
308
365
  7. `set-cell` when you have the text. `rerun-row` when the table agent should
309
366
  regenerate from sources. Never both for the same correction.
367
+ 8. `delete-row` removes one content row permanently. Get a confirmation
368
+ elicitation before you run it; the command itself does not ask. Pass
369
+ `rowId`, never a row order. Do not delete the header, a locked row, or a
370
+ final-review row. Name the row when you tell the user what you deleted.
310
371
 
311
372
  ## Prerequisites
312
373